Optimal stopping in mathematical with applications to finance

Peter Johnson Outline Optimal stopping in mathematical statistics Sequential testing with applications to finance Quickest detection

More general diffusions Peter Johnson Financial applications School of , The University of Manchester Other applications References 9 Feb 2016 Optimal stopping in mathematical statistics with applications to finance

Peter Johnson 1 Sequential testing Outline 2 Quickest detection Sequential testing 3 General diffusion processes Quickest detection 4 Financial applications More general • Pairs trading stategy diffusions • Arbitrage detection Financial applications • Updating model parameters (e.g. bubble modelling) Other 5 Other applications applications

References 6 References Optimal stopping in mathematical statistics with applications to finance

Peter Johnson

Outline

Sequential testing

Quickest detection Sequential testing. More general diffusions

Financial applications

Other applications

References Optimal stopping in mathematical statistics with Problem. applications to finance

Peter Johnson Say we observe diffusion process X = (Xt )t≥0 such that X Outline solves the following SDE Sequential testing   Quickest dXt = µ0 + θ µ1 − µ0 dt + σdBt , detection

More general diffusions with X0 = 0. Financial applications However, θ is an unobservable random variable that takes Other applications either value 1 or 0 with probability π or (1 − π) respectively. References It is also assumed to be independent of Bt .

Then through observation of X we wish to determine the value of θ as quickly and accurately as possible. Optimal stopping in mathematical statistics with Hypothesis test. applications to finance

Peter Johnson

Outline

Sequential testing This can be seen as a hypothesis testing problem on the value Quickest of θ. detection

More general diffusions H0 : θ = 0, Xt = µ0t + σBt , Financial H θ = 1, X = µ t + σB applications 1 : t 1 t

Other applications To solve this problem we can formalise it as an optimal References stopping problem. Optimal stopping in mathematical statistics with Defining the . applications to finance

Peter Johnson

Outline

Sequential testing

Quickest detection Firstly we can define a measure Pπ such that

More general 1 0 diffusions Pπ = πP + (1 − π)P Financial applications where under P1(θ = 1) = 1 and P0(θ = 0) = 1. Other applications

References Optimal stopping in mathematical statistics with Formulation of problem. applications to finance In order to find the optimal time to come to a decision on the Peter Johnson value of θ the problem can be formulated as an optimal

Outline stopping problem where we wish to minimise the following

Sequential costs; testing • Expected time to come to a decision Quickest detection More general Eπ[τ] diffusions

Financial applications • Expected costs of a wrong terminal decision

Other applications aPπ(d = 0, θ = 1) + bPπ(d = 1, θ = 0) References Hence this can be written as the following optimal stopping problem  V (π) = inf Eπ(τ) + aPπ(d = 0, θ = 1) + bPπ(d = 1, θ = 0) (τ,d) Optimal stopping in mathematical statistics with Traditional formulation. applications to finance

Peter Johnson This formulation may be rewritten in terms of the a posteriori Outline

Sequential process, defined as testing X Quickest πt = P (θ = 1|F ), π0 = π. detection π t

More general diffusions Becoming of the form

Financial applications V (π) = inf Eπ [τ + aπτ ∧ b(1 − πτ)] Other τ applications

References where

• d = 1 if πτ > b/(a + b)

• d = 0 if πτ < b/(a + b) Optimal stopping in mathematical statistics with Likelihood ratio applications to finance

Peter Johnson

Outline The a posteriori process can be defined via the likelihood ratio Sequential process Lt in the one-to-one function testing Quickest π L detection 1−π t πt = π More general 1 + 1 Lt diffusions −π Financial 1 applications where Lt is defined as the Girsanov measure change from P to 0 Other P given to be applications References  2 2  µ1 − µ0 µ1 − µ0 Lt = exp Xt − t σ2 2σ2 Optimal stopping in mathematical statistics with SDE of a posteriori process. applications to finance

Peter Johnson

Outline Sequential The a posteriori process can be seen to solve the following SDE testing

Quickest detection µ1 − µ0 dπt = πt (1 − πt )dB¯t More general σ diffusions

Financial where applications  t  Other 1 Z applications B¯t = Xt − (µ0 + πs (µ1 − µ0)) ds σ 0 References Optimal stopping in mathematical statistics with Reduction to ODE. applications to finance

Peter Johnson

Outline 2 2 Sequential (µ1 − µ0) 2 2 d testing π (1 − π) V (π) = −1 for π ∈ (A, B), 2σ2 dπ2 Quickest detection V (A) = aA More general diffusions V (B) = b(1 − A) Financial applications V 0 A a smoothfit Other ( ) = ( ) applications 0 References V (B) = −b (smoothfit) V < aπ ∧ b(1 − π) for π ∈ (A, B) V = aπ ∧ b(1 − π) for π ∈ [0, A) ∪ (B, 1] Optimal stopping in mathematical statistics with Solution to ODE. applications to finance Letting π Peter Johnson ψ(π) = (1 − 2π)log( ) 1 − π Outline then we have that Sequential testing

Quickest 2 2 detection 2σ 2σ V ( ) = ( ( ) − (A)) + (a − 0(A))( − A) + aA More general π 2 ψ π ψ 2 ψ π diffusions µ µ

Financial applications if π ∈ (A, B) and

Other applications V (π) = aπ ∧ b(1 − π) References if π ∈ [0, A) ∪ (B, 1]. While A ∈ (0, c) and B ∈ (c, 1) are given as the solution of the following transcendental equations:

V (B; A) = b(1 − B)

V 0(B; A) = −b Optimal stopping in mathematical statistics with Pictures. applications to finance

Peter Johnson

Outline 1.0

Sequential testing 0.8 Quickest detection

More general 0.6 diffusions Out[3034]= Financial applications 0.4

Other applications 0.2 References

0.0 0 200 400 600 800 1000 Optimal stopping in mathematical statistics with Pictures. applications to finance

Peter Johnson

Outline 1000 Sequential testing 800 Quickest detection 600 More general diffusions Out[3035]= 400 Financial applications

Other 200 applications

References 200 400 600 800 1000 Optimal stopping in mathematical statistics with Pictures. applications to finance

Peter Johnson

Outline 1.0

Sequential testing 0.8 Quickest detection

More general 0.6 diffusions Out[3106]= Financial applications 0.4

Other applications 0.2 References

0.0 0 200 400 600 800 1000 Optimal stopping in mathematical statistics with Pictures. applications to finance

Peter Johnson

Outline 600 Sequential testing

Quickest detection 400 More general diffusions Out[3107]= Financial 200 applications

Other applications

References 200 400 600 800 1000 Optimal stopping in mathematical statistics with applications to finance

Peter Johnson

Outline

Sequential testing

Quickest detection Bayesian quickest detection. More general diffusions

Financial applications

Other applications

References Optimal stopping in mathematical statistics with Problem. applications to finance

Peter Johnson Say we observe diffusion process X = (Xt )t≥0 such that X solves the following SDE Outline Sequential   testing dXt = µ0 + I (t ≥ Θ) µ1 − µ0 dt + σdBt , Quickest detection with X = 0. More general 0 diffusions

Financial applications However, Θ is an unobservable random variable which takes the

Other value Θ = 0 with probability π and is exponentially distributed applications with parameter λ given Θ > 0 with probability (1 − π). References It is also assumed to be independent of Bt .

Then through observation of X we wish to determine when the change point Θ has occurred, as quickly and accurately as possible . Optimal stopping in mathematical statistics with Bayesian quickest detection. applications to finance

Peter Johnson

Outline So to reiterate before the change point the observed process Sequential testing behaves like Quickest detection Xt = µ0t + σBt , More general diffusions

Financial and after the change point Θ it behaves like applications Other X = µ t + σB , applications t 1 t References To solve this problem we can again formalise it as an optimal stopping problem. Optimal stopping in mathematical statistics with Defining the probability measure. applications to finance

Peter Johnson

Outline

Sequential testing Quickest Firstly we can define a measure Pπ such that detection

More general Z ∞ 0 −λs s diffusions Pπ = πP + (1 − π) λe P ds Financial 0 applications s Other where under P (Θ = s) = 1. applications

References Optimal stopping in mathematical statistics with Formulation of the problem. applications to finance In order to find the optimal the problem can be Peter Johnson formulated as an optimal stopping problem where we wish to Outline minimise the following; Sequential testing • Probability of false alarm Quickest detection Pπ(τ < Θ) More general diffusions

Financial • The delay taken to come to a decision after Θ applications

Other + applications Eπ[(τ − Θ) ]

References Hence this can be written as the following optimal stopping problem

+  V (π) = inf Pπ(τ < Θ) + cEπ[(τ − Θ) ] τ Optimal stopping in mathematical statistics with Traditional formulation. applications to finance

Peter Johnson

Outline

Sequential This formulation may be rewritten in terms of the a posteriori testing process, defined as Quickest detection X More general πt = Pπ(Θ ≤ t|Ft ), π0 = π. diffusions Financial Becoming of the form applications Other  Z τ  applications V (π) = inf Eπ 1 − πτ + c πt dt References τ 0 Optimal stopping in mathematical statistics with Likelihood process. applications to finance The a posteriori process can be defined via the likelihood ratio Peter Johnson process ϕt in the one-to-one function Outline

Sequential ϕt testing πt = 1 + ϕt Quickest detection

More general where ϕt is defined by diffusions

Financial  Z t −λs  λt π e applications ϕt = e Lt + λ ds Other 1 − π 0 Ls applications References and as before Lt is defined by the Girsanov measure change given to be

 2 2  µ1 − µ0 µ1 − µ0 Lt = exp Xt − t σ2 2σ2 Optimal stopping in mathematical statistics with SDE of posteriori process. applications to finance

Peter Johnson

Outline Sequential The a posteriori process can be seen to solve the following SDE testing Quickest − detection µ1 µ0 dπt = λ(1 − πt )dt + πt (1 − πt )dB¯t More general σ diffusions

Financial where again we define applications Other 1  Z t  applications B¯t = Xt − (µ0 + πs (µ1 − µ0)) ds References σ 0 Optimal stopping in mathematical statistics with Reduction to ODE. applications to finance

Peter Johnson

Outline LπV (π) = −cπ for π ∈ [0, A), Sequential testing V (A) = 1 − A, Quickest detection V 0(A) = −1, (smoothfit) More general diffusions V ( ) < 1 − for ∈ [0, A), Financial π π π applications V ( ) = 1 − for ∈ [A, 1], Other π π π applications

References where

2 2 d (µ1 − µ0) d L = λ(1 − π) + π2(1 − π)2 . π dπ 2σ2 dπ2 Optimal stopping in mathematical statistics with Solution to ODE. applications to finance Letting 2 Peter Johnson µ γ = , 2 2 Outline σ λ α(ρ) Sequential c λ Z π e γ testing − γ α(π) ψ(π) = − e 2 dρ Quickest γ 0 ρ(1 − ρ) detection

More general such that A is the unique solution of diffusions

Financial applications ψ(A) = −1.

Other applications Then the value function is explicitly given by

References  (1 − A) + R π ψ(ρ)dρ if π ∈ [0, A) V (π) = A 1 − π if π ∈ [A, 1] and the optimal stopping time is defined to be

τ = inf{t ≥ 0 : πt ≥ A}. Optimal stopping in mathematical statistics with Pictures. applications to finance

Peter Johnson

1.0 Outline

Sequential testing 0.8 Quickest detection

More general 0.6 diffusions Out[2126]= Financial applications 0.4

Other applications

0.2 References

0.0 0 200 400 600 800 1000 Optimal stopping in mathematical statistics with Pictures. applications to finance

Peter Johnson

Outline

Sequential 300 testing

Quickest detection 200

More general diffusions 100 Out[2127]= Financial applications 0 200 400 600 800 1000 Other applications -100 References

-200 Optimal stopping in mathematical This type of problem can be tackled for more general statistics with diffusions, where the drift and diffusion coefficients may depend applications to finance the current position of the observed process, I.e. for sequential Peter Johnson testing we observe

Outline

Sequential dXt = (µ0(Xt ) + θ(µ1(Xt ) − µ0(Xt )))dt + σ(Xt )dBt testing

Quickest detection or in a quickest detection setting we have

More general diffusions dXt = (µ0(Xt )+I (Θ ≥ t)(µ1(Xt ) − µ0(Xt )))dt + σ(Xt )dBt Financial applications A very important quantity in both these sets of problems is Other applications known as the signal-to-noise ratio (SNR) defined by References µ1(x) − µ0(x) ρ(x) = σ(x) If this quantity is constant then the problems can be solved in a similar way to the canonical with drift case. Optimal stopping in mathematical statistics with applications to finance However, if the SNR is non-constant is then the problems Peter Johnson become much more difficult to solve. Outline

Sequential testing In this case the sufficient statistic is now the pair (Xt , πt ),

Quickest which makes the problem two dimensional (much harder as detection now the boundaries will also be a function of the position of More general diffusions the observed process Xt ). Financial applications Recent developments have seen the first examples of these Other applications problems being solved for a process with non-constant SNR, in References particular a Bessel process with unknown/changing dimension (see references). Optimal stopping in mathematical statistics with applications to finance

Peter Johnson

Outline

Sequential testing

Quickest detection Applications. More general diffusions

Financial applications

Other applications

References Optimal stopping in mathematical statistics with Pairs trading strategy. applications to finance

Peter Johnson

Outline ”The strategy monitors performance of two historically Sequential testing correlated securities. When the correlation between the two Quickest securities temporarily weakens, i.e. one stock moves up while detection the other moves down, the pairs trade would be to short the More general diffusions outperforming stock and to long the underperforming one, Financial applications betting that the ”spread” between the two would eventually

Other converge. The divergence within a pair can be caused by applications temporary supply/demand changes, large buy/sell orders for References one security, reaction for important news about one of the companies, and so on.” Optimal stopping in mathematical statistics with Pairs trading strategy. applications to finance The difference between the two stocks if often modelled using Peter Johnson a Ornstein-Uhlenbeck process.

Outline

Sequential dXt = α(β − Xt )dt + σdBt . testing Quickest However if the stocks become ‘uncoupled’ then this difference detection will lose its mean-reversion property so changing to a simple More general diffusions Brownian motion. Financial applications

Other Quickest detection of this change-point would reduce losses applications incurred due to continuing a pairs trading strategy when the References stocks are uncoupled.

Failure to detect such a uncoupling, caused in part by the 1998 Russian financial crisis, cost ‘Long-term capital management’ (whose directors included Scholes and Merton) around $150 million before its ultimate collapse. Optimal stopping in mathematical statistics with Detection of arbitrage. applications to finance

Peter Johnson

Outline

Sequential Stocks are often modelled using geometric Brownian motion testing solving Quickest detection dXt = µ0Xt dt + σXt dBt

More general diffusions which is then used to price derivatives under the risk-neutral Financial measure such that µ0 = r. applications

Other applications A detection of a change in the drift rate away from the risk-free References rate, µ1 6= r, would represent an arbitrage opportunity using derivatives priced in this manner. Optimal stopping in mathematical statistics with Updating model parameters. applications to finance

Peter Johnson

Outline

Sequential Bessel processes have been used to model financial bubbles testing through considering an observed process of 1/Xt such that Quickest detection δ0 − 1 More general dXt = dt + dBt diffusions 2Xt Financial applications However if you can detect a change of dimension in the Other applications observed data you are modelling then this can be quickly

References integrated into your model for a more accurate description and response of the appearance of the financial bubble. Optimal stopping in mathematical statistics with Other applications applications to finance

Peter Johnson

Outline • Seismic activity. Sequential testing • Psychological testing. Quickest detection • Quality control. More general • Communications. diffusions

Financial • Radar detection. applications • Detection of instability in power systems. Other applications • Sonar detection. References • Detecting breakages in atomic clocks in space. • Detecting radioactive materials. Optimal stopping in mathematical statistics with References applications to finance

Peter Johnson

Outline Peskir, G. and Shiryaev, A. (2006). Optimal Stopping Sequential and Free-Boundary Problems. Birkhuser. testing Quickest Shiryaev, A. N. (1978). Optimal Stopping Rules, detection Springer-Verlag. More general diffusions Gapeev, P. and Shiryaev, A. (2011). On the Financial applications Sequential testing Problem for some Diffusion Processes, Other Stochastics: An International Journal of Probability and applications Stochastic Processes, Vol. 83, No. 4-6, (519–535) References Gapeev, P. V. and Shiryaev, A. N. (2013). Bayesian quickest detection problems for some diffusion processes, Adv. in Appl. Probab., Vol. 45, (164–185). Optimal stopping in mathematical statistics with References applications to finance

Peter Johnson Johnson, P. J. and Peskir, G. (2014). Sequential Outline testing problems for Bessel Processes, Research Report, Sequential testing No. 24, Probab. Statist. Group Manchester (to appear). Quickest detection Johnson, P. J. and Peskir, G. (2014). Quickest More general detection problems for Bessel Processes, Research Report, diffusions No. 25, Probab. Statist. Group Manchester (to appear). Financial applications

Other Shiryaev, A. N. (2010). Quickest detection problems: applications Fifty years later, Sequential Anal., Vol. 29, (345–385). References Buonaguidi, B. and Muliere, P. (2012). A note on some sequential problems for the equilibrium value of a Vasicek process, Pioneer Journal of Theoretical and Applied Statistics, Vol. 4, No. 2, (101–116). Optimal stopping in mathematical statistics with applications to finance

Peter Johnson

Outline

Sequential testing

Quickest detection Thank you for listening.

More general diffusions

Financial applications

Other applications

References