politecnico di milano · 2019. 3. 26. · this theory is known as quantum finance. the geometric...

62
POLITECNICO DI MILANO DOCTORAL PROGRAMME IN Mathematical Models and Methods in Engineering DEPARTMENT OF MATHEMATICS Quantum finance models for the simulation of the dynamics of stock markets Supervisor: Gianni Arioli Doctoral Dissertation of: Giovanni Paolinelli Tutor: Irene Sabadini The Chair of the Doctoral Program: Irene Sabadini 2018 – XXXI

Upload: others

Post on 22-Jul-2021

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

POLITECNICO DI MILANO

DOCTORAL PROGRAMME INMathematical Models and Methods in Engineering

DEPARTMENT OFMATHEMATICS

Quantum finance models for the simulation of the dynamicsof stock markets

Supervisor:Gianni Arioli

Doctoral Dissertation of:Giovanni Paolinelli

Tutor:Irene Sabadini

The Chair of the Doctoral Program:Irene Sabadini

2018 – XXXI

Page 2: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

Contents

1 Quantum finance framework 31.1 The general introduction . . . . . . . . . . . . . . . . . . . . . 31.2 Ilinski’s Theory . . . . . . . . . . . . . . . . . . . . . . . . . . 41.3 New models . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

1.3.1 Model 1: the modified Ilinski theory . . . . . . . . . . 51.3.2 Model 2: the new approach to quantum finance . . . . 6

2 A path integral based model for stocks and order dynamics 62.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.2 A simpler model . . . . . . . . . . . . . . . . . . . . . . . . . 72.3 The model with orders . . . . . . . . . . . . . . . . . . . . . . 92.4 The numerical integration . . . . . . . . . . . . . . . . . . . . 132.5 The generalized model . . . . . . . . . . . . . . . . . . . . . . 172.6 Tables and statistical analysis . . . . . . . . . . . . . . . . . . 212.7 Interpretation of the generalized model . . . . . . . . . . . . . 24

3 A model for stocks dynamics based on a non-Gaussian pathintegral 263.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263.2 The perturbed models . . . . . . . . . . . . . . . . . . . . . . 263.3 The non-Gaussian path integral . . . . . . . . . . . . . . . . . 283.4 The new model . . . . . . . . . . . . . . . . . . . . . . . . . . 29

3.4.1 Setting . . . . . . . . . . . . . . . . . . . . . . . . . . 293.4.2 Stochastic minimization . . . . . . . . . . . . . . . . . 303.4.3 The new action . . . . . . . . . . . . . . . . . . . . . . 303.4.4 The short time horizon . . . . . . . . . . . . . . . . . 323.4.5 The long time horizon . . . . . . . . . . . . . . . . . . 323.4.6 Intermediate-time horizon . . . . . . . . . . . . . . . . 323.4.7 The new stochastic dynamics . . . . . . . . . . . . . . 32

3.5 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343.5.1 Short-term dynamics . . . . . . . . . . . . . . . . . . . 353.5.2 1 minute . . . . . . . . . . . . . . . . . . . . . . . . . . 353.5.3 5 minutes . . . . . . . . . . . . . . . . . . . . . . . . . 353.5.4 30 minutes . . . . . . . . . . . . . . . . . . . . . . . . 36

3.6 The analysis of the short-term dynamics . . . . . . . . . . . . 363.7 Long-term dynamics . . . . . . . . . . . . . . . . . . . . . . . 37

3.7.1 One day dynamics . . . . . . . . . . . . . . . . . . . . 383.7.2 The week dynamics . . . . . . . . . . . . . . . . . . . 383.7.3 Final analysis . . . . . . . . . . . . . . . . . . . . . . . 39

3.8 Definition and approximation of the path integrals . . . . . . 393.9 Numerical Methods . . . . . . . . . . . . . . . . . . . . . . . . 423.10 The Chapman-Kolmogorov equation . . . . . . . . . . . . . . 45

1

Page 3: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

4 Conclusion 46

5 Appendix 485.1 Feynman’s path integral . . . . . . . . . . . . . . . . . . . . . 48

5.1.1 The classical mechanics . . . . . . . . . . . . . . . . . 485.1.2 The quantum case . . . . . . . . . . . . . . . . . . . . 495.1.3 Sums over paths . . . . . . . . . . . . . . . . . . . . . 505.1.4 The mathematical problem of the sum over paths . . . 51

5.2 Dynamics of money flows . . . . . . . . . . . . . . . . . . . . 515.2.1 Money flows: first principles . . . . . . . . . . . . . . . 515.2.2 Construction for a single investment horizon . . . . . . 52

5.3 The coherent state path integral . . . . . . . . . . . . . . . . 555.3.1 The coherent states . . . . . . . . . . . . . . . . . . . 555.3.2 Path integral and coherent states . . . . . . . . . . . . 56

2

Page 4: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

1 Quantum finance framework

1.1 The general introduction

The description of the stocks dynamics is a challenging task. The maindifference between the classical mechanics and the financial framework isthe impossibility to forecast exactly the value of a stock at time T , knowingthe initial price. This happens since the fluctuations of a stock price derivefrom unpredictable events such as the sell and buy orders form the traders inthe market. Despite the fact that it is not possible to forecast the evolutionof a particular stock, it is possible to build some models that replicate thebehaviour of the stocks and the financial markets.The aim of the thesis is to present a model where the evolution of a stockis randomly generated, according to a particular random process.

In this case, given the initial price S(0), it is possible to compute theprobability associated to final price S(T ), i.e., we are defining the probabil-ity density function (PDF) of S(T ) given S(0). Given the PDF of randomstock model, we compare it with the PDF associated to a real stock, to mea-sure the accuracy of the model. The goal is to create a model characterizedby a PDF which is as close as possible to the PDF of a stock, keeping thenumber of parameter as low as possible.Stochastic calculus has been a fundamental tool in finance since the publica-tion of the Ph.D. thesis of Louis Bachelier [18] in 1900. Much more recently,alternative approaches based on the techniques used in quantum mechanicsand quantum field theory have been proposed. In particular, the path in-tegral approach to quantum mechanics introduced by Feynman in [19, 20]has turned out to be particularly effective for financial applications, see also[4-12]. This theory is known as Quantum Finance.The Geometric Brownian Motion (GBM) is the best known model based onstochastic calculus used to reproduce the stocks dynamics. Unfortunatelythe PDF associated to the GBM is characterized by a mesokurtic shape,whereas the PDF obtained from the real financial data exhibits a leptokur-tic structure. This discrepancy is very important, large price variations areunderestimated by the GBM, causing significant errors in the computationof quantities depending on the stock price trajectories, such as the price ofderivatives. More precisely, in [17] it is shown that, if the fat tails are ig-nored, then the rate of return of an investment with no risk of financial lossand the term premium (the compensation that investors require for bearingthe risk that short-term Treasury yields do not evolve as they expected) aremiscomputed.The aim of this thesis is to present a model capable to achieve a betteragreement between the PDF of the model and the PDF derived from thefinancial data with respect to the classical models.

In the next sections we summarize the state of the art regarding Ilinski’s

3

Page 5: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

theory and our work; dividing between the results that are a generalizationof the Ilinski’s model from the complete new theory we propose.

1.2 Ilinski’s Theory

Our work is based on Ilinski’s article and book [1, 2]. We provide here ashort overview of Ilinski’s ideas in order to describe the starting point of ourwork.Ilinski establishes two analogies between finance and quantum mechanics:arbitrage, i.e., the possibility to make money without risk, is compared withthe Lagrangian action, and the invariance of the behaviour of the marketwith respect to the choice of the currency of reference is seen as a gaugeinvariance.

In classical mechanics, the evolution of a dynamical system can be de-scribed as the trajectory that minimizes the Lagrangian action. In quantummechanics one can describe the evolution of a system only in probabilisticterms, but the least action principle is not completely lost: loosely speaking,the transition probability between different states can be computed with theaid of a path integral by considering all trajectories, assigning a probabilitydepending on the action to each trajectory and averaging among all tra-jectories. Such probability is maximal for the least action trajectory, andPlank’s constant h determines how fast the probability decreases when othertrajectories are considered.

Classical finance is based on a condition which resembles the principleof least action: arbitrage, i.e., the possibility to make a positive amount ofmoney without risk, is minimized by the market, the minimum being zero.

Ilinski proposes a new approach where arbitrage behaves as the actionin quantum mechanics. The most probable trajectory for a stock price inthe financial market is the one corresponding to zero arbitrage, but trajecto-ries with some amount of arbitrage are possible, although their probabilitydecreases exponentially with respect to the arbitrage.

The second analogy proposed by Ilinski is gauge invariance. The be-haviour of the investors, and hence the trajectory of the prices in a market,does not depend on the choice of currency. Then, all quantities used inthe theory have to be invariant under the action of a Lie group R+, whichrepresents the change between currencies.

Ilinski describes the financial market as a principal fibre-bundle (PFB).PFBs are particular differential manifolds which can be locally described asthe product of a manifold with a Lie group G, which is the gauge group.Since we require the invariance with respect R+ it is clear that the PFBdescribed by Ilinski has G = R+. This concept is borrowed from physics aswell, and it is proposed as the best way to generate the gauge-invariant quan-tities, since principal fibre-bundles are specifically designed to describe en-vironments where gauge-invariance is required. The computational method

4

Page 6: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

proposed by Ilinski is a gauge-invariant path integral computed over thespace of all possible prices patterns.

This model corresponds to a Geometric Brownian Motion (GBM), whichgenerates a log-normal probability density function; this is not satisfactory,since stocks prices are known to display a leptokurtic distribution. Howeverthis is the starting point in order to introduce a more complicated model.

Ilinski introduces in [2] an improved model combining the minimizationof the arbitrage with a perturbation generated by the impact of the orders.

The starting point is that an investor’s portfolio is characterized by adiscrete nature with a certain fraction of the wealth invested in stocks andthe remaining part in cash. If the investor chooses to buy or to sell a certainamount or stocks, it will generate a variation in the price of the stock itself:the second model proposed by Ilinski aims to simulate this effect.In first instance, it is necessary to provide an action which determines thedynamics of the portfolio, secondly, a connection between the stocks andportfolio dynamics must be established. Once these requirements are satis-fied we can move to the simulation. The numerical computation is performedonce again with a quantum mechanics tool, known as coherent state path in-tegral. It is important to note that the discrete structure of the portfolioplays a fundamental role since the coherent state path integral is designedto treat a system characterized by a discrete nature.The main downside of the orders perturbation is the elevated number ofparameters that must be added in the model; for this reason Ilinski prefersto adopt some approximation techniques in order to estimate the transitionprobability with the orders perturbation.

1.3 New models

1.3.1 Model 1: the modified Ilinski theory

We start with the model without order for seek of simplicity. We describein detail the arbitrage strategy proposed by Ilinski and the derivation ofthe associated path integral. Once the the simpler model is clear, we moveto the second one which involves the orders perturbation. Assuming theknowledge of the Hamiltonian which controls the orders dynamics and thecoherent states path integral formalism, we derive transition probabilityformula as shown in [2]. The first novelty presented is the direct computa-tion of the path integral thanks to a Markov-Chain Monte Carlo method.The numerical results show that the basic perturbation proposed by Ilinskigenerates only an increase of the variance. This result is clearly not satis-factory, since we are interested in a model capable to generate a leptokurticbehaviour. Analysing the PDF derived from the real data we note a par-ticular relation between the asset price and its probability; this inspired usto define a second perturbation which becomes equal to the Ilinskis’s one

5

Page 7: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

for a particular choice of parameters. The new perturbation is capable toreproduce the PDF of S&P500 index and APPLE stocks prices with moreaccuracy with respect [2, 14, 15, 16]. At last, a financial interpretation ofthe new perturbation is offered.

1.3.2 Model 2: the new approach to quantum finance

We aim to create a model with high accuracy and a reduced amount of pa-rameters. The starting point is to note that many financial models -includingthe one presented in the chapter 2- are based on a Gaussian dynamics plusa perturbation. The perturbation is essential to achieve good results withthe real data; showing that the behaviour of the financial assets is quite farfrom being Gaussian. This fact suggests that the best way to achieve ourgoal is to propose a non-Gaussian model. Our dissertation starts observinghow the path integral encodes the Gaussian behaviour: showing the centralrole of the Lagrangian structure.We still adopt the quantum mechanics approach where the system evolvesfluctuating around the configuration of minimal action. In order to generatea non-Gaussian dynamics we consider a non-quadratic Lagrangian providinga financial interpretation for its structure. We also generalize the path in-tegral formalism using a distribution of the action which is not exponential.The new model is capable to achieve an excellent agreement between thesimulations and the real financial data over different time horizons, span-ning from 1 minute to 1 week.Some pathologies arise from the non-quadratic Lagrangian shape which im-ply the impossibility to use the standard discrete approximation, which isused in the Gaussian cases. In order to generate a finite dimensional approx-imation whose results do not depend on the particular dimension selected,we introduce a new discrete approximation; which coincides with the usualdiscretization when it is applied to the standard Gaussian case. This newapproximation is a new result by its own.In the end computational methods and some aspects related to the Kolmogorov-Chapman equation are discussed in the final sections.

2 A path integral based model for stocks and or-der dynamics

2.1 Introduction

In this chapter we generalize the model with the orders perturbation andwe introduce an algorithm to compute the coherent-state path-integral pro-

6

Page 8: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

posed by Ilinski.We show a direct relationship between the kurtosis of the PDF and the

strength of the perturbation caused by the orders; in fact, the model withoutorders provides results equivalent to the Geometric Brownian Motion. It isinteresting to observe that the fat tails phenomenon can be seen as an effectof the orders.

Our model entails five parameters; the same amount of the models in[14] and [2]. We analyse the impact of the parameters on the PDF andprovide a financial interpretation.

In the first part of the paper we recall Ilinski’s theory. Sections 2 and 3concern the theoretical background; numerical results are shown in Section 4.In Sections 5 and 6 we introduce the new model. The theoretical backgroundand some numerical simulations are presented in Section 5; in Section 6 weanalyse the impact of the new model on the probability density function. InSection 7 we provide a financial interpretation of the parameters involved inthe new model. Section 8 contains some final remarks.

2.2 A simpler model

We present in this section the basic concepts of Ilinski’s theory; the readerinterested in a detailed explanation should refer to [1] and [2].

Ilinski’s starting point is the basic idea that it is not possible to earnmoney without risk; if this were the case, then we would have an arbitrageopportunity. Consider an elementary market model where it is possible tobuy a non-risky asset B and a risky asset S with the same initial value. Ifwe assume temporarily that S is not a risky asset, then after a time T thefinal values of B and S must to be equal. Otherwise it would be possibleto perform an arbitrage operation; that is, we could borrow and sell theunder-performing asset, and then use the capital obtained to buy the over-performing one. When we sell the over-performing asset we have enoughmoney to buy back the under-performing asset and also have some moneyleft, the arbitrage revenue. This situation does not occur in the reality sincewe cannot know the value at a future time of S, i.e., we do not know inadvance whether S is the under- or the over-performing asset. This impliesthat a revenue from the previous situation can only be achieved with someamount of risk.

In [2] Ilinski shows a strategy involving stocks and cash which generatesa positive revenue independently of the final value of the risky asset S. Suchstrategy is called arbitrage. In classical finance such amount is assumed tobe zero. Ilinski proposes a weaker assumption, which entails a minimizationof the arbitrage.

Denote by Ag(S) the gain of the arbitrage described above; in Ilinski’smodel this quantity is treated as the action in a Lagrangian description ofthe dynamics of the system. We assume that the probability associated to

7

Page 9: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

Ag(S) is given byP (S) = Ne−βAg(S). (1)

This assumption represents the main link with the quantum mechanics andwith path integrals in particular. The core idea in the path integral repre-sentation of quantum mechanics consists in the fact that all trajectories areconsidered, but those achieving a lower action are more probable. In Ilinski’sfinancial model the least action (~→ 0 in quantum mechanics) correspondsto zero arbitrage. Trajectories with small arbitrage (quantum fluctuations)are considered, but their probability decreases when they get farther apartfrom the zero arbitrage trajectory. The role of Plank’s constant is played bythe variance of the financial asset.

We also assume that the stock dynamics is invariant under the change ofthe currency. This concept is well known in physics as gauge-invariance. Werequire our theory not to depend of the choice of the numeraire for any assetat any moment of the time. Agents do not start to behave in a different waybecause they are dealing with 100 pence instead of 1 £ or the equivalentamount of money in $. This invariance must be encoded in all quantitiesdescribed in this theory. We assume that the probability of a certain amountof arbitrage Ag(S) does not change if the assets are expressed in a differentcurrency.

In physics, the equations that describe the system in a gauge theory areinvariant under the transformation induced by the action of a group, eitherlocal or global. If we want to denote 10$ in £, i.e, perform a change of gauge,we have to multiply the capital by a positive number which is the conversionratio; the previous number is an element of the gauge group. This is true forall possible currency conversions, therefore the gauge group in this contextis the multiplicative R+.

Ilinski uses the previous framework to obtain the conditional probabilityfor the stock price. He considers a discrete time model, where time takesthe values ti = i∆ for some ∆ > 0, and then the price of an asset is denotedby Si = S(ti) = S(i∆), i = 0, . . . , N . Denote by S0 the price at time 0 andS the final price at time T = N∆; Ilinski proves that:

P (T, S|0, S0) =(N−1∏i=1

ˆ ∞0

dSiSi

)exp

(−1

2∆σ2

N−1∑i=0

Ri

), (2)

whereRi = S−1

i er2∆Si+1e−r1∆ + Sie

−r2∆S−1i+1e

r1∆ − 2

is the revenue at time ti of the double arbitrage and the constants r1 and r2represent the interest rates respectively of the cash and of the risky asset.The exponential is the probability described in (1), whereas σ is the varianceof the prices of the risky asset. Note that the values Ri are gauge invariant.

8

Page 10: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

The product of differentials is the path space differential used to sum allover the possible trajectories from S(0) to S(T ); details about this conceptcan be found in [20]. The measure is the gauge invariant expression dSi/Si.It is easy to show that the time continuous limit of (2) is equal to theGeometric Brownian Motion probability density function.

2.3 The model with orders

In [2] Ilinski also introduces a generalization of the previous model consistingin the addition of a perturbation which takes into account the effect ofthe orders in the stocks dynamics. In this paper we show that a modifiedperturbation generates a leptokurtic probability distribution of the returns.

Ilinski adds to the action a term which describes the dynamics of theorders, so that the price goes up (down) when somebody buys (sells) thestock. The action is given by

−βAg(S) = − 12σ2∆

N−1∑i=0

(log(Si+1)− log(Si)− µ∆− Ni

λ

)2; (3)

The derivation can be found in [2].The terms Ni represent the net amount of the orders at time ti, its value

is positive if the net amount is a buy order, negative otherwise, while λrepresents the share liquidity; the parameter −µ = r2−r1 is connected withthe equation (2) and represents the net risky interest-rate.

The initial allocation of the portfolio is described by the pair (n1,m1)which represents the amounts of cash and share at the initial time; the finalallocation is denoted by (n,m). Because of the gauge invariance, we canexpress the share and money values in the same unit, so that a unit of cashcan be traded for a share.

We assume the closed environment hypothesis, which implies a constantamount of lots at all times; denoting by M the total number of traded lots(both money and shares) we have n1 + m1 = n + m = M . In this contextthe initial configuration of the system is the capital allocation (n1,m1); ateach time step i, the system evolves to the capital allocation (ni,mi) up totime T , where it achieves the final allocation (n,m). In order to considerthe effect of the orders on the price dynamics, it is necessary to compute allthe possible paths in the capital allocation space and add the effect of eachpath.

This computation is achieved with the Coherent State Path Integral(CSPI), see [2, 20, 30]. The numbers (ni,mi) are integers, and in the contextof the CSPI they are described as

ni = ψ1,iψ1,i,

mi = ψ2,iψ2,i,

9

Page 11: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

where ψj,k are complex numbers, corresponding to the creation/annihilationoperators.

We denote an order Ni via the ψj,k operators. Buying k stocks we losek units of cash, and vice versa. We have:

Ni = δi[ψ2,iψ2,i − ψ1,iψ1,i].

Where the symbol δi stands for the forward different quotient, i.e.,

δih(i) = h(i+ 1)− h(i)∆ ,

with ∆ equal to the minimal time frame.The dynamics of the variables ψ, ψ is described by a Hamiltonian

H(t)(ψ, ψ) = H(i)jkψj,i+1ψk,i,

which links ψ(j,k),i to S(i∆) = Si. The following expression is derived in [2]:

H(i)jk =

0 γSβi e−βr1∆e−βµt

γS−βi e−βr2∆eβµt 0

, (4)

γ = (1− tc)/∆′.

Here tc is the relative cost of the transaction; ∆′ is the time step of themodel in the Hamiltonian dynamics and β denotes the amplitude of theprice variations.

In our simulations we assume µ = r1 = r2 = tc = 0 and ∆′ = ∆. Giventhe Hamiltonian, we compute the propagator:

〈ψ1,N , ..., ψZ,N | |U(T = N∆, 0)| |ψ1,0, ..., ψZ,0〉 =N−1∏j=1

Z∏k=1

ˆdψk,jdψk,j

2iπ × exp[−N−1∑j=1

Z∑k=1

ψk,jψk,j +N−1∑j=1

Z∑k=1

ψk,jψk,j+1

(5)

exp[∆

Z∑j,k=1

H(N − 1)jkψj,Nψk,N−1 + . . .+ ∆Z∑

j,k=1H(0)jkψj,1ψk,0

].

The quantity inside the first square bracket corresponds to

Z∑k=1

ψk,0ψk,0 +Z∑k=1

N−1∑j=0

(ψk,j+1 − ψk,j)ψk,j . (6)

Substituting (4) and (6) in (5) we obtain:

10

Page 12: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

〈ψN | U(T = N∆, 0) |ψ0〉 = eψ1,0ψ1,0+ψ2,0ψ2,0

ˆ ∏k=1,2

N−1∏i=1

dψk,jdψk,j2iπ ×

exp[N−1∑i=0

(ψ1,i+1ψ1,i − ψ1,iψ1,i + ψ2,i+1ψ2,i − ψ2,iψ2,i + Sβi ψ1,i+1ψ2,i + S−βi ψ2,i+1ψ1,i)].

(7)

We introduce the hydrodynamical variables

ψk =√Mρke

iφk ψk =√Mρke

−iφk , (8)

where ρ ∈ [0, 1] and φ ∈ [0, 2π]. Note that, because of the close environmentassumption, M(ρ1 + ρ2) = M and then ρ1 = 1− ρ2.

We write (7) in the hydrodynamical variables. Starting from

ψ1,i+1ψ1,i − ψ1,iψ1,i = [√ρ1,i+1ei(φ1,i+1−φ1,i) −√ρ1,i]

√ρ1,i , (9)

if we assumeei(φ1,i+1−φ1,i) ' 1 + i(φ1,i+1 − φ1,i)

then (9) becomes:

ψ1,i+1ψ1,i − ψ1,iψ1,i = [√ρ1,i+1 −√ρ1,i + i

√ρ1,i+1(φ1,i+1 − φ1,i)]

√ρ1,i;

recalling the definition of the forward difference quotient, we obtain:

ψ1,i+1ψ1,i − ψ1,iψ1,i = ∆√ρ1,i(δi√ρ1,i) + i∆√ρ1,i+1ρ1,i(δiφ1,i);

recalling that√ρ1,i(δi

√ρ1,i) = 1

2δiρ1,i,

we getψ1,i+1ψ1,i − ψ1,iψ1,i + ψ2,i+1ψ2,i − ψ2,iψ2,i =

= i

[(φ1,i+1 − φ1,i)

√ρi+1ρi + (φ2,i+1 − φ2,i)

√(1− ρi+1)(1− ρi)

], (10)

where the conservation law ρ1 + ρ2 = 1 has been used.We also have

Sβi ψ1,i+1ψ2,i + S−βi ψ2,i+1ψ1,i =

= Sβi

√ρi+1(1− ρi)ei(φ1,i+1−φ2,i) + S−βi

√(1− ρi+1)ρiei(φ2,i+1−φ1,i). (11)

Using the equation (10) and (11) in (7) we obtain the formula for the prop-agator:

〈ψN | U(T = N∆, 0) |ψ0〉 = eM∏k=1,2

N−1∏i=1

ˆ 1

0dρk,i

ρk,iπ

ˆ 2π

0dφk,i

11

Page 13: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

× exp[M

N−1∑i=0

(i(φ1,i+1 − φ1,i)

√ρ1,i+1ρ1,i + (φ2,i+1 − φ2,i)

√ρ2,i+1ρ2,i+

+Sβi√ρ1,i+1ρ2,ie

i(φ1,i+1−φ2,i) + S−βi√ρ2,i+1ρ1,ie

i(φ2,i+1−φ1,i))].

The previous propagator depends on all possible paths in the portfolio space;in order to obtain the conditional probability amplitude we need to link itwith the price dynamics using (3). We can write Ni as:

Ni = δi[ψ2,iψ2,i − ψ1,iψ1,i] = δi[ρ1 − ρ2] = 2δiρi , (12)

so that equation (3) becomes

−βAg(S) =N−1∑i=0

−12σ2∆

(log(Si+1)−log(Si)−2α[(ρi+1−ρi)]

)2with α = M/λ.

We consider now the propagator above together with the stock price action(3), and we obtain the new propagator which takes into account both thetrajectories in the spaces of portfolio allocation and the stock prices.

〈ψN | U(T = N∆, 0) |ψ0〉 =

eM∏k=1,2

N−1∏i=1

ˆ 1

0dρi

ρiπ

ˆ 2π

0dφk,i

ˆ ∞−∞

d log(Si)× exp[−βAg(S) + S].

with:

−βAg(S) =N−1∑i=0

−12σ2∆

(log(Si+1)− log(Si)− 2α[(ρi+1 − ρi)]

)2

S = MN−1∑i=0

(i

[(φ1,i+1−φ1,i)

√ρi+1ρi+(φ2,i+1−φ2,i)

√(1− ρi+1)(1− ρi)

]+

+Sβi√ρi+1(1− ρi)ei(φ1,i+1−φ2,i) + S−βi

√(1− ρi+1)ρiei(φ2,i+1−φ1,i)

).

We note that the coherent states at initial and final times are not integratedin the previous formula.

By the quantum mechanics formalism, the conditional probability isgiven by

P (S(T ), (n,m)|S(0), (n1,m1)) =

=ˆ ∏

i,k

12πidψi,kdψi,ke

−ψi,kψi,k 〈n,m| |ψ1,k〉 〈ψN | U(T = N∆, 0) |ψ0〉 〈ψ2,k| |n1,m1〉 ,

12

Page 14: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

where:〈n,m| = 〈0|ψn1,Nψm2,N

1n!m!

|n1,m1〉 = ψn11,0ψ

m12,0 |0〉

With some computations explained in [2]1, we obtain the formula

P (S(T ), (n,m)|S(0), (n1,m1)) = 1n!m!S(T )−β

(n−m)2 S(0)β

(n1−m1)2 (13)

׈dψdψ 〈ψN | U(T = N∆, 0) |ψ0〉 ψn1

1,0ψm12,0ψ

n1,Nψ

m2,Ne

−2M ,

where: ˆdψdψ =

∏k=1,2

∏i=0,N

ˆ 12πidψk,idψk,i .

The previous integral is expressed in the coherent state variables, whichmeans that in order to compute it, we need to transform the whole expressionin the hydrodynamical variables; note that, as in quantum mechanics, theresult of the integral is a complex number, while the probability is its modulesquared. We keep Ilinski’s notation to simplify the comparison with histheory.

The previous formula allows us to compute the probability density func-tion of the final price S(T ) with a final portfolio allocation (n,m), giventhe initial price S(0) and the portfolio allocation (n1,m1). Due to gauge-invariance, we can choose S(0) = 1. This is the choice we make in allsimulations.

2.4 The numerical integration

The numerical simulation requires the computation of the approximate valueof an integral in high dimension. We provide here a description of thestrategy for the numerical integration. We first note that the integral (13)involves four variables for each time step:

ρi, φ1,i, φ2,i and Si.

The firsts three variables describe the orders dynamics; we denote the spaceof these variables the hydrodynamical space. The last variable is the stockprice.

The crude Monte Carlo (CMC) is the computational method usuallyadopted in this situations. Regrettably CMC lacks of speed, for this reasonwe combine it with the Metropolis-Hastings Markov-Chain Monte Carlo(MH −MCMC). Details about the Metropolis-Hastings algorithm can be

1pg.s. 136, 166 and 277-281

13

Page 15: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

found in [31].To adopt the previous technique we need to interpret the integral as follows:

P (S(T ), (n,m)|S(0), (n1,m1)) =ˆdΩf(Ω)p(Ω).

In the previous formula p(Ω) represents the probability potential used tosample the variables with the MH −MCMC algorithm, while f(Ω) standsfor the set of all functions integrated with respect to p(Ω).The hydrodynamical-variables ρk,i, φk,i are uniformly distributed inside [0, 1]×[0, 2π] × [0, 2π]: we decide to use the usual CMC technique in order tomaintain the algorithm as simple as possible. Conversely, the variablesyi = ln(Si) are distributed in R: in this case, we adopt the MH −MCMCalgorithm in order to improve the speed of the computation. The potentialp(Ω) is:

p(Ω) = exp[−βAg(S)].

The computational procedure is here described:

• We select ρk,i, φk,i from the hydrodynamical-space [0, 1] × [0, 2π] ×[0, 2π].

• We generate the potential p(Ω) associated to the specific hydrodynamical-configuration previously sampled.

• We sample the variables ln(Si) from p(Ω).

• We perform the sum and repeat.

The MH −MCMC algorithm requires special attention when it is used toestimate integrals. The algorithm considers the potential p(Ω) as normal-ized, even if this is not true; formally we can write:

ˆMH−algo.

dΩf(Ω)p(Ω) =´dΩf(Ω)p(Ω)´dΩp(Ω) .

The potential p(Ω) depends on the final price and from the hydrodynamical-variables. This means that the normalization constant must be estimatedfor each final price and hydrodynamical-configuration.This fact does not limit the efficiency of the procedure since the computationis done via a closed-type formula. At last, we provide some remarks overthe function f(Ω) showing a convenient change of variables.The function f(Ω) represents the set of all functions that are integrated withrespect to p(Ω). We focus our attention on a particular function containedin f(Ω): the exponential of the action

exp[M

N−1∑i=0

(i

[(φ1,i+1−φ1,i)

√ρi+1ρi+(φ2,i+1−φ2,i)

√(1− ρi+1)(1− ρi)

]+

14

Page 16: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

+Sβi√ρi+1(1− ρi)ei(φ1,i+1−φ2,i) + S−βi

√(1− ρi+1)ρiei(φ2,i+1−φ1,i)

)].

This complex quantity is almost written in polar coordinates, we have onlyto isolate the ρ. By computation we obtain:

ρ = exp[M

N−1∑i=0

(eln(Si)β

√ρi+1(1− ρi)cos(φ1,i+1 − φ2,i)+

e−ln(Si)β√

(1− ρi+1)ρicos(φ2,i+1 − φ1,i))].

Considering that M represents the total number of traded stocks, it is crucialthat the argument of the exponential is positive since negative amountscontribute only marginally to the total sum value.The differences φ1,i+1 − φ2,i and φ2,i+1 − φ1,i ∈ [−2π, 2π] are distributedaccording to a triangular shaped function. Obviously, the intervals of ourinterest are [0, π2 ] ∪ [3π

2 , 2π].Thanks to the periodicity of the trigonometric function, we can sample theprevious differences in the interval [0, π2 ] with a uniform distribution.At this point it is convenient to perform the following change of variables

• φ1,i+1 + φ1,i = x1,i,

• φ2,i+1 − φ2,i = x2,i,

• φ1,i+1 − φ2,i = x3,i,

• φ2,i+1 − φ1,i = x4,i.

These new variables will substitute the angular part of the hydrodynamical-space. The previous modifications contribute to increase the efficiency andthe speed of the algorithm.The following assumption have been introduced:

• µ = r1 = r2 = 0 ,

• tc=0,

• β=2.5,

• T = N∆ = 10,

• M=2n1=2m1=2n=2m=100.

The first assumption is not restrictive, and makes the results more transpar-ent. The second one consists in neglecting transaction costs, but we pointout that these could be easily introduced in the model. We choose β = 2.5

15

Page 17: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

as in [2], observing that a different value of β does not change the qualita-tive behaviour of the model. Indeed, the Hamiltonian is invariant under thetransformation

Si → Sβ−1

i , σ → σβ−1/2

and such invariance can be used to eliminate β. The parameter T is dummy;more precisely, our choice of T corresponds to adopting the tenth part of aminute as time unit. A different choice would not affect the result, assumingthat all other parameters are duly rescaled. The final assumption is chosenas a compromise between the computational complexity and the accuracy;simulations performed with higher values of M show similar results. Thedynamics of the model is a perturbed Geometric Brownian Motion, theperturbation being proportional to the parameter α. The parameters ofthe Brownian Motion are the same of the simulation discussed above. Theresults of simulations are shown in logarithmic scale in Figures 1 and 2.

Figure 1: Normal distribution (red) and PDF of the perturbed model withα = 0.461 (green). We present only one simulation in order to show theeffect of the perturbation.

It turns out that this perturbation only causes an increase of the varianceσ. This can be observed in Figure 3, where the PDF of the model withoutorders, with α = 0.266 and σ = 0.00648 (red continuous line), and a normaldistribution with variance 1.156σ (blue line with squares) are shown.

The numerical computation of the mean, variance and kurtosis of thesimulated probability density function shows that the previous values areequal to those corresponding to the Geometric Brownian Motion with σ =0.0074908 = 0.00648 ∗ 1.156, within of 0.001%.

This poor match with financial data is also confirmed by Ilinski in [2],where he writes that “this strategy is far from optimal”.

16

Page 18: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

Figure 2: In this case all three simulations, α = 0.266 (yellow), α = 0.333(blue) and α = 0.461 (green) are shown together to highlight the relationshipbetween the perturbation intensity and α.

2.5 The generalized model

Ilinski suggests a second kind of perturbation

v = −2α[(ρi+1 − ρi)]k − α2(ρi+1 − ρi)∆ log(Si)n1/M − 1/2 ,

and he computes the probability distribution of S(T ) with the saddle pointmethod and other approximations in the case k = 1. The probability distri-bution displayed in [2, p. 148, Fig. 6.15] is very accurate in the central part,but it behaves badly in the deep tails. If we analyse the probability densityfunction derived by Ilinski’s model, we note that its wings exhibit a linearrelationship between log(P (S(T ))) and log(S(T )).

This behaviour is not in good agreement with the stocks dynamics. Theoverlap between the computed and observed probability density functionsis not very accurate in the wings region. In particular we can see thatthe relation between log(P (S(T ))) and log(S(T )) showed in the PDF is ofpolynomial type; i.e,

log(P (S(T ))) = α log(S(T ))Γ

We propose a different perturbation: Ilinski’s action

−βAg(S) =N−1∑i=0

−12σ2∆

(log(Si+1)− log(Si)− 2α[(ρi+1 − ρi)]

)2,

17

Page 19: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

Figure 3: The red line is the normal distribution, whereas the blue linewith the squares is the result of the simulation of the previous model withα = 0.266 .

depends linearly on the differences (ρi+1 − ρi). We introduce the action

−βAg(S) =N−1∑i=0

−12σ2∆

(log(Si+1)−log(Si)−

J∑k=1

2αk(ρi+1−ρi)|ρi+1−ρi|Γk−1)2,

where J ≥ 1 and Γk ≥ 1 are integers.We keep J small to avoid to overfit the data; it turns out that this

perturbation with J = 2 provides results in good agreement with all thereal data that we analysed. Still, at first we present a result with J = 1 andΓ = 3 i.e.

J∑k=1

2αk(ρi+1 − ρi)|ρi+1 − ρi|Γk−1 = 2α(δρ)3.

The result of the numerical simulation is displayed in Figure 4, which showsthe leptokurtic behaviour

Figure 4: The red line is the normal distribution, whereas the blue line isthe generalized model with α = 0.461.

We present some comparisons between real data and our model. Thesource of the real data consists in 3 months price-sheets of the S&P500

18

Page 20: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

index and APPLE stocks from 01/05/2017 to 26/07/2017. The samplingfrequency is τ = 60s; each dataset consists of about 25000 prices. In orderto obtain the probability density function associated to the index and thestock, we follow the method introduced in reference [18], i.e. we consider aset of historical data as instances of a stochastic variable. We first computeXi by

Xi = log(P (ti)/P (ti−1)) ti − ti−1 = τ,

then we build a histogram of the values Xi with N bins. The histogramsshown in Figure 5, 6, 7 and 8 display the number of counts ∆C in each his-togram bin, divided by the bin width ∆S/N . The result is then normalizedin order to approximate a probability density function.

The error bars for the real data are estimated as σbins∆S/N ; where ∆S isthe width of the histogram x-bars. In order to compare the simulations withthe results obtained in [2, 3, 14], we plot the probability density functionsin logarithmic scale.

We plot the results of some simulations performed with the intent toreproduce real data. Here we did not plot the simulation errors in order tokeep the pictures as clear as possible; such errors have been estimated andthey are within 1%.

The picture shows in blue the empirical distributions of S&P500 index;the black curves represent the results of the simulations with the generalizedmodel.

The red curves represent the normal distribution with the same σ andT .

Figure 5: S&P500: σ = 0.0000280, T = 10, α = 0.00092, N = 60 and∆ log(S) = 0.002.

The agreement is quite good in a very wide region near the central price 2;yet in the tails, the model underestimates the value of the probability densityfunction. This behaviour concerns the simulations of both the indices andthe Apple stock.

2log(S(0)) = 0.

19

Page 21: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

Figure 6: APPLσ = 0.0000628, T = 10, α = 0.0024, N = 80 and ∆ log(S) = 0.005.

This can be explained by the absence of large jumps in the simulation,i.e., our model produces a smaller amount of big price variations than the realmarket. The agreement between simulations and real data can be improvedwith an extra term. Heuristically, we observe that the addition of a higherdegree term creates a more intense perturbation when |δρ| ' 1. For theAPPLE share and S&P500 index two different kinds of perturbations areused:

J∑k=1

2αk(ρi+1 − ρi)|ρi+1 − ρi|Γk−1 = 2α1(δρ)3 + 2α2(δρ)9 APPL,

J∑k=1

2αk(ρi+1 − ρi)|ρi+1 − ρi|Γk−1 = 2α1(δρ)3 + 2α2(δρ)13 S&P500.

The numerical simulations associated with the previous perturbations givethe following results:

Figure 7: APPLσ = 0.0000628, T = 10, α1 = 0.0024, α2 = 0.0015, N = 80 and ∆ log(S) = 0.005.

The measure that we used to quantify the agreement between real dataand the simulations is the overlap amplitude between the numerical and real

20

Page 22: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

Figure 8: S&P500σ = 0.000028, T = 10 , α1 = 0.00092 and α2 = 0.0011, N = 60 and

∆ log(S) = 0.0024.

data probability density functions in the y-axes. For example if the overlapspans from the point 1.0 up to the point 2.5 on the y-axis, we claim that theagreement is of one and half order of magnitude. We choose this particularmeasure because it has been used in the references we use as benchmarks.

One of the first attempts to reproduce the probability density functionof a real asset with a stochastic process is [3]. The authors prove thatit is possible to obtain an agreement of almost three orders of magnitudewith a Levy flight for the S&P index with τ= 1 min. Better results havebeen achieved in [14] by Dupoyet and Fiebig using a quantum lattice modelwhich reproduces the probability density function of NSDAQ index with anagreement about four orders of magnitude with the same τ . Albeit [14] is aconsiderable improvement over [3], it suffers of the same problem of Ilinski’s,that is, it underestimates the probabilities of large market corrections.

Our model fits the APPLE stock and S&P index probability densityfunctions with an agreement of almost four order of magnitude, and in par-ticular, when compared with the other models mentioned above, it providesa good fit or the distributions in the deep tails region.

2.6 Tables and statistical analysis

In Table 1 we provide a quantitative relationship between the moments ofthe PDF computed with our generalized model and the parameters. Thefirst line lists the moments obtained with a GBM with the same σ and Tof the generalized model. The most significative difference between the twomodels can be observed in the line where α1 is very small when comparedwith α2. The values in the table are the mean and the standard deviationof each moment.

It is also important to observe that the parameters αk are proportionalto σ. In the first generalized model simulation α/σ ' 10−1/10−3 = 102,which is equal to the real data cases α/σ ' 10−3/10−5 = 102. This is clear

21

Page 23: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

α1,2 Variance Kurtosis 6th-Moment 8th-MomentGBM 3.93 e-8 3.00 9.19 e-22 2.53 e-28α1 = 2.6 e-3α2 = 1.1 e-3

2.0720 e-7± 1.34 e-9

6.4628± 0.017

7.6536 e-19± 3.13 e-21

2.9050 e-24± 1.65 e-26

α1 = 1.3 e-3α2 = 1.1 e-3

9.0440 e-08± 2.33 e-10

6.2574± 0.038

8.8153 e-20± 6.13 e-22

2.5805 e-25± 5.33 e-27

α1 = 6.5 e-4α2 = 1.1 e-3

5.5517 e-08± 5.89 e-10

5.0646± 0.065

1.4685 e-20± 7.80 e-24

3.1448 e-26± 2.88 e-28

α1 = 3.25 e-4α2 = 1.1 e-3

4.5458 e-08± 7.40 e-10

4.3413± 0.015

5.3952 e-21± 5.73 e-23

8.6426 e-27± 8.38 e-29

α1 = 1.65 e-4α2 = 1.1 e-3

4.2556 e-08± 4.41 e-10

3.7724± 0.073

3.4505 e-21± 3.44 e-23

4.1386 e-27± 4.03 e-29

α1 = 2.6 e-3α2 = 0

1.9595 e-07± 7.17 e-10

5.8585± 0.018

5.5543 e-19± 1.79 e-21

1.9428 e-24± 5.05 e-27

α1 = 1.3 e-3α2 = 0

8.5264 e-08± 1.13 e-10

4.2395± 0.010

2.3935 e-20± 1.53 e-22

3.0881 e-26± 2.48 e-28

α1 = 6.5 e-4α2 = 0

5.0286 e-08± 4.02 e-10

3.2557± 0.0047

2.4980 e-21± 1.70 e-23

1.1181 e-27± 3.30 e-29

α1 = 3.25 e-4α2 = 0

4.4560 e-08± 2.40 e-10

3.1126± 0.0096

1.4168 e-21± 1.69 e-23

4.4932 e-28± 6.54 e-30

α1 = 1.65 e-4α2 = 0

3.9401 e-08± 1.32 e-10

3.0249± 0.012

9.2073 e-22± 3.33 e-25

2.6648 e-28± 5.50 e-30

Table 1: Statistical analysis of the model

22

Page 24: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

Figure 9: PDF of the simulations with α1 = 1.1e-3

Figure 10: PDF of the simulations with α1 = 0

if we recall the expression of the action

Ag(S) '(δ log(S)− 2α1(δρ)Γ1 − 2α2(δρ)Γ2

)2.

In the Metropolis-Hastings algorithm, in order to obtain a mixing ratio of25%, the S fluctuations are proportional to σ, while δρ is always distributedin [−1, 1], i.e.,

δ log(S) ' σ,

−2α1(δρ)Γ1 − 2α2(δρ)Γ2 ' ±2α1 ± 2α2.

In order to perturb effectively the price variation we need

σ ' ±2α1 ± 2α2 ,

therefore a change in the order of magnitude of σ must correspond to asimilar change in the parameters α1 and α2.

23

Page 25: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

2.7 Interpretation of the generalized model

The terms αk(δρ)Γk introduced above allow us to obtain a good agreementbetween the simulated and the real PDF. In this section we provide a finan-cial interpretation of such quantities. Given the perturbation

α(δρ)Γ ,

we observe that

• Γ affects the jumps size,

• α affects the probability of the jumps.

We consider Γ first. Figure 11 shows the result of a single perturbed modelα(δρ)Γ with different values of Γ and fixed α.

Figure 11: α(δρ)Γ

Γ=5 -blue-, 7 -green-, 9 -yellow-, 11 -purple- and 13 -black-.The red curve represents the normal distribution with the same σT .

The Geometric Brownian Motion yields a mesokurtic probability densityfunction and all the trajectories simulated with this model have a contin-uous path. However, it is possible to obtain big fluctuations between theinitial price S(0) and the final price S(T ) by setting a large variance σ.Increasing σ does not affect the trajectory continuity, since the model re-mains a GBM. The price fluctuations are directly linked with the varianceσ; but the continuity is not affected by the value of this parameter. Thesefacts suggest an interpretation of σ as the frequency of the orders with smallspread ∆S = |S(i) − S(i + 1)|. A larger value of σ corresponds to a largernumber of orders per unit time, yielding a larger price fluctuation. Since weare considering small ∆S variations, continuity is preserved.

This model is too simple for a real market description; in particular somemassive price corrections may happen in a unit time frame. This events arecalled jumps.

24

Page 26: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

In the real financial context, massive price corrections appear when thereis an external change in the macroeconomic scenario; when this happens,the original price may be greatly underestimated or overestimated. In theprevious situation the orders given immediately after the macroeconomicchange will have a large spread ∆S.

Within this framework, large price corrections are more likely; whichimplies that the tails of the PDF are fatter. Given a model which allowsonly x∆S jumps with ∆S = |S(T )−S(0)|, the probability of a price changey∆S where y << x, it is equal to the case without jumps. Instead, if y ≥ xthe probability will be much higher with respect the jumps-less case.

Denoting as S the price where the wings start to exhibit their presence,we can observe that it is proportional to Γ. In fact we note that the overlapbetween the normal distribution and the black line, with Γ = 13, is longerwith respect to the overlap of the blue line, with Γ = 5; moreover all theprice variations y∆S ≥ |S − S(0)| are more likely to happen with respectto the Geometric Brownian Motion model. This is in agreement with ourinterpretation on Γ.

We also recall that the perturbation with Γ = 1 is equal to a GeometricBrownian Motion with increased σ; suggesting again that Γk is related withjumps size present in the model.

To consider the effect of α, we show the results of a simulation with theperturbation α(δρ)9 and different values of α in Figure 12.

Figure 12: α(δρ)9

α = 0.00181 -green-, 0.00158 -yellow-, 0.00140 -blue-, 0.00126 -purple- and 0.00114-black-.

The previous simulation, along with the previous tables, shows that thekurtosis and higher even moments of the distribution are directly linkedwith the value of α.

The mass under the tails quantifies the presence of massive price vari-ations, occurring in presence of jumps; which means that the probability

25

Page 27: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

associated to these variations is directly related to the probability of thejumps. This shows the relation between jumps and the shape of the tails.

3 A model for stocks dynamics based on a non-Gaussian path integral

3.1 Introduction

The results showed in the second chapter, clearly prove that the perturbationplays a fundamental role in the good agreement between the model and thereal market, since it is responsible of the change of the distribution of pricesfrom mesokurtic to leptokurtic. A similar approach has been developedin [14, 15, 16], where a model based on quantum field theory has beendeveloped.

All these results imply that the minimization of the arbitrage does notsuffice to describe the short term dynamics of the financial market.

The perturbation of the GBM is used also in classical finance, withstochastic volatility models; this approach has the main drawback of a highnumber of parameters. In this paper we propose to maintain the basic ideasintroduced by Ilinski, but we choose a different action.

3.2 The perturbed models

The Heston model is a generalization of the GBM, where the variance isalso described by a stochastic process. It consists of the following system ofstochastic differential equations:

dSt = µStdt+ σtStdW(1)t ,

vt = σ2t , (14)

dvt = −γ(vt − θ)dt+ k√vtdW

(2)t ,

where µ, γ, θ, k are constants. W (2)t and W (1)

t are standard Wiener processescorrelated by

dW(2)t = ρdW

(1)t +

√1− ρ2dZt with ρ ∈ [−1, 1],

and Zt is a Wiener process independent of dW (1)t .

The stochastic behaviour of σ is determined by the parameter k; if k isequal to zero the variance is a deterministic quantity, and the process is aGBM with time dependent variance. In [28] also, where this model is usedto describe the dynamics of the Dow-Jones index, the importance of theperturbation is stressed.

26

Page 28: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

The approach proposed by Ilinski in [2], combining the minimization ofthe arbitrage with the orders, has similarities with the Heston model. Itassumes a closed environment, where the total capital M is constant. Theinitial allocation of the portfolio is described by the pair (n1,m1), wheren1 stands for the portion of wealth invested in cash and m1 is the portioninvested in shares, while (n,m) represents the portfolio allocation at thefinal time. Clearly n1 + m1 = n + m = M . The model simulates all thepossible trading patterns that link the initial state with the final. Eachtrading pattern is composed of a series of buy and sell orders that perturbthe main Gaussian dynamics.

The improved model proposed in the above chapter evaluates the tran-sition probability amplitude P (S(T ), (n,m)|S(0), (n1,m1)) from the initialstate (S(0), (n1,m1)) to the final one (S(T ), (n,m)) with the following pathintegral

P (S(T ), (n,m)|S(0), (n1,m1)) = 1n!m!S(T )−β

(n−m)2 S(0)β

(n1−m1)2 (15)

׈dψdψI(ψ, ψ, S(0), S(T ))ψn1

1,0ψm12,0ψ

n1,Nψ

m2,Ne

−∑

j=1,2 ψj,0ψj,0+ψj,N ψj,N ,

where ˆdψdψ =

∏k=1,2

∏i=0,N

ˆ 12πidψk,idψk,i ,

I(ψ, ψ, S(0), S(T )) =ˆD log(S)Dψ1Dψ1Dψ2Dψ2e

s1 ,

and

s1 = − 12σ2

ˆ T

0

[d

dt

(log(S)−tr−

N∑j=1

αj(||ψ2||2−||ψ1||2)∣∣∣∣||ψ2||2−||ψ1||2

∣∣∣∣Γj−1)]2dt

(16)

+ˆ T

0

(dψ1dt

ψ1 + dψ2dt

ψ2 + ∆−1Sβψ1ψ2 + ∆−1S−βψ2ψ1

)dt .

The model proposed by Ilinski in [2] is a special case of the model presentedpreviously, with N = 1 and Γ1 = 1. More precisely, the formulas aboverepresent the continuous time version of the model described in the chapterno. 2.We recall that the result of the previous integral is a complex number andthe probability is its square module. We maintain the same notation of [2],in order to simplify the comparison.

The first integral in the definition of the action s1 in (16) determinesthe stock price dynamics, while the second integral determines the portfoliodynamics. The connection between the two dynamics is controlled by the

27

Page 29: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

parameters αj . As in the Heston model, if αj = 0 for all j, then the previousintegral becomes

P (S(T )|S(0))GBM ∝ˆD log(S)e−

12σ2´ T0 (∂t log(St)−r)2dt, (17)

which is the GBM formulation proposed by Ilinski in [1]. We observe thatthe previous model shares the same ideas of (14), since it represents a per-turbation of the GBM. Heuristically, the parameters αj correspond to theparameter k in the Heston model.

Similar results has been achieved by Dupoyet et. al. in [14, 15, 16], wherethe GBM model is perturbed using an extra term derived by a quantumlattice model.

The common background of all the previous models is a Gaussian dy-namics perturbed with an extra term. This approach requires the choiceof many parameters and the computation of many variables to control thestrength of the perturbation. The parameters can be split in three classes:

• Parameters of the main (Gaussian) dynamics.

• Parameters determining the dynamics of the perturbation.

• Parameters determining the coupling between the main dynamics andthe perturbation.

As we pointed out, the perturbation is essential, since the Gaussian dynamicsalone does not fit the market behaviour. The main idea that we present inthis paper is a model where the main dynamics is not Gaussian, so that aperturbation is not required, and only parameters for the main dynamicsare introduced. Our goal is a model with a precision similar to the modelin [9, 14, 28], but simpler and with a lower number of parameters.

3.3 The non-Gaussian path integral

We begin by observing how the path integral encodes the Gaussian be-haviour. Consider the stochastic differential equation

x(t) = η(t) (18)

wherex(t) = log(St).

The noise η does not need to be Gaussian; let D(η) be the probabilitydistribution of η and define L(η) by

D(η) = e−L(η). (19)

28

Page 30: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

To underline the analogy with quantum mechanics, we call the function L(η)the Lagrangian. In [27, see 20.1.13] it is shown that the path integral

P (xb, tb|xa, ta) =ˆDη

ˆDx exp[−

ˆ tb

ta

L(η(t))dt]δ(x− η)

=ˆDx exp[−

ˆ tb

ta

L(x)dt] (20)

returns the probability distribution of xb = x(tb) when x(ta) = xa. Com-paring (17) with (20), we see that the Lagrangian associated to the GBMdescribed by Ilinski is

LGBM = 12σ2 (∂t log(St)− r)2 (21)

and thenD(∂t log(St)) ' N(rGBM , σ2) (22)

withrGBM = r − σ2T/2 .

The previous analysis, together with formula (21), explains why the log-returns in (17) are normally distributed and why the Gaussian nature ofthe perturbation is encoded in the structure of the Lagrangian. The latterobservation is the starting point of our model.

Remark. Formula (17) represents a transition probability of the priceS(t) expressed as an integral in D logSt, while (20) represents the transitionprobability of x = log(S) expressed as an integral in Dx. This difference isdue to the fact that (20) is not written in an explicit gauge-invariant form,since the measure D log(S) = DS/S is gauge-invariant (D log(S) = DS/S),while the measure DS is not.

3.4 The new model

3.4.1 Setting

In order to present the basic hypotheses underlying the new model, we beginwith the definition of the path-space in the financial context. Given a timeinterval [0, T ], where T ∈ R+ represents our choice of time horizon, we define

XS0,ST = S ∈ BV ([0, T ],R+) : S(0) = S0, S(T ) = ST (23)

as the set of all the paths connecting two prices S0, ST ∈ R+. The set of alladmissible paths is

XT =⋃

S0,ST∈R+

XS0,ST .

We consider the BV functions in order to take in account both continuousand non-continuous stock-price paths.

The basic hypotheses for our model are:

29

Page 31: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

• (HP1) There exists a functional A : XT → R, invariant with respectto the action of the gauge group R+, and related to the amount ofmoney that is possible to earn with some trading strategy during thetime horizon [0, T ].

• (HP2) The market evolves fluctuating around the configuration ofminimal value of A.

• (HP3) The financial market is not fully efficient, small amounts ofarbitrage are allowed.

3.4.2 Stochastic minimization

In order to state rigorously what we mean by “fluctuation around the con-figuration of minimal action”, we introduce the concept of stochastic mini-mization. Assume that A : XT → R+ is an action which satisfies HP1, letP : R+ → R+ be a decreasing function, and let

p : XT → R+ , p(S) = P (A(S)). (24)

Since P is decreasing, the classical path S which minimizes the action,corresponds to the path that maximizes p. By stochastic minimization weare assuming that all paths are possible, with probability assigned by p.All quantities related to the path of prices (probability of the final priceor related quantities, such as the value of a derivative product) has to becomputed on each path, and the result is the weighted average with respectto p on all paths. There are two main differences with respect to the compu-tation of a propagator in quantum mechanics: first, in quantum mechanicsthe action is multiplied by the imaginary unit and the transition probabilityis the modulus square of the path integral; second, for the financial pathintegral we only require that P is a decreasing function, not necessarily anexponential. The analogy with quantum mechanics also concerns the meth-ods adopted to compute the transition probability, as we show in Section3.9. It is straightforward to observe that the system described by Ilinskiconsists in the stochastic minimization of the arbitrage, with respect to anexponential function P .

3.4.3 The new action

We denote by Aarb the amount of money that is possible to earn with arbi-trage in the time horizon [0, T ]. Ilinski shows in [1] that

Aarb(St, T ) = β2

ˆ T

0(∂t log(St)− rt)2dt = β2

ˆ T

0Ω(t)2dt, (25)

where r is the net non-risky interest rate and β2 is a constant with thedimension of time. The function Ω(t) is the curvature of the principal fibre-bundle considered by Ilinski, therefore Aarb is gauge invariant, see [2, Chap.

30

Page 32: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

5]. Note that the curvature has the dimension of time inverse, therefore β2needs to have the dimension of time; similarly, in quantum mechanics casethe action is divided by h. Note that β2 weighs the paths variation withrespect to S, that is it corresponds to the inverse of the variance squared.

Since the curvature is gauge invariant, it is a natural component of agauge-invariant functional. A different gauge invariant functional is theL1

[0,T ]-norm of Ω(t)

Ame(St, T ) = β1

ˆ T

0|∂t log(St)− rt|dt = β1

ˆ T

0|Ω(t)|dt. (26)

In this case β1 provides a scale for the variation of the paths with respect toS. Adopting the same point of view of Ilinski, we consider Ame(St, T ) as themaximal amount of money that is possible to earn in the time horizon [0, T ].The strategy to obtain that gain consists in borrowing cash and buying thestock when the stock outperform the cash, and vice versa. This strategyinvolves some risk, since it is not possible to know in advance what is theright case. It is straightforward to check that the functionals (25) and (26)satisfy the hypotheses HP1. Note that

minAme(St, T ) = minAarb(St, T ) = 0, ⇐⇒ ∂t log(St) = rt

and, if T2 > T1 and S1(t) = S2(t) for all t ∈ [0, T1] , then

Ame(S1(t), T1) < Ame(S2(t), T2) and Aarb(S1(t), T1) < Aarb(S2(t), T2).

It is also important to note that, if β1 = β2 and assuming that St does notminimize the actions, then

Ame(St, T ) > Aarb(St, T ) . (27)

The previous inequality implies that, if we use the same scale to measurethe revenues from Ame and Aarb, then the first strategy is more rewardingthan the second one.

This last fact may seem counter-intuitive. We recall that (27) is com-puted over the continuous-time version of the process St. In the real case thestock price does not vary continuously, since a price variation happens onlywhen there is a new order with a different price. The time scale associatedto the price variation between two successive orders is called the ”tick-by-tick” variation of the price, and it is the time frame that must be selectedto compute the previous quantities. Log-price variations in this context arealways very small, implying (27). The analysis of the probability densityfunctions of the one minute dynamics confirms this statement.

We now show that Ame is a reasonable choice for the action functionalin the case of a short time horizon, whereas Aarb is more suitable in the caseof a long time horizon.

31

Page 33: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

3.4.4 The short time horizon

Assuming a closed market, we note that the amount of money that a tradergains corresponds to the loss of all the other traders. The fairest situationis the one without losses, which implies no gain as well.

This happens when the value of the functional Ame is equal to 0. Marketconfigurations with Ame > 0 are associated with losses among other playersand therefore they should be considered less probable.

In the short term dynamics, the minimization of the arbitrage is in con-trast with HP3. The functional (25) is proportional to T and it is smallerthan Ame, i.e., it is negligible.

3.4.5 The long time horizon

Since the amount of arbitrage is directly proportional to the time horizonT , we can assume that in this case it is non negligible. Clearly, inequality(27) still holds, but in this case we have to consider that arbitrage does notinvolve risk. It is reasonable to assume that investors prefer the arbitragestrategy albeit it is less profitable, since the gain is sure. In this situation,it is essential to minimize the arbitrage in order to prevent the possibilityto extract considerable amount of money without risk from the market inorder to respect HP3.

3.4.6 Intermediate-time horizon

To consider an intermediate-time horizon, we assume that it is possible tomodify continuously the action functional from Aarb to Ame. Given thestructure of the previous functionals, the most natural choice seems to be

Ap(St, T ) = βp

ˆ T

0|∂t log(St)− rt|pdt , p ∈ [1, 2] . (28)

This action may be interpreted as a hybrid strategy which involves botharbitrage and risk trading.

The previous formula is unconventional in the theory of path integrals,where the action is usually quadratic plus some perturbation. The previousdefinitions have to be intended in a formal sense; their interpretation andnumerical evaluation is discussed in section 3.8.

3.4.7 The new stochastic dynamics

We now apply the concept of stochastic minimization to the action function-als previously defined, giving also the explicit formulation of the probabilitiesadopted.

The arbitrage strategy proposed by Ilinski can, in principle, be followedby every trader in the market. This means that it would be very simple

32

Page 34: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

to make a profit with an arbitrage transaction, i.e., to extract consistentamount of money from the market without risk. In order to forbid thiseventuality, it is necessary that big arbitrage opportunities are very unlikely.This justifies the choice adopted by Ilinski which uses the exponential func-tion.

The short time horizon case is different. The most probable configura-tion of the market does not admit capital losses, but different traders havedifferent trading experience. We can assume that the more experiencedtrader will make a profit over the unskilled one; this means that high valuesof the functional Ap with p ∈ [1, 2); should be more likely, given the sameamounts of arbitrage. To account for this, we propose as probability densityfunction

P (Ap) ∝ e−βpAγp with γ ∈ (0, 1);

to maintain the analogy with the GBM case we define β by

βp = 12σp .

Note that the parameter σ is not the volatility, but it is related to it. Con-sidering the action Ap with the probability defined above and HP2, thefluctuations of the market around the minimum action configuration turnout to be described by

Pγ,p(Ap) ∝ e−1

2σp( ´ T

0 |∂t log(St)−rt|pdt)γ, (29)

and the GBM is recovered when γ = 1 and p = 2.It is interesting to compare the pdf obtained with the GBM against

different (γ, p) cases. The condition γ < 1, i.e. the intermediate timehorizon, implies that small amounts of action Ap are less likely to happenwith respect to the same amount of arbitrage in the GBM case. This is inagreement with our hypothesis, since by HP3 small amount of arbitrage areallowed. Moreover, the arbitrage is not the quantity minimized in the shorttherm dynamics. On the other side, large values of the action Ap are morelikely to happen with respect to the same amount of arbitrage in the GBMcase; this is in agreement with the condition that requires the minimizationof the arbitrage.

Recalling the path integral formalism introduced by Feynman in [19], weobtain that the transition probability is the gauge-invariant weighted meanwith respect to Pγ,p over the space of all paths connecting S(0) with S(T ),i.e.,

P (S(T )|S(0)) =∑

St∈XS0,ST

Pγ,p(Ap(St)),

where the tilde notation indicates that the sum is computed adopting agauge-invariant measure. The above formula means that the transition

33

Page 35: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

probability P (S(T )|S(0)) is composed of the contributions of all the pos-sible paths connecting the initial and the final states. Each path contributesinversely with respect the amount of action associated to it; the magnitudeof the contributions is controlled by the probability Pγ,p. An interestingmathematical problem is to define a way to sum all the paths, respectingthe gauge invariance; this will be discussed below.The sum over the path space is an infinite dimensional integral

ˆDS = lim

N→∞

N−1∏i=1

ˆ ∞0

dSi.

Note that the definition above is not gauge invariant. Given a gauge groupG, a gauge-invariant function f(x) and a measure dµ(x), we require that

ˆf(x)dµ(x) =

ˆf(gx)dµ(gx) ∀g ∈ G.

Such measure is known as the Haar measure of the group. For the group R+

the Haar measure exists and it is unique, up to a multiplicative constant; itis given by

dS/S = d log(S) .

Finally, the formula for the transition probability is

P (S(T )|S(0)) ∝ˆD log(S)e−

12σp( ´ T

0 |∂t log(St)−r|pdt)γ. (30)

3.5 Results

We present some comparisons between real data and our model. The realdata consist in 3 months price-sheets of the AMAZON, GENERAL ELEC-TRIC and APPLE stocks. To obtain the approximate probability densityfunction associated to the stock, we follow the method introduced in thereference [18], i.e. we consider a set of historical data as instances of astochastic variable. We first compute Xi by

Xi = log(P (ti)/P (ti−1)) , ti − ti−1 = τ,

then we build a histogram of the values Xi with N bins. The histogramsshown in the figures below display the number of counts ∆C in each his-togram bin, divided by the bin width ∆S/N . The result is then normalized.

The error bars for the real data are estimated as σbins∆S/N ; where ∆Sis the width of the histogram x-bars. In order to compare our computa-tions with the results obtained in [2, 3, 14], we plot the probability densityfunctions in logarithmic scale. The error associated to the numerical compu-tation has been estimated and it is omitted since it is negligible with respect

34

Page 36: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

to the error over the data. The numerical computations are performed ap-proximating the path integrals with a 10 dimensional integral; details aboutfinite dimensional approximations and the algorithms used to evaluate theintegrals can be found in the sections 6 and 7.

3.5.1 Short-term dynamics

We present here the results for three stocks, AMAZON, GENERAL ELEC-TRIC and APPLE.

The data used are the price-sheet from September 20, 2017 until Decem-ber 20, 2017, with sample frequency 1, 5 and 30 minutes. In this sectionr = 0 unless otherwise stated.

3.5.2 1 minute

In this section we present the results for the one minute dynamics. The Fig-ures 13, 14 and 15 show in blue the probability density function derived fromthe data, while the black line is the probability density function computedwith the model presented above. The dataset consists of 30000 prices.

Figure 13: AMAZON stock, σ =0.035, p = 1.15, γ = 0.15,∆ log(S) = 0.011, N = 120 andT = 1m.

Figure 14: GENERAL ELEC-TRIC Stocks σ = 0.0326, p = 1.15,γ = 0.15, ∆ log(S) = 0.014, N =120 and T = 1m.

3.5.3 5 minutes

The five minutes dynamics is presented in the Figures 16, 17 and 18. Thedataset consists of 6000 prices.

The values of the parameters γ and p is the same for the three stocks.We also note that the shared parameters have a higher values with respectto the one minute dynamics.

35

Page 37: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

Figure 15: APPLE Stocks σ = 0.0321, p = 1.15, γ = 0.15, ∆ log(S) = 0.009,N = 120 and T = 1m.

Figure 16: AMAZON stock, σ =0.0119, p = 1.2, γ = 0.2,∆ log(S) = 0.016, N = 75 andT = 5m.

Figure 17: GENERAL ELEC-TRIC Stocks σ = 0.0111, p = 1.2,γ = 0.2, ∆ log(S) = 0.014, N = 77and T = 5m.

3.5.4 30 minutes

Finally, we present the final results for the half-hour time frame. Figures19, 20 and 21 show the results of our computations, together with the proba-bility density functions computed from the real data. In this case the datasetcontains 1000 prices; in order to maintain the number of prices per bin closeto the other cases: N is between 11 and 17.

3.6 The analysis of the short-term dynamics

In the previous section we have analysed the dynamics of 3 similar stocksfor market capitalization, in 3 different time horizons. The results of thecomputations shown above are consistent with the theory. The values of γand p converge to the values associated to the GBM, when the time horizonis increased. It is also interesting to note that the values of the previousparameters are shared among all the stocks analysed for each time horizontreated. This last fact seems to suggest that the three stocks share a common

36

Page 38: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

Figure 18: APPLE Stocks σ = 0.0107, p = 1.2, γ = 0.2, ∆ log(S) = 0.011,N = 75 and T = 5m.

Figure 19: AMAZON stock, σ =0.00945, p = 1.23, γ = 0.23,∆ log(S) = 0.034, N = 11, r =−0.0001 and T = 30m.

Figure 20: GENERAL ELEC-TRIC Stocks σ = 0.0099, p = 1.23,γ = 0.23, ∆ log(S) = 0.04, N =17, r = 0.0002 and T = 30m.

dynamics.

3.7 Long-term dynamics

We present here the results with time intervals of one day and one week. Inorder to have enough data to approximate properly the probability densityfunction, we need a consistent extension of the time horizon, which now is 30years. We select data from the February 01, 1988 until February 01, 2018.

Considering such time intervals, it is better to study the dynamics ofindices, since stock prices may be affected by capital increases, splits andother events which would require more care in the selection of the data. Weselect the Dow Jones and the S&P500.

37

Page 39: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

Figure 21: APPLE Stocks σ = 0.0094, p = 1.23, γ = 0.23, ∆ log(S) = 0.034,N = 11, r = −0.00015 and T = 30m.

3.7.1 One day dynamics

The one day dynamics is presented in Figures 22 and 23. The dimensionof our dataset is approximatively of 7000 prices, where the price selected isprice at the closing time.

Figure 22: Dow Jones Index, σ =0.062, p = 1.35 and γ = 0.35,∆ log(S) = 0.12, N = 70, r =0.0005 and T = 1d.

Figure 23: S&P500 Index, σ =0.062, p = 1.35 and γ = 0.35,∆ log(S) = 0.12, N = 70, r =0.0005 and T = 1d.

3.7.2 The week dynamics

The results for the weekly dynamics is presented in the Figures 24 and 25,the data-set contains almost 1100 prices, selected at the Friday closing time.The histograms of these computations are characterized by a lower number

38

Page 40: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

of prices per bin. Since we are considering prices with one week samplingfrequency, the variance of each bin is very high, therefore we need a largerN to maintain low data errors

Figure 24: Down Jones Index, σ =0.023, p = 1.42 and γ = 0.42,∆ log(S) = 0.14, T = 7d, r =0.002 and N = 50.

Figure 25: S&P Index σ = 0.023,p = 1.42 and γ = 0.42, ∆ log(S) =0.14, T = 7d, r = 0.002 and N =50.

3.7.3 Final analysis

The results with a time horizon of one minute show a better agreement withthe data than [2, 3, 14]. Our results are similar to those in second chapter;but we have 3 parameters instead of 5.It is also interesting to note that the same model is capable to provide agood agreement with 5 different time horizons in both cases of indexes andstocks.The parameter values used in the previous computations are consistent withthe financial interpretation. We note that the values of (γ, p) both growwith the enlargement of the time horizon; this relation is justified by thetheoretical background of the theory presented in section 4. In all the cases,different stocks and indexes share the same value of the parameters γ and p.The difference associated to the liquidity is expressed by a different value ofσ. This fact seems to suggest that, given a time frame, there is a commondynamics for all the cases.

3.8 Definition and approximation of the path integrals

There exists a rigorous theory of path integrals only when the Lagrangianis quadratic. When a small perturbation is added, as it happens e.g. in

39

Page 41: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

quantum electrodynamics, it is possible to evaluate them thanks to pertur-bation techniques based on Feynman diagrams, but such techniques are notmathematically rigorous; moreover, they involve infinite quantities whichrequire renormalization theory to be dealt with. In our model, as soon asp 6= 2, there is no quadratic part to use as a starting point, therefore it isnecessary to provide both a rigorous definition and a computation algorithmto formula (30).

The model proposed by Ilinski has a Gaussian Lagrangian, therefore itis defined as

P (S(T )|S(0))GBM =ˆD log(S)e−

12σ2´ T0 (∂t log(St)−rt)2dt

≈ limN→∞

N−1∏i=1

ˆ ∞0

dSiSi

exp[− T/N

2σ2

N−1∑i=0

( log(Si+1)− log(Si)T/N

− r)2]

. (31)

The Gaussian nature of (31) guarantees two important properties: the fi-nite dimensional approximation does not depend on N and the probabilitydistribution derived from the calculation is again log-normal.

Consider now (30). The most natural definition would be the analogousof (31), but our computations suggest that the sequence does not approacha finite limit, see Figure 26. In order to propose a well posed definition, we

Figure 26: Output of the algorithm when γ = 0.4, p = 1.4 and σ = 0.014,and N = 10 (blue), N = 11 (yellow), N = 12 (green). The red curverepresents a Gaussian pdf with σ=0.00128.

consider first the case γ = 1, that is

P (S(T )|S(0)) ∝ˆD log(S)e−

12σp´ T0 |∂t log(St)−rt|pdt ,

and we compare our problem with a standard problem in probability theory.Consider a collection of i.i.d. stable Levy random variables Xn with

characteristic function

φ(q) = e−γ|q|α with α ≤ 2 .

40

Page 42: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

The previous distribution is stable, see e.g. [4, Sec 4.2]; this amounts to saythat the sum of N rescaled random variables Xn

SN =N∑n=0

Xn/N1/α

is also a Levy random variable with the parameters independent from N ,provided that we also rescale the probability P (S) 7→ P (S)N1/α.

Clearly, when α = 2 we recover the Gaussian case, [4, Sec 3.3], and therescaled variables are also Gaussian.

A similar phenomenon happens with the path integral definition. We set

P (S(T )|S(0)) =ˆD log(S)e−

12σ2´ T0 |∂t log(St)−rt|pdt

≈ limN→∞

N−1∏i=1

ˆ ∞0

dSiSi

exp[− (T/N)p/2

2σpN−1∑i=0

∣∣∣∣ log(Si+1)− log(Si)T/N

− r∣∣∣∣p] ,

(32)

and we check that the numerical approximation appears to be convergent,see Figures 27 and 28 (left). We recover the familiar quadratic definition inthe case p = 2.

In order to support the choice of the exponent p/2, for some choices of(p, σ) we estimated the path integrals with different values of N , and weobserved that the resulting pdf’s converge when N is increased. Figures 27and 28 show the results for some of these choices. The relative errors of thecomputations with γ = 1 is less than 3% .

We point out that the distribution computed with the path integral isdifferent from the one associated to the action.ˆ

D log(S)e−1

2σp´ T0 |∂t log(St)−rt|pdt 6= e−

12σpT | log(ST )−log(S0)|p ,

see Figure 29.The case with γ 6= 1 needs some further generalization of the definition

of the path integral. With the same approach, we found that a well poseddefinition is

P (S(T )|S(0)) =ˆD log(S)e−

12σ2

( ´ T0 |∂t log(St)−rt|pdt

)γ≈ lim

N→∞

N−1∏i=1

ˆ ∞0

dSiSi

exp[− 1

2σp(N−1∑

i=0

∣∣∣∣ log(Si+1)− log(Si)T/N

− r∣∣∣∣p(T/N)f(p,γ)

)γ],

(33)

withf(p, γ) = p− (p/2)γ/γ.

41

Page 43: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

Figure 27: Left: results with γ = 1, p = 1.2, σ = 0.0027, ∆ logS = 0.16.Right: results with γ = 1, p = 1.5 and σ = 0.0037, ∆ logS = 0.16. For bothpictures we have N=9 (green), N=12 (blue) and N=15 (yellow). The redcurve represents a Gaussian distribution with σ=0.00128.

Figures 30 and 31 show the results of the estimates of the integral for somevalues of (γ, p, σ). The relative errors are negligible when N ≤ 12. WhenN = 13, 14, 15 it is respectively 5%, 8% and 10%.

Figures 31 and 30 show the results of our tests concerning the well posed-ness of (33). The probability density functions are studied over a range ofmore than 4 orders of magnitude, that is a wider range than what we usein the comparison with real data. In order to estimate the convergence,for a given integer M we compute the approximations with N = M andN = M + 1; then we compute the average of the differences of the prob-abilities of the highest and lowest price in the two cases. The results fordifferent choices of M are shown in Figure 32 along with the relative errors.Clearly, we do not have a proof that our definition of non Gaussian pathintegral is well posed, more precisely that the limits in (32) and (33) existand are finite, but we claim that the results of our computations are stableand consistent with the standard Gaussian case.

3.9 Numerical Methods

To compute the conditional probability P (S(T )|S(0)) we need to estimatemulti-dimensional integrals.

The crude Monte Carlo (CMC) method is the simplest to implement,but it is too slow. Markov-Chain Monte Carlo (MCMC) methods are faster,but they require a separate computation to normalize the pdf, thus makingthese methods less efficient for our purpose.

We choose instead the Quasi Monte Carlo (QMC) method. The main

42

Page 44: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

Figure 28: Results with γ = 1, p = 1.7 and σ = 0.004, ∆ logS = 0.16 withN=9 (green), N=12 (black) and N=15 (yellow). The red curve represents aGaussian distribution with σ=0.00128.

Figure 29: Comparison between the graph in Figure 27 right (black), andthe pdf associated to the action (red)

43

Page 45: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

Figure 30: Left: results with γ = 0.5, p = 1.5 and σ = 0.015. Right: resultswith γ = 0.2, p = 1.3 and σ = 0.014. The dimensions are: N=10 (azure),N=11 (blue), N=12 (yellow), N=13 (green), N=14 (red) and N=15 (black).

Figure 31: Left: results with γ = 0.29, p = 1.275 and σ = 0.013. Right:results with γ = 0.8, p = 1.7 and σ = 0.0085. The dimensions are: N=10(azure), N=11 (blue), N=12 (yellow), N=13 (green), N=14 (red) and N=15(black).

difference between the QMC and CMC consists in the disposition of the gen-erated points. The QMC algorithm can generate a pattern of points whichare distributed more evenly than the plain CMC. The better distributionof the points in the QMC yields a convergence rate of the integral of orderlog(N)D/N , where N is the number of points and D the dimension of theintegral, while the CMC has order N−1/2. Clearly, the QMC method is abetter choice when D is small, while CMC performs better in higher di-mensions. Due to this differences all the simulations shown in section 5 areperformed with a QMC methods; whereas the simulation shown in section 6,which are characterized by higher dimensions, are carried on with the usualCMC methods.

There are many algorithms to generate a set of QMC points. We chooseSobol, because it ensures the same homogeneity of the points in all thedirections of the domain.

44

Page 46: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

Figure 32: The black and green lines refer to the PDFs in Figure 30. Theblue and yellow lines refer to the PDFs in Figure 31.

The QMC algorithm is deterministic method are characterized by a fixeddisposition; as opposed with the quasi-random points generated by the CMCalgorithm, therefore errors cannot be estimated by repeating the algorithm.Instead, to obtain different estimates of the integral we shift the points bya random value and then repeat the computation. Details about the Sobolalgorithm and the random shift method to estimate the error can be foundin [29].

We estimated all the probability density functions with 40 final prices.On average the computation required a few minutes in the cases treated withthe QMC, using on a laptop with a current dual core processor. We remarkthat the algorithm is fully parallelizable; in particular the computation timeson a GPU may be much smaller.

3.10 The Chapman-Kolmogorov equation

The Geometric Brownian Motion is a Markov process. This means that theprobability density function obtained from the path integral formulationsatisfies the gauge-invariant semigroup equation

P (S(T )|S(0))GBM =ˆD log(SK)P (S(T )|S(K))GBMP (S(K)|S(0))GBM ,

(34)where K ∈ (0, T ).The previous equation is also known as the Chapman-Kolmogorov equationand it is a general property of Markovian processes. A straightforwardcalculation shows that (34) is satisfied if and only if γ = 1. In [27, Sec.20.1.18], it is stated that the semigroup property is reasonably satisfiedfor time frames higher than 15 minutes only outside the deep tails of rareevents. Also, the model proposed for the one minute dynamics, that is theBoltzmann distribution, satisfies the semigroup equation, but it does not

45

Page 47: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

achieve a good agreement in the deep tails region, see [27, Figure 20.10].The model in (30) behaves in the same manner; Figure 33 compares theresults of the model with γ = 1 with the GE data shown in Figure 17. Theagreement is satisfactory only in the central region.

Figure 33: Output of the algorithm with γ = 1, p = 1.2 and σ = 0.00037.

The numerical computation shown in Section 6 are based on a modelwhich does not satisfies equation (34); indeed this model shows a goodagreement also in the deep tails region.

We observe that the computation with γ ' 1, see Figures 27 (left),28,30 (left),31 (right) have good overlap through all the finite dimensional ap-proximations. The computations with γ < 0.4, see Figures 30 (right) and 31(left), have a good overlap only in the higher dimensional approximations;and the differences between the extreme prices are higher with respect thecases with γ closer to 1. This suggests that the parameter γ plays an activerole in the speed of convergence for the finite dimensional approximations.

4 Conclusion

Our results contribute to the vast literature on econophysics, in particularto the idea that the techniques of quantum mechanics can be used as a validalternative of the stochastic calculus to describe the stochastic nature of thefinancial markets.

The agreement between the real and the simulated data reached by themodels presented in the thesis is higher with respect to some other modelsin this framework.In the chapter 2 we presented the numerical implementation of a modelin order to compute the probability density function (15), which had beenstudied in [2] with some approximations techniques. We also introduce ageneralization of such model and proved that it achieves a higher level ofagreement with real data, when compared with the classical model proposedby Ilinski.The model is characterized by a consistent computational cost and by an

46

Page 48: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

elevated number of parameters but, it is capable to simulate the interactionsbetween the stocks and order dynamics. The latter feature suggests that themodel is suited for the simulation of the orders in the real market context.

In chapter 3 we generalize the model proposed by Ilinski by using aLagrangian which is not a function of the arbitrage. This generalizationallows us to define a new model, where the main dynamics is non-Gaussian.The main advantage of this model consists in the low number of parameterswith respect to other models with similar accuracy. More precisely, ourmodel is characterized by 3 parameters, whereas the models described inthe chapter 2, in the paper [14] and the Heston model entail 5 parameters.

The application of a non-Gaussian dynamics to financial problems hasalready been proposed in [21, 22, 23, 27]. Our model is also characterized bythe fact that it does not satisfy the semigroup property, i.e. the stochasticprocess described by the path integral is not Markovian. Path integrals havealready been used in order to solve stochastic differential equation with Non-Markovian noise, see e.g. [24, 25, 26]. Our work adds to the vast literature inthis field and proposes a new conjecture for the computation of a particularform of path integrals. Our results are in agreement with the financial dataanalysed and with the theoretical background proposed. Considering thereduced amount of parameters and the convenient computational time cost,we believe that the second model could find practical applications for thesimulation of the stocks dynamics.

Both models are characterized by a fully parallelizable computationalalgorithm; in particular, they can be improved adopting the GPGPU orFPGA technologies.

This is very important since a fast computational procedure is essentialfor the application of the models.

We also propose some interesting questions worth to be investigated.We analyse the prices of 3 stocks and 2 indexes with different time horizons,but we do not study the auto-aggregation phenomena because our datasetis too small for this kind of analysis.Both models are capable to fit the probability density functions of the samestock, sampled at different time horizons. This suggests that it should bepossible to define a global set of parameters and then to recover the parame-ters associated with a particular sample frequency, by combining the globalparameters with a scaling law that involves the time horizon. We may won-der if the law which characterizes the relationship between the parameters isequivalent or similar to the scaling law that subsists for the self-aggregationphenomena. It has been shown in [3] that the self-aggregation phenomenais really observed in the market, thus we expect that it is also a feature ofthe models used to describe the stocks dynamics.

Some interesting questions arise for the parameters (σ, p, γ) of the secondmodel. In particular, we conjecture that the optimal value of γ is p− 1.Furthermore, it would be important to study the connection between the

47

Page 49: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

parameter γ 6= 1 associated with memory and the relative implications tothe convergence of the finite dimensional approximations.To summarize our work, we claim that the models proposed in this thesisrepresent a valid alternative to stochastic calculus-based models for whatregards the applications in practical and theoretical problems.Some questions remain without answers but we hope that the work willstimulate future analyses of this subject.

5 Appendix

In this part of the thesis we provide a brief introduction of the many back-ground concepts we have discussed in the previous chapters.

5.1 Feynman’s path integral

This section is devoted to a brief introduction of Feynman’s path integral.The whole material is taken from [20]; we refer to that reference for a com-plete exposition.

5.1.1 The classical mechanics

We consider a body of mass m, with a position in the space denoted by x,moving at a speed x. If the body is under the influence of a force F = −∇V ,then we can use classical mechanics to forecast its trajectory. The principlewhich determines the particular path x(t), out of all the possible paths inthe phase-space which the body can follow, is called the principle of leastaction. That is, there exists a certain quantity S which can be computedfor each path. The classical path x(t) is the one for which the value of S isunchanged in the first order, if the path x(t) is modified slightly.The quantity S is defined as

S =ˆ tb

ta

L(x, x, t)dt (35)

where L is the Lagrangian for the system.The critical path x(t) is determined perturbing x(t) by an amount δx(t),together with the condition that the end points of x(t) are fixed:

δx(ta) = δx(tb) = 0.

The condition that x(t) be a critical of S means

δS = S(x+ δx)− S(x) = 0

48

Page 50: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

to first order in δx(t).The variation of S is obtained integrating by parts and remembering thatthe δx(t) is zero at the end points; giving as result:

δS = −ˆ tb

ta

[d

dt

∂L

∂x− ∂L

∂x

]dt.

Since between the end points δx(t) can take any arbitrary value, the ex-tremum is the curve along which the Euler-Lagrange equations are alwayssatisfied:

d

dt

∂L

∂x− ∂L

∂x= 0 (36)

It is important to note that the above condition is an ordinary differentialequation (ODE). The previous fact is important since, given an initial data(x0, x0, 0), the solution of the ODE (36) associated to (x0, x0, 0) exists and itis unique. This means that the system described by the classical mechanicsis deterministic.

5.1.2 The quantum case

Quantum mechanics is based on a different framework. The deterministicframework is replaced by a probabilistic one. In the path integral formalismeach path is characterized by a probability; we must define how much eachtrajectory contributes to the total amplitude to go from a to b.

The probability P (a, b) to go from a point xa at time ta to a point xb attime tb is the absolute square P (a, b) = |K(b, a)|2 of an amplitude K(a, b)to go from a to b. This amplitude is the sum of the contributions of φ[x(t)]for each path:

K(a, b) =∑

paths from a to bφ[x(t)], (37)

withφ(x(t)) = Ne(i/~)S(x(t)). (38)

The action S is defined as in the classical case (35), and the constant Nchosen to normalize K.

We now provide a heuristic explanation of the sum (37). The classicalpath x(t) is c a stationary point for S; this means that the phase in (38)is constant if evaluated in x(t). We consider x(t), a slightly different pathwith respect to x(t). The phase (i/~)S(x(t)) is not constant any more; yetsince the differences with x(t) are assumed to be very small, there are asmall oscillations in (38): this means the contribute of x(t) is not negligible.On the other side, a path y(t) completely different from x(t), will generatea huge change in the phase of (38), creating a massive oscillations thattransform the contribution to y(t) in a negligible quantity.

It is interesting to observe that the classical case can be retrieved withthe approximation ~ → 0. If the previous condition holds, any path which

49

Page 51: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

is not x(t) generates an infinite change in the phase; this means that theonly path with non zero contribution is x(t).

5.1.3 Sums over paths

We provide here a mathematical definition for the sum over all the paths. Itis important to recall that this framework is not general and it works onlyfor some cases; the construction of a global definition which works for allthe cases is still an open problem.

First, we choose a subset of all paths. To do this, we divide the inde-pendent variable time into steps of width ε. This gives us a set of valuesti spaced by an interval ε apart between ta and tb. At each time ti we se-lect some point xi. We construct a path by connecting all the points withstraight lines. The sum over all paths is constructed by taking a multipleintegral over all values of xi for i = 1, .., N − 1, where

Nε = tb − ta,

ε = ti+1 − ti,

t0 = ta, x0 = xa, tN = tb, xN = xb.

The resulting computation is:

K(a, b) ∝N−1∏j=1

ˆdxjφ(x(t)), (39)

where we do not integrate over the starting and ending points, x0 and xN .The accuracy of the simulated path can be improved by making ε smaller.However, it is important to remember that we cannot proceed to the limitof this process because the limit does not exist.As in the case of the Riemann integral, we need to define a normalizingfactor which we expect will depend upon ε. Unfortunately, to define such anormalizing factor seems to be a very difficult problem and it is not knownhow to do it in general. Assuming the Lagrangian has the form

L(x, x) = m

2 x2 − 1

2mωx2, ,

the normalizing factor turns out to be

A−N =(2πi~ε

m

)−N.

We emphasize that the quadratic dependence in the Lagrangian is essentialin order to obtain the previous normalization constant. If the Lagrangian isnot quadratic, then it is necessary to re-define the whole theory; as shown

50

Page 52: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

in the section 3.8.According to the previous assumption, the limit exists and we may write

K(a, b) = A−NN−1∏j=1

ˆdxje

(i/~)S(b,a) (40)

whereS(b, a) =

ˆ ta

tb

L(x, x, t)dt,

is a line integral taken over the trajectory passing through the points xi withstraight sections between.

5.1.4 The mathematical problem of the sum over paths

We already mentioned that the particular structure of the path integrationis related to the form of the Lagrangian. A similar situation arises withthe Riemann integral. This theory of integration cannot provide an answerif the function to integrate is the Dirichlet function. The redefinition ofthe concept of integral described in Lebesgue’s work allows to evaluate theintegral of the Dirichlet function ; clearly, the need to redefine the methodof integration does not destroy the concept of integration itself.The same philosophy can be applied to the concept of the sum over all paths:like the ordinary integral, it is independent of a special definition and validin spite of the failure of such definitions. Thus we write the sum over all thepaths in a less restrictive notation as

K(b, a) =ˆ b

ae(i/~)S(b,a)Dx

which we shall denote path-integral.

5.2 Dynamics of money flows

In this section we provide a theoretical background for what regards themoney flows dynamics. The money flows are generated by the exchange ofa stock for an amount of cash and vice versa, i.e., they represent the ordersperturbation. Our discussion is derived from [2]. In this section we do notpresent the whole derivation; but only the fundamental aspects.

5.2.1 Money flows: first principles

In this section we present briefly the principles underlying the money flowsdynamics.

• We assume a perfect capital environment, i.e., there is always thepossibility of placing money in a deposit and borrowing without anyrestrictions.

51

Page 53: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

• For short-time horizons traders are risk neutral, i.e., traders do notthink about the corresponding risk.

• There is a smallest time step in the market, which is denoted by ∆.

• There are transaction costs, they are indicated with the letters tc thatstand for the percentage cost of the operation; for example: if thetransaction costs are 5% of the asset value, then tc = 0.05.

• The investors want to maximize the action functional of their invest-ments. The functional is defined as:

s(C) = log[U1U2...UN ],

where C stands for the strategy adopted in the assets ’space’-time. Thestrategy is characterized by Uii=1..N elements of the structure groupwhich are equal to the exchange prices (Si, S−1

i ) or interest factors(e∆r1 , e∆r2).

• The money flow dynamics evolves stochastically. The probability as-sociated to a trajectory C is selected equal to a Boltzmann-type dis-tribution, i.e.,

P (C) ∝ eβs(C). (41)Moreover, the money flows dynamics is also gauge-invariant.

5.2.2 Construction for a single investment horizon

With the previous definition of P (C), if we want to compare the trajectorieswith different initial and (or) final points, we have to transport them to thesame endpoints. Keeping in mind the above discussion, this means that theweight P (C) has to be defined in a more general form:

P (C) ∝ eβs(C) = eβ log[φ−1f

(xf )U1U2...UNφi(xi)].

The terms φ−1f (xf ) and φi(xi), represent a price of one unit of assets at the

initial and final points xi and xf . According to the gauge invariance it isirrelevant how we fix the price, but the easiest way to fix a gauge is so thatat the initial and the final times a unit of share will cost a unite of cash.Adopting this gauge we have that the unit of cash at the initial and finalmoments is equal to

√S, while the unite of shares is equal to 1/

√S times

the real share, where S stands for the real price of the share in the gaugefixed for the stocks dynamics, i.e., for example: dollars.In this case we can write:

φ(xi,f ) = S1/2(Ti,f ) for xi,f = (cash, Ti,f )

φ(xi,f ) = S−1/2(Ti,f ) for xi,f = (shares, Ti,f ).

52

Page 54: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

The latter definitions of φ(xi,f ) and the additivity of the logarithm in (41)results in the non-normalized N -step transition probability for an investor

P (Tf |Ti) ∝ D−1(Tf )P (tN = Tf ; tN−1)P (tN−1; tN−2)...P (t1; t0 = Ti)D(Ti),

where D(t) has the form

D(t) =[eβ log(S1/2(t)) 0

0 e−β log(S1/2(t))

]=[S

˜β/2(t) 00 S−

˜β/2(t)

],

and P (ti+1; ti) is the left transition probability matrix that we have to defineaccording to the previous requirements.We recall that a left transition probability matrix is a matrix

P =

p11 p12 . . . p1n. . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . .pn1 pn2 . . . pnn

,such that

pjk = P (j|k) i.e.n∑j=1

pjk =n∑j=1

P (j|k) = 1,

where the indexes j and k identify all the cases allowed in the system de-scribed.In order to define the left transition matrix in the case of the money flowdynamics, we need to analyse all the possible transition states. In the caseof a single investment horizon there are only four possibilities:

• The transition from the state where the portfolio contains cash tothe state where the portfolio contains cash again. We denote theprobability of this transition with P$$.

• The transition from the state where the portfolio contains cash to thestate where the portfolio contains stocks. We denote the probabilityof this transition with PS$.

• The transition from the state where the portfolio contains stocks tothe state where the portfolio contains cash. We denote the probabilityof this transition with P$S .

• The transition from the state where the portfolio contains stocks tothe state where the portfolio contains stocks again. We denote theprobability of this transition with PSS .

We use the definition (41) to evaluate the probabilities.We start with the P$$ and PSS quantities, recalling that r1 stands for the

53

Page 55: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

interest rate associated the cash while r2 stands for the interest rate relativeto the stock. Then we have:

P$$ = P ($|$) = eβ log[e∆r1 ] = eβ∆r1 ,

PSS = P (S|S) = eβ log[e∆r2 ] = eβ∆r2 .

The definition of PS$ and P$S , follows the same rules, but this time we needto consider also the transition costs.If we sell a stock which costs Si, we usually obtain Si unities of cash, but ifthe transition costs are present, we obtain (1−tc)Si unities of cash. Equally,if we buy a stock in presence of transition costs, then we obtain (1− tc)/Siunities of stock fir each unities of cash.By the previous observations we derive:

PS$ = P (S|$) = eβ log[(1−tc)/Si] = S−β(1− tc)β,

P$S = P ($|S) = eβ log[(1−tc)Si] = Sβi (1− tc)β.

We can finally write the transition matrix:

P (ti|ti−1) =[P$$ P$SPS$ PSS

]=

eβ∆r1 Sβi (1− tc)β

S−βi (1− tc)β eβ∆r2

.The transition matrix can be represented as a product of three factors

P (ti|ti−1) = TiU(ti|ti−1)T−1i−1,

where the matrix of the gauge transform Ti is defined as

Ti =[eβtir1 0

0 eβtir2

].

and the matrix U(ti|ti−1) has the from

U(ti|ti−1) =

1 (1− tc)βe−β(r1−r2)t−1e−β∆r1Sβi(1− tc)βeβ(r1−r2)t−1e−β∆r2S−βi 1

.The matrix U(ti|ti−1) can be considered as a lattice version of the continuous-time evolution operator U(t, t′) which satisfies the Schrodinder equation

∂tU = HU,

whit the initial conditionU(t′, t′) = id2

54

Page 56: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

and

H(t) =

0 γSβi e−βr1∆e−βµt

γS−βi e−βr2∆eβµt 0

, (42)

γ = (1− tc)/∆′, µ = r1 − r2.

This is the Hamiltonian (4) shown in the chapter 2. We note that thetime step ∆ appears in the denominator; this is not a problem since, asshown in the second chapter, it will be cancelled inside the discrete timecoherent states path integral. The explanation of the mathematics behindthe coherent state path integral will be presented in the next section.

5.3 The coherent state path integral

In this section we give a basic introduction of the ideas behind the coherentstate path integral (CSPI). The material is obtained from [2] and [30]. Westress out that our presentation prefers clarity and simplicity instead ofelegance and completeness. We refer to the previous books for a detailedintroduction.

5.3.1 The coherent states

In this section we assume familiarity with the basic notions of quantummechanics.One of the many differences that subsists between the quantum and classicalmechanics regards the energy’s configurations. In a the classical harmonicoscillator the energy varies in a continuous scale, whereas in a quantumharmonic oscillator it is usually proportional to a integer number. Thelatter system is characterized by the following Hamiltonian:

H = − ~2m∇

2 + 12mωx

2,

is one example of this fact; the energy levels are defined by the formula:

En = ~ω(n+ 1/2).

Each energy level En is in one to one correspondence with the eigenstatesof the Hamiltonian; in particular the eigenstate with energy En is indicatedwith |n〉.A coherent state is a special combination of states |n〉 conventionally paramet-rized with a complex number z and denoted by |z〉. The linear combinationis structured in such a way that the expectation values of the operatorsposition and momentum, with respect |z〉, coincide with the classical coun-terparts. The states are defined:

|z〉 = e−|z|2/2

∞∑n=0

zn√n|n〉 , 〈z|z〉 = 1.

55

Page 57: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

Denoting with a and a† the annihilation and the creator operators, thecoherent states satisfy:

a |z〉 = z |z〉 a† |z〉 = ∂z |z〉 〈z| a = ∂z 〈z| 〈z| a† = z 〈z| 〈z|z′〉 = ezz′.

If we consider an arbitrary Hilbert state |ψ〉, we can expand it into theharmonic oscillator eigenstates |n〉:

|ψ〉 =∞∑n=0

ψn√n|n〉 .

The coherent states |z〉 and the Hilbert states |ψ〉 are related by:

〈z|ψ〉 = ψ(z) 〈ψ|z〉 = ψ(z).

We recall that the coherent states system is complete, i.e., it resolves theidentity:

I =ˆdzdz√

2ψ|z〉 〈z| .

Thanks to the previous property, it is possible to prove that a normal orderedoperator

A =∑n,m

An,m(a†)n(a)m,

interacts with the coherent states in the following way:

〈z|A |z′〉 =(∑n,m

An,mznz′m

)ezz′ = A(z, z′)ezz′ .

The quantity A(z, z′) is the function of two complex variables z and z′

obtained from the initial operator A by the replacement:

a→ z′ a† → z.

5.3.2 Path integral and coherent states

In the usual context, a path is characterized by the space dimensions x, buta different approach is also possible. At each time instant t, we can considerthe state of the Hamiltonian H, then we can vary the path among all thepossible configuration of H, providing the initial and the final states. If His a normal ordered operator, it is convenient to use the coherent states, i.e.,to perform a path integral in the coherent states space.We want to compute the matrix element of the evolution operator

U = e−iT~H(a†,a)

56

Page 58: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

with H normal ordered operator and T = tf − ti is the total time lapse.Thus with |i〉 and 〈f | as initial and final states, we have:

〈f | e−iT~H(a†,a) |i〉 = lim

N→∞ε→0

〈f |(

1− i ε~H(a†, a)

)N|i〉 .

We use the coherent states system |zj〉 at each time tj through the inser-tion of the resolution of the identity:

〈f | e−iT~H(a†,a) |i〉 = lim

N→∞ε→0

N∏j=1

ˆdzjdzj

2πi e−∑N

j=1 |zj |2〈f |(

1− i ε~H(a†, a)

)|zN 〉×

[N−1∏k=1〈zk+1|

(1− i ε

~H(a†, a)

)|zk〉

]〈z1|

(1− i ε

~H(a†, a)

)|i〉 . (43)

We analyse the behaviour of each component in (43). At the limit of ε→ 0,each term in the product becomes

〈zk+1|(

1− i ε~H(a†, a)

)|zk〉 = ezk+1zk

(1−H(zk+1, zk)

~

),

where we have used the linearity of the bra-ket product and the propertyof the coherent states. The elements 〈f | and |i〉 are not coherent states,this means that their brakets behave differently. We use the coherent statesbasis to expand the states |i〉 and 〈f | obtaining:

〈f | =ˆdzfdzf

2πi e−|zf |2ψf (zf ) 〈zf | ,

|i〉 =ˆdzidzi

2πi e−|zi|2ψi(zi) |zi〉 .

The last relation implies:(〈z1|i〉− i

ε

~〈z1|H(a†, a) |i〉

)=ˆdzidzi

2πi e−|zi|2ez1ziψ(zi)

(1− i ε

~H(z1, zi)

),

while for the brakets involving |zN 〉 and 〈f | a similar relation holds.Adopting the notations:

ˆDzDz =

N∏j=1

ˆdzjdzj

2πi

ˆdzidzi

2πi

ˆdzfdzf

2πi , (44)

N−1∏k=1

(1−H(zk+1, zk)

~

)(1−H(zf , zn) iε

~

)(1−H(z1, zi)

~

)=

= exp(− i

~

ˆH(z, z)dt

), (45)

57

Page 59: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

N∑j=1−|zj |2 +

N−1∑j=1

zj+1zj − |zf |2 − |zi|2 + zfzN + z1zi =

= 12

ˆ(z∂tz − z∂tz)dt−

|zi|2

2 − |zf |2

2 , (46)

we obtain the path integral formula for the evolution operator in the limitsN →∞ and ε→ 0:

〈f | e−iT~H(a†,a) |i〉 =

=ˆDzDze

i~´ tfti

(~2i (z∂tz−z∂tz)−H(z,z)

)dte−

12 (|zi|2+|zf |2)ψf (zf )ψi(zi) (47)

Formula (47) represents the continuous time version of the CSPI; from itsderivation we can infer an important property. The relation (45) showsthat the indexes in the discrete Hamiltonian are not paired, but one stepstaggered. This fact is essential in order to set the correct finite dimensionalapproximation.

The formula (47) is obtained in the case of one dimensional coherentstate, however, the previous derivation can be easily generalized to the caseof multidimensional coherent states |z1, z2, . . . , zn〉. The derivation for themultidimensional case, which is the one used in the Ilinski theory, is con-tained in the final appendix of [2].

58

Page 60: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

References

[1] K. Ilinski, Physics of Finance, http://lanl.arxiv.org/abs/hep-th/9710148

[2] K. Ilinski, Physics of Finance: Gauge Modelling in Non-equilibriumPricing, Wiley 2001

[3] R. N. Mantegna and H. E. Stanley, Scaling Behaviour in the Dynamicsof Economic Index, Letters to Nature 06/07/1995, 376, 46-49

[4] R. N. Mantegna and H. E. Stanley, An Introduction to Econophysics ,Cambridge University Press

[5] B.E. Baaquie, Quantum Finance Path Integrals and Hamiltonians forOptions and Interest rates, Cambridge University Press, 2004.

[6] B.E. Baaquie, Interest Rates and Coupon Bonds in Quantum Finance,Cambridge University Press, 2009.

[7] G. Montagna, O. Nicrosini, N. Moreni, A path integral way to optionpricing, Physica A 310 (2002) 450-466

[8] G. Montagna, M. Morelli, O. Nicrosini, P. Amato, M. Farina Pricingderivatives by path integral and neural networks, Physica A 324, 189-195, (2003)

[9] G. Paolinelli, G.Arioli, A path integral based model for stocks and ordersdynamics, Physica A 510, 387-399, (2018)

[10] G Bormetti, G Montagna, N Moreni, O Nicrosini, Pricing Exotic Op-tions in a Path Integral Approach, Quantitative Finance 6, 1, 55-66(2006)

[11] E. Bennati, M. Rosa-Clot and S. Taddei, A Path Integral Approach toDerivative Security Pricing: I. Formalism and Analytical Results, Int.Journ. Theor. Appl. Finance 2 (1999) 381

59

Page 61: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

[12] V. Linetsky, The Path Integral Approach to Financial Modeling andOptions Pricing, Computational Economics 11 (1997) 129

[13] J.P.A. Devreese, D. Lemmens, J. Tempere, Path integral approach toAsian options in the Black-Scholes model, Physica A 389, 780-788(2010)

[14] B. Dupoyet, H.R. Fiebig, D.P. Musgrove, Gauge invariant lattice quan-tum field theory: Implications for statistical properties of high frequencyfinancial markets, Physica A 389 (2010) 107-116.

[15] B. Dupoyet, H.R. Fiebig, D.P. Musgrove, Replicating financial marketdynamics with a simple self-organized critical lattice model, Physica A390 (2011) 3120-3135.

[16] B. Dupoyet, H.R. Fiebig, D.P. Musgrove, Arbitrage-free self-organizingmarkets with GARCH properties: Generating them in the lab with alattice model, Physica A 391 (2012) 4350-4363.

[17] P. Bidarkota, B. Dupoyet, The impact of fat tails on equilibrium ratesof return and term premia , Journal of Economic Dynamics and Control31 (2007) 887-905

[18] L.Bachelier, Theorie de la Speculation, Annales Scientifiques de l’EcoleNormale Superieure 3 (17) (1900) 21-86.

[19] R. P. Feynman, Space-time approach to non-relativistic quantum me-chanics, Rev. Mod. Phys. 20, 367-387 (1948)

[20] R. P. Feynman, Albert R. Hibbs Quantum Mechanics and Path Inte-grals, Dover, 2010.

[21] H. Kleinert, Option pricing for non-Gaussian price fluctuations, Phys-ica A 338, 151-159, (2004)

[22] H. Kleinert, Option pricing from path integral for non-Gaussian Fluc-tuations. Natural martingale and application to truncated Levy distri-butions, Physica A 312 (2002) 217 - 242

[23] H. Kleinert, Stochastic calculus for assets with non-Gaussian price Fluc-tuations Physica A 311 (2002) 536-562

[24] A. J. McKane, H.C. Luckock, and A. J. Bray Path integrals and non-Markov processes. I. General formalism , Physical Review A Vol 41Number 2, (1990)

[25] A. J. McKane, H.C. Luckock, and A. J. Bray Path integrals and non-Markov processes. II. Escape rates and stationary distribution in theweak-noise limit, Physical Review A Vol 41 Number 2, (1990)

60

Page 62: POLITECNICO DI MILANO · 2019. 3. 26. · This theory is known as Quantum Finance. The Geometric Brownian Motion (GBM) is the best known model based on stochastic calculus used to

[26] A. J. McKane, H.C. Luckock, and A. J. Bray Path integrals and non-Markov processes. III. Calculation of the escape-rate pre-factor in theweak-noise limit , Physical Review A Vol 41 Number 4, (1990)

[27] H. Kleinert, Path Integrals in Quantum Mechanics, Statistics, PolymerPhysics, and Financial Markets, World Scientific Publication (2009).

[28] Adrian A. Dragulescu and Victor M. Yakovenko, Probability distributionof returns in the Heston model with stochastic volatility, QuantitativeFinance Volume 2, (2002) - Issue 6.

[29] Paul Glasserman, Monte Carlo Methods in Financial Engineering,Springer

[30] E. Fradkin, Field Theories of Condensed Matter, Cambridge UniversityPress, 2013.

[31] N.Metropolis, A. Rosenbluth, M. Rosenbluth, A. Teller, E. Teller, Equa-tion of state calculation by fast computing machine, Journal of ChemicalPhysics 21 (6) 1087-1092 (1953)

61