post list
QuantDare
categories
all

Neural Networks

alarije

all

Foreseeing the future: a user’s guide

Jose Leiva

all

Stochastic portfolio theory, revisited!

P. López

all

“Past performance is no guarantee of future results”, but helps a bit

ogonzalez

all

Playing with Prophet on Financial Time Series (Again)

rcobo

all

The Simpson Paradox

kalinda

all

Seeing the market through the trees

xristica

all

Shift or Stick? Should we really ‘sell in May’?

jsanchezalmaraz

all

What to expect when you are the SPX

mrivera

all

K-Means in investment solutions: fact or fiction

T. Fuertes

all

Lévy Flights. Foraging in a Finance blog. Part II

mplanaslasa

all

How to… use bootstrapping in Portfolio Management

psanchezcri

all

What is the difference between Artificial Intelligence and Machine Learning?

ogonzalez

all

Playing with Prophet on Financial Time Series

rcobo

all

Prices Transformation Cheat Sheet

fjrodriguez2

all

Dual Momentum Analysis

J. González

all

Random forest: many are better than one

xristica

all

Non-parametric Estimation

T. Fuertes

all

Classification trees in MATLAB

xristica

all

Using Multidimensional Scaling on financial time series

rcobo

all

Applying Genetic Algorithms to define a Trading System

aparra

all

Graph theory: connections in the market

T. Fuertes

all

Lévy flights. Foraging in a finance blog

mplanaslasa

all

Data Cleansing & Data Transformation

psanchezcri

all

Principal Component Analysis

j3

all

Comparing ETF Sector Exposure Using Chord Diagrams

rcobo

all

Learning with kernels: an introductory approach

ogonzalez

all

SVM versus a monkey. Make your bets.

P. López

all

Clustering: “Two’s company, three’s a crowd”

libesa

all

Euro Stoxx Strategy with Machine Learning

fjrodriguez2

all

Visualizing Fixed Income ETFs with T-SNE

j3

all

Hierarchical clustering, using it to invest

T. Fuertes

all

Lasso applied in Portfolio Management

psanchezcri

all

Markov Switching Regimes say… bear or bullish?

mplanaslasa

all

Exploring Extreme Asset Returns

rcobo

all

Playing around with future contracts

J. González

all

“K-Means never fails”, they said…

fjrodriguez2

all

What is the difference between Bagging and Boosting?

xristica

all

BETA: Upside Downside

j3

all

Outliers: Looking For A Needle In A Haystack

T. Fuertes

all

Autoregressive model in S&P 500 and Euro Stoxx 50

psanchezcri

all

“Let’s make a deal”: from TV shows to identifying trends

mplanaslasa

all

Machine Learning: A Brief Breakdown

libesa

all

Approach to Dividend Adjustment Factor Calculation

J. González

all

Are Low-Volatility Stocks Expensive?

jsanchezalmaraz

all

Predict returns using historical patterns

fjrodriguez2

all

Dream team: Combining classifiers

xristica

all

Stock classification with ISOMAP

j3

all

Could the Stochastic Oscillator be a good way to earn money?

T. Fuertes

all

Central Limit Theorem: Visual demonstration

kalinda

all

Sir Bayes: all but not naïve!

mplanaslasa

all

Returns clustering with k-Means algorithm

psanchezcri

all

Correlation and Cointegration

j3

all

Momentum premium factor (II): Dual momentum

J. González

all

Dynamic Markowitz Efficient Frontier

plopezcasado

all

Confusion matrix & MCC statistic

mplanaslasa

all

Prices convolution, a practical approach

fuzzyperson

all

‘Sell in May and go away’…

jsanchezalmaraz

all

S&P 500 y Relative Strength Index II

Tech

all

Performance and correlated assets

T. Fuertes

all

Reproducing the S&P500 by clustering

fuzzyperson

all

Retrocesos y Extensiones de Fibonacci

fjrodriguez2

all

Size Effect Anomaly

T. Fuertes

all

Predicting Gold using Currencies

libesa

all

La Paradoja de Simpson

kalinda

all

Inverse ETFs versus short selling: a misleading equivalence

J. González

all

Random forest vs Simple tree

xristica

all

S&P 500 y Relative Strength Index

Tech

all

Efecto Herding

alarije

all

Cointegración: Seguimiento sobre cruces cointegrados

T. Fuertes

all

Seasonality systems

J. González

all

Una aproximación Risk Parity

mplanaslasa

all

Números de Fibonacci

fjrodriguez2

all

Using Decomposition to Improve Time Series Prediction

libesa

all

Las cadenas de Markov

j3

all

Clasificando el mercado mediante árboles de decisión

xristica

all

Momentum premium factor sobre S&P 500

J. González

all

Árboles de clasificación en Matlab

xristica

all

Fractales y series financieras II

Tech

all

Redes Neuronales II

alarije

all

El gestor vago o inteligente…

jsanchezalmaraz

all

In less of a Bayes haze…

libesa

all

Teoría de Valores Extremos II

kalinda

all

De Matlab a Octave

fuzzyperson

all

Cointegración

T. Fuertes

all

Cópulas: una alternativa en la medición de riesgos

mplanaslasa

all

¿Por qué usar rendimientos logarítmicos?

jsanchezalmaraz

all

Análisis de Componentes Principales

j3

all

Vecinos cercanos en una serie temporal

xristica

all

Redes Neuronales

alarije

all

Fuzzy Logic

fuzzyperson

all

El filtro de Kalman

mplanaslasa

all

Estimación no paramétrica

T. Fuertes

all

Fractales y series financieras

Tech

all

In a Bayes haze…

libesa

all

Volatility of volatility. A new premium factor?

J. González

all

Caso Práctico: Multidimensional Scaling

rcobo

all

Teoría de Valores Extremos

kalinda

all

Interviewing prices: Don’t settle for less

jramos

21/06/2017

No Comments
Interviewing prices: Don’t settle for less

We often face the problem of having to sell an asset within a specified period of time. This problem worsens if we also lack information about our asset’s historical prices. Under this circumstance, when should we sell our asset?

In this post I’ll resolve this dilemma based on the classic Secretary Problem – also known as The Sultan’s Dowry Problem. This problem owes its name to the situation that a manager encounters when he wants to hire the best applicant for the vacant secretary position in his firm. He sequentially interviews each applicant for the job. Immediately after each interview, the manager must decide whether to reject the applicant or hire them. Once rejected, an applicant cannot be recalled.

Our problem is identical. Let’s imagine I’m in possession of a share whose prices have gotten so unstable that its historical price information is no longer useful. My financial advisors have warned me against trading it, at least until the dust has finally settled. However, it seems that this situation will linger much longer than I’m willing to be involved in it for. So I’ve come to a decision: I’m selling this share within the next 100 days.

Each day, my share takes a different price and I can decide to sell it, or hold in hopes of finding a better price. I don’t want to settle for less, so I’m aiming to sell it for the best price of all among the next 100 prices. Thus, just as the manager from the Secretary Problem, I have to decide when to stop looking through new applicant prices and sell my asset.

 

Let’s start recruiting!

On day 1, I check my share price \(p_{1}\). I feel that if I sell it right now – and taking into account our hypotheses – I’m betting that none of the next 99 prices will beat the current one. I’d better wait until tomorrow.

On day 2, I gladly find that today’s price \(p_{2}\) beats \(p_{1}\). “Good news I didn’t sell yesterday!” I say to myself. Should I sell now? Should I hold? I feel I’m on a roll so I hold, at least, until tomorrow.

On day 3, I get a dose of reality when I find that my share’s price has dropped even lower than day 1 price. I can’t go on with this game. It’s only day 3 and I might have lost the chance of selling the share for the best price.

 

Time to put our math to work

At this point, I notice several aspects of my problem:

  • Selling too soon reduces the chance of finding the best price.
  • Waiting too long increases the chance of looking past the best price and rejecting it.

The solution to this problem consists of checking the first \(k\) prices, \(p_{1}\), \(p_{2}\),…, \(p_{k}\) and rejecting them, regardless. After that, we should sell our share for the first price that beats those. In case none of the latter beats them – this happens when the best price is among the first \(k\) prices – we’ll have to sell it for the last price \(p_{N}\). The aim of our problem is to choose the optimal number of prices, \(k\), that we have to reject no matter what, in order to maximise the odds of choosing the best price of all.

In short, the steps we’ll follow are:

  • Begin checking and rejecting the first \(k\) prices.
  • After the \(k\)-th price is known:
    • If the current price beats all the previous ones: Sell the share.
    • Else: Reject current price and keep checking.
  • If we reach the last price, we’ll have to sell our share for that price.

In order to compute the optimal \(k\), we’ll denote the probability of choosing the best price among the \(N\) available, rejecting prices up until \(k\) just as mentioned before by \(P_{N}(S_{k})\). From the formula of total probability:

$$P_{N}(S_{k}) = \sum_{i=1}^{N} P(A_{i})\cdot P_{N}(S_{k}|A_{i})$$

Where \(A_{i}\) is the event of the best price being in the \(i\)-th position, and \(N\) is the maximum number of prices we can check. In our case \(N\)=100.

We’ll assume that the events \(A_{i}\) are equally possible for every \(i\). Thus,\(P(A_{i})={\frac{1}{N}} \forall i\). We also know that we’ll only choose the best price if it’s posterior to the \(k\)-th position, so \(P_{N}(S_{k}|A_{i}) = 0\) for \(i=1,…,k\). This means that:

$$P_{N}(S_{k}) = {\frac{1}{N}} \sum_{i=k+1}^{N} P_{N}(S_{k}|A_{i})$$

The best price located at the \(i\)-th position (\(i>k\)) will be chosen if, and only if, the highest price prior to it has been rejected, i.e. if the highest of the \(i-1\) already seen prices is among the \(k\) first prices. The odds of this happening are \({\frac{k}{i-1}}\). Substituting in the previous formula:

$$P_{N}(S_{k}) = {\frac{1}{N}} \sum_{i=k+1}^{N} {\frac{k}{i-1}} = {\frac{k}{N}}\sum_{i=k+1}^{N} {\frac{1}{i-1}} = {\frac{k}{N}} [ \,  {\frac{1}{k}}+{\frac{1}{k+1}}+…+{\frac{1}{N-1}}] \,$$

Back to our problem

If we plot this probability with \(N=100\), for every \(k=1,…,99\) we get:

Probability of success

We can see that \(k=37\) maximizes the chances of success. According to my calculations, I’ll choose the best price with a probability of 37.10% if I follow the strategy of rejecting the first 37 prices. Not bad!

Nevertheless, I can’t help noticing that my hypotheses imply that prices follow no pattern and this wild behaviour will remain for at least 100 days.

In which other situations could I benefit from this strategy?

Tweet about this on TwitterShare on LinkedInShare on FacebookShare on Google+Email this to someone

add a comment

wpDiscuz