100% found this document useful (1 vote)
272 views

Week 2: Introduction To Discrete-Time Stochastic Processes: 15.455x Mathematical Methods of Quantitative Finance

Uploaded by

Bruné
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
272 views

Week 2: Introduction To Discrete-Time Stochastic Processes: 15.455x Mathematical Methods of Quantitative Finance

Uploaded by

Bruné
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 58

15.

455x Mathematical Methods of Quantitative Finance

Week 2: Introduction to Discrete-Time


Stochastic Processes
Time dependent
Paul F. Mende
MIT Sloan School of Management It's the same as Chile
ee Ncor
Random walk

©2021 Paul F. Mende


The Random Walk Zt is the error term
This is a random
walk

©2021 Mende 2
Time series models
we can add Random
§ A stochastic process is a time-dependent random variable
Tp var
§ Continuous time, S(t)
I§ Discrete time, S1, S2, S3, … St
§ Time series models sample the variable at uniform intervals
- Integer indices
- Equal spacing (weekdays?)
- Time zero origin

§ Discrete time processes can be constructed by adding increments


<latexit sha1_base64="T4/2prel3Un9dWMWQYmPKqT4XUM=">AAACLHicbZDNShxBEMdrNOo6fq1ec2mUDYI4zCySeFAQcslRWXcVdpahp6dGG3s+6K6RXYZ9Gd/CN/BqbjnlEoKPYe9sDommoKv+/KqK7v7HpZKGfP+Hs7D4YWl5pbXqrq1vbG61t9cHpqi0wL4oVKGvY25QyRz7JEnhdamRZ7HCq/ju66x/dY/ayCK/pEmJo4zf5DKVgpNFUfukFxH7dMp6UU2HwZQdsLEFbicM3Y7F48hvUNDkrs2hSAoy87moved7fhPsvQj+iL0zD5o4j9q/wqQQVYY5CcWNGQZ+SaOaa5JC4dQNK4MlF3f8BodW5jxDM6qbX05Zx5KEpYW2JyfW0L83ap4ZM8liO5lxujVvezP4v96wovR4VMu8rAhzMb8orRSjgs0sY4nUKEhNrOBCS/tWJm655oKssW7YLLIyzRJMjUc4trYEb014LwZdL/jsdS+OoAUfYRf2IYAvcAbf4Bz6IOABnuAZvjuPzk/n99zABWdeYQf+CeflFeFTpZI=</latexit>

§ Example: St = St 1 + xt D Recursive <latexit sha1_base64="jeMokRisna3BHjPJCipJbAj4Xao=">AAACLHicbZDNShxBEMdrNOo6fq1ec2mUDYI4zCySeFAQcslRWXcVdpahp6dGG3s+6K6RXYZ9Gd/CN/BqbjnlEoKPYe9sDommoKv+/KqK7v7HpZKGfP+Hs7D4YWl5pbXqrq1vbG61t9cHpqi0wL4oVKGvY25QyRz7JEnhdamRZ7HCq/ju66x/dY/ayCK/pEmJo4zf5DKVgpNFUfuk04uIfTplvaimw2DKDtjYArcThq6l48hvSNDkrs2hSAoy87Goved7fhPsvQj+iL0zD5o4j9q/wqQQVYY5CcWNGQZ+SaOaa5JC4dQNK4MlF3f8BodW5jxDM6qbX05Zx5KEpYW2JyfW0L83ap4ZM8liO5lxujVvezP4v96wovR4VMu8rAhzMb8orRSjgs0sY4nUKEhNrOBCS/tWJm655oKssW7YLLIyzRJMjUc4trYEb014LwZdL/jsdS+OoAUfYRf2IYAvcAbf4Bz6IOABnuAZvjuPzk/n99zABWdeYQf+CeflFd4JpZI=</latexit>

= x0 + x1 + x2 + · · · + xt

§ Increments can be recovered by differencing <latexit sha1_base64="6eO80oUVlICs0ZowFTAmoNrj3YA=">AAACA3icbVDLSgNBEOyN7xg16tHLoAheXHaDqBdB8OIxoomBJITZSa8Ozj6Y6ZWEJf/gH3jVH/Amfod3P8TJxoMmFnRPUTVNNxWkShryvE+nNDe/sLi0vFJeraytb1Q3K02TZFpgQyQq0a2AG1QyxgZJUthKNfIoUHgbPFyM/dtH1EYm8Q0NU+xG/C6WoRScrNSrbg96xM7Yte2Htud06I961T3P9QqwWeL/kL1zFwrUe9WvTj8RWYQxCcWNafteSt2ca5JC4ajcyQymXDzwO2xbGvMITTcvjh+xfav0WZhoWzGxQv09kfPImGEU2J8Rp3sz7Y3F/7x2RuFpN5dxmhHGYrIozBSjhI2TYH2pUZAaWsKFlvZWJu655oJsXuVOMcjSMOpjaFzCgY3Fnw5hljRrrn/s1q6OYBl2YBcOwIcTOIdLqEMDBAzhGV7g1Xly3pz3SYAlZ/LCFvyB8/ENQjqZvA==</latexit>

x t = St St 1

©2021 Mende 3
Time series models Discrete
Time series are used to model processes that evolve or are observed
discretely in time.
§ Ordered steps are identified with endpoints of time intervals.
§ Often defined, recursively, in terms of prior variables plus an "innovation."
§ The model is "solved" when we can describe or forecast the distribution
of values.

Examples: <latexit sha1_base64="8YAY0MgIc0te1TylepMxpYN+beU=">AAACCHicbVDLSgNBEOz1bXxFT4KXwSAIwrIbRT0KXvQWwUQhCcvsbG8yOPtgplcMQf/CP/CqP+BN/AnvfoiTjQeNFkxPUTVN91SYK2nI8z6cqemZ2bn5hcXK0vLK6lp1fbllskILbIpMZfo65AaVTLFJkhRe5xp5Eiq8Cm9OR/7VLWojs/SSBjl2E95LZSwFJysF1c3zwGd77Dyol3Xf1o6IMjJBtea5Xgn2l/jfpHbiQolGUP3sRJkoEkxJKG5M2/dy6g65JikU3lc6hcGcixvew7alKU/QdIflD+7ZjlUiFmfanpRYqf7sGPLEmEES2pcJp76Z9Ebif167oPi4O5RpXhCmYjwoLhSjjI3iYJHUKEgNLOFCS7srE32uuSAbWqVTNrI8TiKMjUt4Z2PxJ0P4S1p11z906xcHsABbsA274MMRnMAZNKAJAh7gCZ7hxXl0Xp23cYBTzviGDfgF5/0LtHOaWg==</latexit>

§ Cumulative income I1 + I2 + I3 + · · ·
<latexit sha1_base64="OswTBC+NlBH4YutZ9Ncz1WgbYis=">AAACFnicbVDLSgMxFL3j2/qqbt0ERRGEYaaIuhEENy4r2FZo65DJ3NFg5kFyRyxD/8C/8A/c6g+4E3fu/RDTqQtfB25yck4uNzlhrqQhz3t3Jianpmdm5+ZrC4tLyyv11cW2yQotsCUylemLkBtUMsUWSVJ4kWvkSaiwE96cjPzOLWojs/ScBjn2E36VylgKTlYK6tvNgNgRawYew8tSBz7bZTpo2LUnooxMdaRhUN/0XK8C+0v8L7J57EKFZlD/6EWZKBJMSShuTNf3cuqXXJMUCoe1XmEw5+KGX2HX0pQnaPpl9Z8h27JKxOJM20qJVer3jpInxgyS0N5MOF2b395I/M/rFhQf9kuZ5gVhKsaD4kIxytgoHBZJjYLUwBIutLRvZeKaay7IRljrVY0sj5MIY+MS3tlY/N8h/CXthuvvu42zPZiDddiAHfDhAI7hFJrQAgH38AhP8Ow8OC/O6zjACWe8wxr8gPP2CR9nn+4=</latexit>
Properties of not
yetobservedvalues
§ Daily stock price values Pt = P0 er1 +r2 +···+rt

§ Random walk

©2021 Mende 4
Random walk model Important
The random walk is the simplest of all time-series models
<latexit sha1_base64="Yl/a9NRjzB3kO2Sd8VM/ZO7cR18=">AAACD3icbVDLSgMxFL3j2/qqbl0YFEUQhpki6kYQ3Lis2FahLUMmc0eDmQfJHbGWLv0L/8Ct/oA78Qvc+yGmUxe+DuTm5Jx7SXLCXElDnvfujI1PTE5Nz8xW5uYXFpeqy/MtkxVaYFNkKtMXITeoZIpNkqTwItfIk1DheXh9PPTPb1AbmaUN6uXYTfhlKmMpOFkpqK6dBQ22dcjuAp/t2FqztSOijEx5bATVDc/1SrC/xP8iG0culKgH1Y9OlIkiwZSE4sa0fS+nbp9rkkLhoNIpDOZcXPNLbFua8gRNt19+ZMA2rRKxONN2pcRK9ftEnyfG9JLQdiacrsxvbyj+57ULig+6fZnmBWEqRhfFhWKUsWEqLJIaBameJVxoad/KxBXXXJDNrtIpB1keJxHGxiW8tbH4v0P4S1o1199za6e7MAOrsA7b4MM+HMEJ1KEJAu7hEZ7g2XlwXpzXUYBjzmiHFfgB5+0TmUac9g==</latexit>

A random walk is
S T = z1 + z2 + · · · + zT
11
112
the addition of 1 randomvariables
§ Each increment is an random IID variable
§ Independent and identically distributed 2 Zz 2 n are independent
§ No dependence on past history
§ Uniform time evolution
stationary
§ Universality
§ The essential features are independent of many step-level details
§ Easy to generalize for financial applications
§ Appears frequently in other contexts
§ Building block for more complex models

©2021 Mende 5
o Does not have memory of thepast
Random walk model
We can often express results in terms of "standard" random variables:
<latexit sha1_base64="bBMrogXceOgvlj5uiBqcmwuwPcI=">AAACVXicbZHPatwwEMa17p9s3bTZ9NrL0JAmvRh7CW0vgUAo9JhCdxNYuUbWjhMRyTbSOHRj/IR5glxDX6DX9lKtt4d00wGhj9/Mx4hPea2Vozi+HQSPHj95ujF8Fj7ffPFya7S9OXVVYyVOZKUre5YLh1qVOCFFGs9qi8LkGk/zy+Nl//QKrVNV+ZUWNaZGnJeqUFKQR9kIW24NfOpm1xml8PYQ4pDz8B78Nu5xAruHwKfC7nv2bm0GrrOW9rqVHzjhd2pBFdAB8RKB9rLRThzFfcFDkfwVO0cR6+skG/3g80o2BkuSWjg3S+Ka0lZYUlJjF/LGYS3kpTjHmZelMOjSto+jg11P5lBU1p+SoKf3Ha0wzi1M7ieNoAu33lvC//VmDRUf01aVdUNYytWiotFAFSyzhbmyKEkvvBDSKv9WkBfCCkn+B0LeG6EuzBwLF/mUfCzJeggPxXQcJe+j8ZcDNmSv2Ru2zxL2gR2xz+yETZhkN+wn+8V+D+6CYbC1CjAYrG72iv1TwfYfi5SzWg==</latexit>

§ Mean = 0 E[zt ] = 0
§ Variance = 1 E[zt2 ] = 1
§ Correlation = 0 for different times E[zt zt0 ] = 0 if t 6= t0
No autocorrelacio's

Examples:

I
zt = ±1, p = 1/2
§ Coin toss (+1 or –1 with equal probability) Discrete
1 zt2 /2
§ Gaussian random variable zt ⇠ N (0, 1), p(zt ) = p e
2⇡
Trick Whenwe'retalkingabout 2 random interested inthemean and
variables we're not goingto ask for the fukPDF only
we're variance
©2021 Mende 6

I haussian Gauss
Random walk model
Now consider a sum of these identical random variables.
§ What is the probability distribution of the sum?
§ In general, it can be a complicated (given by a convolution of the
individual distributions).
§ However, there is an especially simple result for the mean and the
variance of the sum.
<latexit sha1_base64="L4sEvWwc5J6GkeD8HdyupZ6Yc3w=">AAADKHicdVLdbtMwFHbCz0YYrOOWG4upWyekKokQ44JKkxASl0O03aQ6jVzXaa3lb/bJRBflVXgL3oBbuEfcoT0IJ+km2g2OHPv4+875fHLsSR4rA67707Lv3X/wcGPzkfN468nT7dbO1tBkhRZyILI406cTbmSsUjkABbE8zbXkySSWJ5OzdzV/ciG1UVnah0Uug4TPUhUpwQGhcMc6bH8K+3SPMnleqAt6GXr0Jc4+ziyeZmCabZ/2KDNFEpbQ86pxHyGgjDltylSCdUrjMJCfoXxfjVAvoHsYfwOgZlDL/d37war8CoGZPepSB6XrMeS6g3IHa3IIjP067gZhsYxg1Plf6Qdjn2k1m0PQ6NZa6/+ycj6Mm9L8a/4t7Fdr9CWC+1Xg9Ppha9ftuo3Ru4537ewedUljx2Hrik0zUSQyBRFzY0aem0NQcg1KxLJyWGFkzsUZn8kRuilPpAnK5oYr2kZkSqNM45cCbdDVjJInxiySCUYmHObmNleD/+JGBURvglKleQEyFcuDoiKmkNH6udCp0lJAvECHC62wVirmXHMB+Kgc1iTSPEqmMjJdbBS2xbvdhLvO0O96r7v+x1dkkzwnL0iHeOSQHJEP5JgMiLC+WN+s79YP+6v9y/69bKBtLVfyjKyZffUHJjD62w==</latexit>

E[ST ] = E[z1 ] + E[z2 ] + . . . + E[zT ] = 0

⇥ ⇤
Var(ST ) = E[ST2 ] = E (z1 + z2 + . . . + zT ) 2

T
X X
=
t=1
E[zt2 ] +2
t<t0
E[zt zt0 ] = T
I crossproducts
0
§ The T-step random walk has a variance that grows linearly with T.
§ The standard deviation (its square root) grows as square root of T.
©2021 Mende 7
Random walk model
§ Summary
§ The elementary random walk model is constructed as a sum of IID
random variables
<latexit sha1_base64="Yl/a9NRjzB3kO2Sd8VM/ZO7cR18=">AAACD3icbVDLSgMxFL3j2/qqbl0YFEUQhpki6kYQ3Lis2FahLUMmc0eDmQfJHbGWLv0L/8Ct/oA78Qvc+yGmUxe+DuTm5Jx7SXLCXElDnvfujI1PTE5Nz8xW5uYXFpeqy/MtkxVaYFNkKtMXITeoZIpNkqTwItfIk1DheXh9PPTPb1AbmaUN6uXYTfhlKmMpOFkpqK6dBQ22dcjuAp/t2FqztSOijEx5bATVDc/1SrC/xP8iG0culKgH1Y9OlIkiwZSE4sa0fS+nbp9rkkLhoNIpDOZcXPNLbFua8gRNt19+ZMA2rRKxONN2pcRK9ftEnyfG9JLQdiacrsxvbyj+57ULig+6fZnmBWEqRhfFhWKUsWEqLJIaBameJVxoad/KxBXXXJDNrtIpB1keJxHGxiW8tbH4v0P4S1o1199za6e7MAOrsA7b4MM+HMEJ1KEJAu7hEZ7g2XlwXpzXUYBjzmiHFfgB5+0TmUac9g==</latexit>

S T = z1 + z2 + · · · + zT

§ The random walk is a simple example of a discrete-time stochastic


process
§ Its moments can be computed by using the linearity of the expectation
operator
§ Its mean is zero and its variance is proportional to the number of steps
- These results hold for any "standard" increments, whether
continuous or discrete <latexit sha1_base64="bBMrogXceOgvlj5uiBqcmwuwPcI=">AAACVXicbZHPatwwEMa17p9s3bTZ9NrL0JAmvRh7CW0vgUAo9JhCdxNYuUbWjhMRyTbSOHRj/IR5glxDX6DX9lKtt4d00wGhj9/Mx4hPea2Vozi+HQSPHj95ujF8Fj7ffPFya7S9OXVVYyVOZKUre5YLh1qVOCFFGs9qi8LkGk/zy+Nl//QKrVNV+ZUWNaZGnJeqUFKQR9kIW24NfOpm1xml8PYQ4pDz8B78Nu5xAruHwKfC7nv2bm0GrrOW9rqVHzjhd2pBFdAB8RKB9rLRThzFfcFDkfwVO0cR6+skG/3g80o2BkuSWjg3S+Ka0lZYUlJjF/LGYS3kpTjHmZelMOjSto+jg11P5lBU1p+SoKf3Ha0wzi1M7ieNoAu33lvC//VmDRUf01aVdUNYytWiotFAFSyzhbmyKEkvvBDSKv9WkBfCCkn+B0LeG6EuzBwLF/mUfCzJeggPxXQcJe+j8ZcDNmSv2Ru2zxL2gR2xz+yETZhkN+wn+8V+D+6CYbC1CjAYrG72iv1TwfYfi5SzWg==</latexit>

E[zt ] = 0 Variable is standardized


E[zt2 ] =1
E[zt zt0 ] = 0 if t 6= t0

©2021 Mende 8

conceptcheck
It does notdepend on the distribution onlyrelevantfactor T
Generalized random walk model
Let's generalize this model by introducing two constant parameters,
<latexit sha1_base64="D+W+CINJxuq+jvtQU7DQqLywxAc=">AAACBnicbVDLSgNBEOz1bXxFD168DAZBEJZdEfUiCF48KhgNZEOYnfTGwZndZaZXjNGv8A+86g94E//Cux/iZONBEwuarqnqZpqKcyUtBcGnNzE5NT0zOzdfWVhcWl6pri5e2qwwAusiU5lpxNyikinWSZLCRm6Q61jhVXxzMvCvbtFYmaUX1MuxpXk3lYkUnJzUrq6bNrEjFlnZ1Zzdu8cOi3TRrtYCPyjBxkn4Q2rHPpQ4a1e/ok4mCo0pCcWtbYZBTq0+NySFwsdKVFjMubjhXWw6mnKNttUv739kW07psCQzrlJipfp7o8+1tT0du0nN6dqOegPxP69ZUHLY6ss0LwhTMfwoKRSjjA3CYB1pUJDqOcKFke5WJq654YJcZJWoXGR5ojuYWJ/wzsUSjoYwTi53/XDf3z3fgznYgE3YhhAO4BhO4QzqIOABnuEFXr0n7817HwY44Q07rMEfeB/f/rabRQ==</latexit>

0
rt = zt + µ o create
0 a new
random variable
§ Random variable scaled by !
§ Constant additive piece µ
§ Independent steps in each time period
§ These two parameters will be measures of risk and return.

Application: asset price returns


§ Consider a series of regularly observed stock prices, whose
logarithmic returns are defined by <latexit sha1_base64="wqTpOwdtf3uYR2s7fPAZokkm9Is=">AAACF3icbZC7TsMwFIZPuFNuhZXFAiFgICQIASMSC2ORKCA1VeS4J62Fc8E+QVRRH4G34A1Y4QXYEBM7D4KbMnD7Jcuf/t9Htv8oV9KQ5707Y+MTk1PTM7O1ufmFxaX68vyFyQotsCkylemriBtUMsUmSVJ4lWvkSaTwMro+GeaXt6iNzNJz6ufYTng3lbEUnKwV1jd1SCzAm0LeskBl3UBhTFuNkHYbYUk7/iDQstuj7bC+7rleJfYX/C9YP3ahUiOsfwSdTBQJpiQUN6blezm1S65JCoWDWlAYzLm45l1sWUx5gqZdVh8asA3rdFicabtSYpX7faLkiTH9JLInE0498zsbmv9lrYLio3Yp07wgTMXoorhQjDI2bId1pEZBqm+BCy3tW5nocc0F2Q5rQTXI8jjpYGxcwjtbi/+7hL9wsef6B+7e2T7MwCqswRb4cAjHcAoNaIKAe3iEJ3h2HpwX53VU4Jgz2mEFfsh5+wQJeaLf</latexit>

rt ⌘ log (Pt /Pt 1)

§ Then <latexit sha1_base64="CiuOYziF2ZNSIjaBI0z4QrdoVDE=">AAACF3icbVDLSgMxFL3j2/qqbt0ExQcIw0wRdSMIblxWaFVo65DJ3NFg5kFyRyxDP8G/8A/c6g+4E1fu/RDTqQtfB25yck4uNzlhrqQhz3t3xsYnJqemZ2Zrc/MLi0v15fkzkxVaYFtkKtMXITeoZIptkqTwItfIk1DheXhzPPTPb1EbmaUt6ufYS/hVKmMpOFkpqG81gxbbPGTNwGN4WerAZztMBw27dkWUkamOrUFQX/dcrwL7S/wvsn7kQoVmUP/oRpkoEkxJKG5Mx/dy6pVckxQKB7VuYTDn4oZfYcfSlCdoemX1oQHbsErE4kzbSolV6veOkifG9JPQ3kw4XZvf3lD8z+sUFB/0SpnmBWEqRoPiQjHK2DAdFkmNglTfEi60tG9l4pprLshmWOtWjSyPkwhj4xLe2Vj83yH8JWcN199zG6e7MAOrsAbb4MM+HMEJNKENAu7hEZ7g2XlwXpzXUYBjzmiHFfgB5+0THhef3Q==</latexit>

PT = P0 er1 +r2 +···+rT a Rebuild


©2021 Mende 9
Generalized random walk model
Since the expectation operator is linear, we can compute the expected
return, variance, and covariance immediately from our previous results.
<latexit sha1_base64="sTbKLqu43kGMyZJXQAAUp6nJ34s=">AAACm3icbVFda9RAFJ3Erxqr3frqy8VSu0VckkXavggrIvgkFdzdwk66TCY326GZJJ25Ka4hv8hf5Ls/xElWRNteGOZwzj0zl3OTKleWwvCn59+7/+Dho63HwZPtp892BrvbM1vWRuJUlnlpzhJhMVcFTklRjmeVQaGTHOfJ5YdOn1+jsaosvtK6wliLVaEyJQU5ajn4YZYEHK9qdQ3cqpUW8N0xr4HrGrjSbga0wK9qkcKrhhsNH9uF88TwrmsJOA/+0kPHv3Hk4fm4l/vnzsew7/BMmE4+vNvgQEMHbY9jcN4QOOE3akBl0ALxAoEOloO9cBT2BbdB9AfsTUasr9Pl4BdPS1lrLEjmwtpFFFYUN8KQkjm2Aa8tVkJeihUuHCyERhs3fagt7Dsmhaw07hQEPfuvoxHa2rVOXKcWdGFvah15l7aoKTuJG1VUNWEhNx9ldQ5UQrchSJVBSfnaASGNcrOCvBBGSHJ7DHhvhCrTKWZ25FJysUQ3Q7gNZuNRdDQaf3nLttgL9pINWcSO2YR9YqdsyqS36x17E++9P/Q/+9NNgL63udlz9l/5899Al8j/</latexit>

Build the moments


rt ⌘ zt + µ =) E[rt ] = µ ECre ECoze µ
E[(rt µ)2 ] = 2 o EEte u u
E[(rt µ)(rt0 µ)] = 0 if t 6= t0
y my um µ game mean

©2021 Mende 10
Generalized random walk model
Now consider the stochastic process generated by the sum <latexit sha1_base64="hk949HMv84XGjijuqKvil5nNPU4=">AAACKXicbVDLTtwwFL2B8hoenbLtxgKBkJCiZIR4LJCQ2HQJ0gyMNBkix7kBCztJ7ZtRR9F8C3/BH7Bt15W6o/0PPBkWLfRIvj4+517ZPkmppKUg+OnNzX9YWFxaXmmtrq1vfGx/WruyRWUE9kShCtNPuEUlc+yRJIX90iDXicLr5P586l+P0FhZ5F0alzjU/DaXmRScnBS3T/pxl+2yCL9WcsRMHLJ9VzuuRiotyDbHLjtlka10XNNpOLnpOolacXs78IMG7D0JX8n2mQ8NLuL27ygtRKUxJ6G4tYMwKGlYc0NSKJy0ospiycU9v8WBoznXaId188UJ23FKyrLCuJUTa9S/J2qurR3rxHVqTnf2rTcV/+cNKsqOh7XMy4owF7OLskoxKtg0L5ZKg4LU2BEujHRvZeKOGy7IpdqKmkFWZjrFzPqE31ws4dsQ3pOrjh8e+p3LA1iGz7AFexDCEZzBF7iAHgh4gCf4Dj+8R++X9zwLcM6b7bAJ/8D78wKBZKbH</latexit>

T
X
X T ⌘ r1 + r2 + . . . + rT = rt Boid a sum of
t=1 randomvariables
and again use the linearity of the expectation operator to find the mean and
variance of this sum:
<latexit sha1_base64="Q58AcytFB8RnvoMdelapmpaKs3c=">AAACP3icbVDdStxAGP2irT+rtau33gyVSqEQkkWqN4IggndV2NWFTQiTyRcdnEnCzBdxCftYvkVfoHirL9A78cbZbCn+9MAw5ztnDjNz0kpJS0Hw25ub//BxYXFpubOy+mntc3d99cyWtRE4EKUqzTDlFpUscECSFA4rg1ynCs/Tq8Opf36Nxsqy6NO4wljzi0LmUnByUtL92YkIb6g5moyGST9m2/vsn2CSMGbfX869dlZZSfa14ZL7rB/pOuluBX7Qgr0n4V+ydeBDi5Okex9lpag1FiQUt3YUBhXFDTckhcJJJ6otVlxc8QscOVpwjTZu2o9P2FenZCwvjVsFsVZ9mWi4tnasU3dSc7q0b72p+D9vVFO+FzeyqGrCQswuymvFqGTTFlkmDQpSY0e4MNK9lYlLbrgg13UnaoOsynWGufVdTa6W8G0J78lZzw9/+L3THViCTfgC3yCEXTiAYziBAQi4hTu4hwfvl/fHe5wVOOfNdtiAV/CengGjarEN</latexit>

El
§ Mean: E[XT ] = E[r1 ] + E[r2 ] + . . . + E[rT ] = T µ
<latexit sha1_base64="H85p1F2qRwMWyi8dW5pGlvPTaNQ=">AAADIXicbVLdbtMwFHbC3wiDddxyYzEVWqFWSYSACyZNoElcDintKjVp5LpOa81OIvsE0UZ5Dt6CN+AWXoAbhLjjQXCSDbaOIzn5/J3zfT458TwXXIPr/rDsGzdv3b6zc9e5t3v/wV5nf3ess0JRNqKZyNRkTjQTPGUj4CDYJFeMyLlgp/Ozt3X+9ANTmmdpAOucRZIsU55wSsBQ8b7lhmOiepM46OMnh9gJgX2E8rgKBUtg2jzr5CAIZREqvlxBf+a3IDLVoWNEW5o3fCl6PRV7A6Pp42fYYB8P8PkupIsMdEsHTUmtUFu23dpX86Ukhj8uW9NN7BndxrhdstnEwYVBVXcTXMicbv1F/1x0IeMSDr1qFvxtebqJYeZHxsbfqnsNT6srZeag0nBR3Dlwh24T+DrwzsHB0RA1cRJ3foeLjBaSpUAF0XrquTlEJVHAqWCVExaa5YSekSWbGpgSyXRUNr+2wl3DLHCSKbNSwA17WVESqfVazk2lJLDS27ma/F9uWkDyKip5mhfAUtoelBQCQ4bre4IXXDEKYm0AoYqbXjFdEUUomNvkhI0Q54lcsEQPzZjMWLztIVwHY3/ovRj675+jHfQIPUY95KGX6Ai9QydohKj1yfpifbW+2Z/t7/bPdoC21b7RQ3Ql7F9/AFxw+H8=</latexit>

h i
§ Variance: Var(XT ) = E (XT T µ)
2

⇣ Zeo ⌘2
= E (r1 µ) + (r2 µ) + · · · + (rT µ)

M
2
=T
o EGE eliminate the crossproduct
we still wave rid
of aTos deEs
©2021 Mende 11

cc
eExit Tu
For
Tu
rf
FATH cim Fu
o Fi us
Generalized random walk model
§ Summary
§ The generalized random walk model is constructed as a sum of IID
random variables
<latexit sha1_base64="wuUidEimqQEs0Z1rLWIuBaGQnFM=">AAACKnicbVDLSuRAFL3xNU776nHrphhRBgZC0ogOgiC4canQrQ2dNlQqN1pYlcSqG7EJ/S/zF/6BW926cCfzHVOdnsX4OFC3Tp1zL1V1klJJS0Hw7M3Mzs0vfFn82lpaXllda39bPrNFZQT2RKEK00+4RSVz7JEkhf3SINeJwvPk+mjin9+isbLIuzQqcaj5ZS4zKTg5KW7v9+Mu22YR3lTylpk4ZD9d7bgaqbQg2xy7bOuARbbScU0H4fii6zRqxe3NwA8asI8k/Ec2D31ocBK3X6O0EJXGnITi1g7CoKRhzQ1JoXDciiqLJRfX/BIHjuZcox3WzR/HbMspKcsK41ZOrFH/n6i5tnakE9epOV3Z995E/MwbVJT9GtYyLyvCXEwvyirFqGCTwFgqDQpSI0e4MNK9lYkrbrggF2sragZZmekUM+sT3rlYwvchfCRnHT/c9TunO7AIG/AdfkAIe3AIx3ACPRDwGx7gEZ68e+/Fe50GOONNd1iHN/D+/AXto6b1</latexit>

X T ⌘ r1 + r2 + . . . + rT

§ Each term has a scale and an offset, which can be used to model the
volatility and mean return of asset price dynamics
<latexit sha1_base64="D+W+CINJxuq+jvtQU7DQqLywxAc=">AAACBnicbVDLSgNBEOz1bXxFD168DAZBEJZdEfUiCF48KhgNZEOYnfTGwZndZaZXjNGv8A+86g94E//Cux/iZONBEwuarqnqZpqKcyUtBcGnNzE5NT0zOzdfWVhcWl6pri5e2qwwAusiU5lpxNyikinWSZLCRm6Q61jhVXxzMvCvbtFYmaUX1MuxpXk3lYkUnJzUrq6bNrEjFlnZ1Zzdu8cOi3TRrtYCPyjBxkn4Q2rHPpQ4a1e/ok4mCo0pCcWtbYZBTq0+NySFwsdKVFjMubjhXWw6mnKNttUv739kW07psCQzrlJipfp7o8+1tT0du0nN6dqOegPxP69ZUHLY6ss0LwhTMfwoKRSjjA3CYB1pUJDqOcKFke5WJq654YJcZJWoXGR5ojuYWJ/wzsUSjoYwTi53/XDf3z3fgznYgE3YhhAO4BhO4QzqIOABnuEFXr0n7817HwY44Q07rMEfeB/f/rabRQ==</latexit>

rt = zt + µ

§ The moments can be computed by using the linearity of the


expectation operator
§ The mean and variance of the sum are linear in time. They are T times
the parameter values of each individual step.

©2021 Mende 12
Linear Time Series Models

©2021 Mende 13
Time series models
To capture causality and correlation across time, more complex models
can be built by combining elements of the random walk.
§ Example: MA(1) moving average model is not IID

r t ⌘ µ + zt + z t 1 2 is known timet

Notice that the last term refers to an earlier-time random variable


whose value will be known by time t.

§ In other models, such as GARCH, the distribution may itself be time-


varying
variance is notconstant
r t ⌘ µ + t zt there's a random walk but the parameters
=µ+✏ , t ✏ ⇠ N (0, 2 )
t t
arealsotimedependent

©2021 Mende 14
Time series models
Another way to model causal influences is to have past values of the
random variable itself on the right hand side of a recursive definition.

§ Example: the AR(p) autoregressive model of order p: This is a random


<latexit sha1_base64="iRa4aCViHNLlbrteGCKZ18DXsQk=">AAACTHicbZDPTtwwEIdnty0sW9ouvXKxQJVA0ChBVeGChFQO5QaoC0ibVeQ4k8XCTlx7UnWJ9uX6Ftx76LW8QOtkOfBvJNs/f2PL1pcaJR2F4U2n++Llq4XF3lL/9fKbt+8GK8tnrqyswKEoVWkvUu5QyQKHJEnhhbHIdarwPL360vTPf6B1siy+0dTgWPNJIXMpOHmUDOLThNg+E0nItvwcsdOkpo/RzO9ikZXkWmzm2LTYyYnm7Dqh/jaLv1c8a3KDNYsJf1J9dHQ42wi3o81ksB4GYVvsaYjuwvpBAG0dJ4PfcVaKSmNBQnHnRlFoaFxzS1IonPXjyqHh4opPcORjwTW6cd1amLEPnmQsL60fBbGW3r9Rc+3cVKf+pOZ06R73Gvhcb1RRvjeuZWEqwkLMH8orxahkjVKWSYuC1NQHLqz0f2XiklsuyIvvx+1FZnKdYe4Cb8hriR5LeBrOdoLoc7Bz8gl6sAprsAER7MIBfIVjGIKAX/AH/sJt56bzr7swF9jtzFd4Dw+q2/sPtkGxIQ==</latexit>

causalrelationship
R t = c 0 + c 1 Rt + · · · + c p Rt + zt , zt ⇠ IID(0, 1)
1 p
error 2c
we are creating randomwalk with ARLp
§ Example: the ARMA(p,q) model combines both of the above:
<latexit sha1_base64="jkmfBupGV2IUj+2aab98Pl2vi4A=">AAACYnicbZHBa9swGMVld1uztFvTwk4bQ7SsDMaMXcbaS6HQy45ZWdpCHIwsf05EJFuRPpemJv9ne9+9/0GpYu+wJfvA0vPv6WHzlGopLIbhg+dvvHj5arPzuru1/ebtTm93+9KWleEw4KUszXXKLEhRwAAFSrjWBphKJVyl0/Olf3UDxoqy+IVzDSPFxoXIBWfoUNIzFwnSw1PKk5B+cWtEL5Iav0YL9xbzrETbYN1i3WArxorROxeM4+5hPJtVLFtyPREuf7eeb5xZ68wWSe8gDMJm6LqI/oiDs4A00096v+Os5JWCArlk1g6jUOOoZgYFl7DoxpUFzfiUjWHoZMEU2FHddLOgnxzJaF4a9xRIG/p3ombK2rlK3UnFcGJXvSX8nzesMD8Z1aLQFULB2w/llaRY0mXRNBMGOMq5E4wb4f6V8gkzjKO7jm7cBKnOVQa5DRBuXS3Ragnr4vIoiL4HRz+/kQ55T/bJZxKRY3JGfpA+GRBO7smTt+l1vEf/nf+hLdD32p3skX/G//gMVru2Lg==</latexit>

+ zt nThis is the innovationterm


R t = c 0 + c 1 Rt 1 + · · · + c p Rt p
only
contemporaries
+ 1 zt 1 + ··· + q zt q

§ Linear structure
§ Past observations determine likelihood of future outcomes
§ Coefficients to be determined
©2021 Mende 15
Time series models
The distribution of future outcomes can be determined using linearity,
recursion, and stationarity.
§ A time series process is stationary if the joint distribution of all of its constant distribution
values is invariant under time translation t ! t + s
§ It is weakly stationary if the first and second moments (i.e., means
and covariances) are invariant. All we need

To see how this works, let's solve for a special case in detail: AR(1)
<latexit sha1_base64="78K46cBNZNFjv1X9ixLDwjrBLZo=">AAACFnicbVDLThsxFL1Dgabh0cC2G6sIhIQYzUSoZYMUiQ3LEDUQKYlGHudOsLBnRvadqmGUP+Av+INu4QfYVey674fUmbCAwJHse3zOvbJ94lxJS0Hw11v6sLyy+rH2qb62vrH5ubG1fmGzwgjsikxlphdzi0qm2CVJCnu5Qa5jhZfx9enMv/yJxsos/UGTHIeaj1OZSMHJSVFjrxMR2zthIgrYgdtD1olKOgyn7jSwcqw5u3EdUWMn8IMK7C0Jn8lOy4cK7ajxbzDKRKExJaG4tf0wyGlYckNSKJzWB4XFnItrPsa+oynXaIdl9Z8p23XKiCWZcSslVqkvJ0qurZ3o2HVqTld20ZuJ73n9gpLjYSnTvCBMxfyipFCMMjYLh42kQUFq4ggXRrq3MnHFDRfkIqwPqkGWJ3qEifUJf7lYwsUQ3pKLph9+85vnR1CDL/AV9iGE79CCM2hDFwTcwm+4hwfvznv0/swDXPLmFbbhFbyn/6sen6g=</latexit>

R t = c 0 + c 1 Rt 1 + zt Demonstrate
Doesnot mean the outcomes arethe same
n means theyhave the same distribution

©2021 Mende 16

cc Theseries requires to waveourtime in thepast orfuture


to be stationary
Time series models
Solving AR(1)
§ Suppose that both t and t-1 lie in the future. Apply the (unconditional)
expectation operator to both sides of the equation
<latexit sha1_base64="Ch1cfiE1cSapYjlRjWc+tn1qFCk=">AAACdHicbVHPa9swFJa9dUuzbHV363oRC+sGY8YOo9ulUBiDHruw/IA4GFl5TkUk20jPpYnJrf9k7zvtr5js5pAmeyDp0/fep/f4lBRSGAyCB8d99vzgxcvWYftV5/WbI++4MzR5qTkMeC5zPU6YASkyGKBACeNCA1OJhFGy+FHnR7egjciz37gsYKrYPBOp4AwtFXv3/Rjp2QXlcUA/2z2k/bjCL+Ha3iIj5orRVYztKGpHQtmBwNDoZ2VF643K3priWtpkGvWW3JKrurx+Y7vRVnHsdQM/aILug3ADupc+aeI69v5Es5yXCjLkkhkzCYMCpxXTKLiEdTsqDRSML9gcJhZmTIGZVo1ba/rBMjOa5tquDGnDbisqpoxZqsRWKoY3ZjdXk//LTUpMv08rkRUlQsYfG6WlpJjT2no6Exo4yqUFjGthZ6X8hmnG0X6Q9bcW0iJVM0iNj3BnbQl3TdgHw54fnvu9X19Ji5yS9+QTCck3ckmuyDUZEE7+Op5z4rxzHfejuzHQdR5P8pY8CTf4B4YKuXg=</latexit>

Rt = c0 + c1 Rt 1 + zt
=) E [Rt ] = c0 E [1] + c1 E [Rt 1 ] + E [zt ]so
= c0 + c1 E [Rt 1 ] <latexit sha1_base64="YWfmfsQwLl3I8zdj8d3UUgBX/Zw=">AAACB3icbZDNSgMxFIXv+G+tWt24cBMsihuHmSLqRhBEcKlibaEtJZPe0WDmh+SOWIZ5C9/Arb6AO/Ep3PsgplMX/h0I+TgnlyQnSJU05HnvzsTk1PTM7Nx8ZaG6uLRcW6lemSTTApsiUYluB9ygkjE2SZLCdqqRR4HCVnB7PMpbd6iNTOJLGqbYi/h1LEMpOFmrX1vrnuQXfSrY1iFjJee04xdFv1b3XK8U+wv+F9SPXCh11q99dAeJyCKMSShuTMf3UurlXJMUCotKNzOYcnHLr7FjMeYRml5efqBgm9YZsDDRdsXESvf7RM4jY4ZRYE9GnG7M72xk/pd1MgoPermM04wwFuOLwkwxStioDTaQGgWpoQUutLRvZeKGay7IdlbploMsDaMBhsYlvLe1+L9L+AtXDdffcxvnuzAH67AB2+DDPhzBKZxBEwQU8AhP8Ow8OC/O67jACWe8wyr8kPP2CaN3m54=</latexit>

§ Stationarity means that E [Rt ] = E [Rt 1 ], and substituting above gives


the mean value in terms of the model parameters: <latexit sha1_base64="VnG4Avyy2crRHRzA8fin7EkYIMo=">AAACDnicbZDLSsQwFIZPvTveRreCBEVxY2lF1I0giOBSxVFhOpQ0c6rB9EJyKg6lO9/CN3CrL+BOfAP3PoiZjgtvP4T8/H8OSb4oV9KQ5707Q8Mjo2PjE5ONqemZ2bnm/PS5yQotsCUylenLiBtUMsUWSVJ4mWvkSaTwIro56PcXt6iNzNIz6uXYSfhVKmMpONkobC4Fh+VpSBVb22MsiDUXpQi9qvQ3ROhXbthc8VyvFvtr/C+zsu9CreOw+RF0M1EkmJJQ3Ji27+XUKbkmKRRWjaAwmHNxw6+wbW3KEzSdsv5HxVZt0mVxpu1KidXp94mSJ8b0ksieTDhdm99dP/yvaxcU73ZKmeYFYSoGF8WFYpSxPhTWlRoFqZ41XGhp38rENbcwyKJrBPUgy+Oki7FxCe8sFv83hL/mfNP1t93Nky2YgEVYhnXwYQf24QiOoQUC7uERnuDZeXBenNcBwCFnsMMC/JDz9gllvZ4i</latexit>

c0
E [Rt ] = . Dromedio
1 c1
§ For convenience and clarity, let's swap out these parameters for two
new ones,
c0ze
<latexit sha1_base64="wHLrYY2g9ZpIRij9W/sVQKabBVI=">AAACIHicbZDNSsQwFIVv/Xf8G926CYriQks7iLoZENy4VHB0YDqUNL3VYNJ2klQcyryGb+EbuNUXcKW49EHMdFzo6IWQwzm5N8kX5YJr43lvzsTk1PTM7Nx8bWFxaXmlvrp4qbNCMWyxTGSqHVGNgqfYMtwIbOcKqYwEXkW3J8P86g6V5ll6Yfo5diW9TnnCGTXWCuteIAuy3SQkSBRlJQu9QenvsdAf7JKg1ytoTAJhx8WUNMnQD+ubnutVRf4K/1tsHrtQ1VlY/wzijBUSU8ME1brje7npllQZzgQOakGhMafsll5jx8qUStTdsvrZgGxZJyZJpuxKDancnx0llVr3ZWRPSmpu9Hg2NP/LOoVJjrolT/PCYMpGFyWFICYjQ0wk5gqZEX0rKFPcvpWwG2oRGQuzFlSNJE9kjIl2Dd5bLP44hL/isuH6B27jfB/mYB02YAd8OIRjOIUzaAGDB3iCZ3hxHp1X530EcMIZ7bAGv8r5+AJ1lqRU</latexit>

random
process
µ= , = c1
1 c1

©2021 Mende 17
µ I Ci
c ulita
Rt Co tart I tote Cc
1
Rt relax X Rtttoes
Rt u uh X
Time series models Alm Rs 1 tree

In terms of these parameters, AR(1) can be written in this suggestive form:


X
explosives
reform
<latexit sha1_base64="kLq7LwyIR84bCAVr4BQwZFbDYWo=">AAACPHicbVDBThRBFHwDqLiirFy9dCAajO5khhjlgAmJFw8egLhAsr2Z9PS82e3QPTN0vzEsw/6Uf+Ef6FHj3RvhSO8sBwUreelKVVe6X6WVVo6i6EewsLh07/6D5YedRyuPn6x2n64curK2Evuy1KU9ToVDrQrskyKNx5VFYVKNR+nJh5l/9AWtU2XxmSYVDo0YFSpXUpCXku6ng4R63NTsxXvW49oHM8E15rR5kDTUi6czk1s1GtNL9opxp0ZGsPOEXnf46WktMnZxk7rYiZPuRhRGLdhdEt+Qjd0QWuwl3d88K2VtsCCphXODOKpo2AhLSmqcdnjtsBLyRIxw4GkhDLph0249Zc+9krG8tH4KYq36d6IRxrmJSf1NI2jsbnsz8X/eoKZ8e9iooqoJCzl/KK81o5LNKmSZsihJTzwR0ir/VybHwgpJvugOb4Osyk2GuQsJz3wt8e0S7pLDrTB+G27tv4FleAbrsAkxvINd+Ah70AcJX+E7/IRfwbfgT3A5L3AhmJ+wBv8guLoGQ+Sv8A==</latexit>

Rt µ= (Rt 1 µ) + zt , | |<1 noes


This model is often used to model mean reversion.
§ The change in the random variable relative to its mean µ is related to
the previous period's deviation from the mean.
Ii
§ For positive values of the coefficient λ, an excess value in one period
leads to a change in the opposite direction, toward the mean, in the
following period.
§ The variance can also be computed from stationarity, as can the
lagged autocovariances.

AR p was ACF Autocovariancetraction

©2021 Mende 18
Explain autocov

Time series models


To solve for the variance, substitute in the "equation of motion" and
expand: <latexit sha1_base64="PUMTDs5aZOChjYiaPeL06lAQqiM=">AAACdnicbVFNb9QwFHRSPkoodOm1HCwq0FZooyRCLRekSgiJY4vYbaV1Gr04ztaqnUT2C2KJ9tr/2DtHfgTe7LZAy5Msj+fN+FnjvFHSYhRde/7Gg4ePHm8+CZ5uPXu+PXixNbF1a7gY81rV5iwHK5SsxBglKnHWGAE6V+I0v/y47J9+E8bKuvqK80akGmaVLCUHdFQ2uGIz0BqyiH6gbAJm+iXDNHjjDp+6ocMjptv982QRMObY4Ygpd3cBjlorOhzFixsVfUuZlTMN54nr/sjw1knXxqXvZuIfcZAN9qIw6oveB/Ea7B2FpK/jbPCTFTVvtaiQK7B2GkcNph0YlFwJN7S1ogF+CTMxdbACLWza9Xkt6GvHFLSsjVsV0p7929GBtnauc6fUgBf2bm9J/q83bbF8n3ayaloUFV8NKltFsabL8GkhjeCo5g4AN9K9lfILMMDRfVHAeiNtSl2I0oYovrtY4rsh3AeTJIwPwuTkHdkku+QVGZKYHJIj8pkckzHh5Je34+16L/0Nf9+PVgH63monO+Sf8pPfYBq6zw==</latexit>

⇥ ⇤
0 = Var[Rt ] = E (Rt µ)2
⇥ ⇤ ⇥ ⇤
=( )2 E (Rt 1 µ)2 + 2
E zt2
2 2
= 0 +
<latexit sha1_base64="WCl3pujqD6yYGA1Jr+3sUGO3rbk=">AAAB8XicbVDLSgNBEOyN7xg1evUyGARPy24Q9Rjw4jGiUSFZwuykNxky+2CmV4wh/oFX/QFv4gd590OcbDxoYsHQRVU33VNhpqQhz/t0SkvLK6tr6xvlzcrW9k51t3Jj0lwLbIlUpfou5AaVTLBFkhTeZRp5HCq8DYfnU//2HrWRaXJNowyDmPcTGUnByUpXj13qVmue6xVgi8T/IbWGCwWa3epXp5eKPMaEhOLGtH0vo2DMNUmhcFLu5AYzLoa8j21LEx6jCcbFqRN2aJUei1JtX0KsUH9PjHlszCgObWfMaWDmvan4n9fOKToLxjLJcsJEzBZFuWKUsum/WU9qFKRGlnChpb2ViQHXXJBNp9wpBlkWxT2MjEv4YGPx50NYJDd11z9x65fHsA77cABH4MMpNOACmtACAX14hhd4dZ6cN+d9FmDJmVXYgz9wPr4BSHuUcw==</latexit>

since the cross term drops out due to independence of the zt


<latexit sha1_base64="BMgNa75Rb13DZtQV0RBgxB1hwT8=">AAACCHicbZDNattAFIWv0p+4rts6XRW6GRIK7sJCCqXNJhAogS7dEtsBS4jR6CoZPCOJmasQV7hv0TfItn2B7EJfovs+SMdyFqnTA8N8nDOXmTlppaSlIPjtbT14+OjxdudJ92nv2fMX/Z3exJa1ETgWpSrNacotKlngmCQpPK0Mcp0qnKbzj6t8eoHGyrI4oUWFseZnhcyl4OSspP8qOm6+JjT4kjQ0nC+Hka7fLtkhC5L+XuAHrdh9CG9h78iHVqOk/yfKSlFrLEgobu0sDCqKG25ICoXLblRbrLiY8zOcOSy4Rhs37Q+W7I1zMpaXxq2CWOvenWi4tnahU3dSczq3m9nK/F82qyk/iBtZVDVhIdYX5bViVLJVHSyTBgWphQMujHRvZeKcGy7IldaN2kFW5TrD3PqEl66WcLOE+zDZ98P3/v7nd9CB17ALAwjhAxzBJxjBGAR8gyv4AT+97961d7MucMtb7/AS/pH36y+G9ZwW</latexit>

from all earlier-time values, E [zt (Rt k µ)] = 0


Therefore

2 Proportional to 82
0 = 2
1

©2021 Mende 19
Time series models
Now consider the covariance of observations taken at two different times.
From stationarity, it depends on k only, not t.

k = E [(Rt µ)(Rt k µ)]


= E [(Rt 1 µ)(Rt k µ)] 1114 dieoff
= k 1 shocks

onlymatters how 170


So for any k > 0 far apart
time
<latexit sha1_base64="pTbMnEBaSRBimHExoI0GtZgkeXM=">AAACPXicbVDLTtwwFL2hvBpeQ7fdWKAiWBAlIwRsRkLqhg0SlTqANBlGN87NYI2dRLaDGEXzVf2L/gHbwgd0V3VXTwYkHj2S5eNz7pHtk5RSGBuG997ch/mFxaXlj/7K6tr6Rmtz9cIUlebU5YUs9FWChqTIqWuFlXRVakKVSLpMRl+n/uUtaSOK/Lsdl9RXOMxFJjhaJw1aZ348RKVwMGI7Hebv7sfShVPcux49GaHfYXGmkdcvzUkdPZ+u25PYiKFyZNDaDoOwAXtPoieyfRJAg/NB6zFOC14pyi2XaEwvCkvbr1FbwSVN/LgyVCIf4ZB6juaoyPTr5tsT9sUpKcsK7VZuWaO+TNSojBmrxE0qtDfmrTcV/+f1Kpsd92uRl5WlnM8uyirJbMGmHbJUaOJWjh1BroV7K+M36Cqyrmk/boKszFRKmQks3blaorclvCcX7SA6DNrfDmAZPsMW7EIER3ACp3AOXeDwA+7hFzx4P73f3p9ZgXPebIdP8Are33/xia+8</latexit>

k ( )k 2
they're in
=( ) =
k 0
1 2 AE o

This is known as the lag-k autocovariance coefficient. It relates the


t
influence of an excess return value at one point in time with values k
periods in the past.

©2021 Mende 20
Time series models
§ Summary
§ Linear time series models can be constructed out of standard random
variables, lagged observations, and constant coefficients.
§ They can exhibit temporal correlations useful in modeling the
propagation of information and influence over time.
§ An example is the AR(1) model, used for mean reversion:
<latexit sha1_base64="7PZhGpc1dpyU/lxVvbI6jpwKKH8=">AAACKHicbVBNT9wwFHyBltLla+HKxQIVUaGNkhUqXJCQuHAExALSZhU5zsuuhZ1E9gtiifav8C/4B1zbe9Ub4ofUm+2hhY705NGMR/abpFTSUhD89ObmP3xc+LT4ubW0vLK61l5fvrJFZQT2RKEKc5Nwi0rm2CNJCm9Kg1wnCq+T25Opf32Hxsoiv6RxiQPNh7nMpODkpLh9eBFTJ9IV2zlinUi5YMojhRntXsQ1dcLJ1IyMHI7oK9tjkZVDzdlDTHF7O/CDBuw9Cf+Q7WMfGpzF7dcoLUSlMSehuLX9MChpUHNDUiictKLKYsnFLR9i39Gca7SDutlwwr44JWVZYdzkxBr170TNtbVjnbibmtPIvvWm4v+8fkXZ4aCWeVkR5mL2UFYpRgWb1sVSaVCQGjvChZHur0yMuOGCXKmtqAmyMtMpZtYnvHe1hG9LeE+uun74ze+e78MibMIW7EIIB3AMp3AGPRDwCM/wHX54T94v72VW4Jw3O2ED/oH3+hvmRKhM</latexit>

Rt µ= (Rt 1 µ) + zt

§ By applying weak stationarity, which is the assumption that first and


second moments of distributions are invariant in time, models can be
solved in terms of their basic parameters.
- Unconditional expectations are taken with respect to future values
- Conditional expectations, taken at a fixed point in time, treat past
observations as known values rather than as random variables.

©2021 Mende 21

expected
Future is unconditional Past is conditional to info at time t
Eeleen o varixt 0
Ee pixe 0Mt vartleen de
Instead of computingpropertiesof a distribution
like meanvariance against a PDF we're doing
against empirical data

Monte Carlo simulation

©2021 Mende 22
Monte Carlo simulation
Use random number generators to simulate stochastic process
§ This provides a test lab, with "best case" data since it comes from a
known distribution
§ Typically generate an ensemble with a large number of hypothetical
realizations of a financial process or market
§ Approximate exact results by computing statistics over the ensemble.
- Results become more precise as simulation size increases
- Numerical results exist even when close-form results do not
- Testbed for code and algorithms designed for real-world data

§ Applications:
§ Asset price dynamics
§ Option pricing
§ Portfolio and risk management

©2021 Mende 23
Monte Carlo simulation
Most computer languages include functions to generate individual random
numbers from various distributions. The R language includes these:

§ sample – returns discrete values with specified probabilities


§ runif – returns real number uniformly distributed on [0,1]
§ rnorm – returns real number with normal distribution of mean zero,
variance one

§ Note that they are not truly random, since the machine is deterministic,
and also are just approximations to the distribution. For instance, range
of rnorm (approximation to Gaussian) is bounded, and Prob(X = 1/2) for
runif (approximation to uniform) is non-zero.

Theyhave limits i There may be events sina.tw areEIiy

©2021 Mende 24
R Monte Carlo
Rescale these functions to get useful ranges, e.g.,

z <- matrix(runif(Nt*Np),nrow=Nt) Generates Nt x Np independent


pseudo-random draws

x <- sign(p-z) Generates +1 with probability p


and -1 with probability 1-p Zero notallowed

u <- (x+1)/2 Generates +1 with probability p


and 0 with probability 1-p

r <- Generates Nt x Np independent


matrix(rnorm(Nt*Np,mean=mu,sd=sigma),nrow=Nt) pseudo-random draws with mean
mu and standard deviation sigma

Generate sequences S
S <- exp(apply(r,2,cumsum)) corresponding to lognormal
distribution
timedirection

©2021 Mende 25
Simple 20-step random walk
p <-
0.5;q <- 1-p; # Set probability of "success" and "failure"
Nt <-
20; # Number of time steps
Np <-
1; # Number of sample paths
z <-
matrix(runif(Nt*Np),nrow=Nt)
a
# Generate a set of uniform random draws
x <-
sign(p-z); # Transform to binomial random variable +/- 1
s <-
matrix(0,Nt+1,Np) # Initial value for random walk.
# Note that R indices start with 1,not zero.
for (t in 1:Nt) {
s[t+1,] <- s[t,]+x[t,] # New location equals previous plus a new random step
}
plot(s,type="b") # Plot resulting path

©2021 Mende 26
Many simulations of a one-year daily walk
Nt <- 252; # Number of trading days in a year
Np <- 1e4; # Reasonably large number of simulations
z <- matrix(runif(Nt*Np),nrow=Nt) # Generate a set of uniform random draws
x <- sign(p-z); # Transform to binomial random variable +/- 1
s <- matrix(0,Nt+1,Np) # Initialize and reserve space for random paths.
for (t in 1:Nt) {
s[t+1,] <- s[t,]+x[t,] # New location equals previous plus a new random step

9
}
matplot(s[,1:3],type="b") # Plot a few of the resulting paths

Path I hi
2
Path

Path 3

©2021 Mende 27
Application: asset price dynamics
Asset prices are often modeled as lognormal variables, i.e., where their
continuously compounded (log) returns are drawn from a normal
distribution

2 rt
rt = log(Pt /Pt 1) ⇠ N (µ, ), Pt = Pt 1e ,
rt +rt 1 recursive
= Pt 2e ,...
<latexit sha1_base64="uxPYYMOYmpmz/Qs3Bxa7UOh0EvU=">AAACinicbVFdb9MwFHXC1wiDdbzwwIvFtKlVS5aESfBSaRII8YSKRLdJdRc5jtNZs+PMvkGrovwR/hnv/BCctA+wcSXLx+eeY1vnZpUUFqLol+c/ePjo8ZOdp8Gz3ecv9gb7u2dW14bxOdNSm4uMWi5FyecgQPKLynCqMsnPs+uPXf/8BzdW6PI7rCu+VHRVikIwCo5KBz9NClMi9Wo4S+F4ljbwNm5HmFihGsKoxF/bIVH1xBErRS+T0YTc3NQ0x4HTH023Bn7ZuHvaCQ4ICbZssmXHZqNpJ0TmGmwnOew0ESb8thqaNMZjbNIEjwnrBP0JRkE6OIjCqC98H8RbcHAaor5m6eA3yTWrFS+BSWrtIo4qWDbUgGCStwGpLa8ou6YrvnCwpIrbZdNn2OJDx+S40MatEnDP/u1oqLJ2rTKnVBSu7N1eR/6vt6ih+LBsRFnVwEu2eaioJQaNu4HgXBjOQK4doMwI91fMrqihDNzYAtIbcVWonBc2BH7rYonvhnAfnCVh/C5Mvp2gHfQavUFDFKP36BR9QTM0R8xD3pF37EX+K3/qf9oE6HubHb1E/5T/+Q+duMLF</latexit>

So over T periods, the sum of log returns is Gaussian, and the price is a
function of that sum:
assuming
our
trials
we're
Po 1
PT = P9
0e
r(T )
= P0 exp(r1 + r2 + · · · + rT ) randomvariables
2
r(T ) = r1 + r2 + · · · + rT ⇠ N (T µ, T )
<latexit sha1_base64="YTWr+MJRquHQVXCGE5J7+KHwDMw=">AAACZnicdVFda9swFJW9j7ZutmV7K325tGwkdBg7K2wvhUJf+lQycNpClBpZvk5FJdtIcmkw+aGDPvYf9A9UcfawtdsFoXPPPYcrjrJaCmOj6Jfnv3r95u3G5law3Xv3/kP/Y+/cVI3mOOGVrPRlxgxKUeLECivxstbIVCbxIrs5Wc0vblEbUZWJXdQ4U2xeikJwZh2V9m/HaQJfjsZphFetHiTDJRyB64DiXT3QaQwHoNMRHFCeV9Z0XTIMKA1WYueE/2iAGqFaypmEs+Ugoar5mjhqrtjVaBik/f0ojLqClyD+DfaPQ9LVOO0/0LzijcLScsmMmcZRbWct01ZwicuANgZrxm/YHKcOlkyhmbVdPkv47Jgcikq7U1ro2D8dLVPGLFTmlIrZa/N8tiL/NZs2tvgxa0VZNxZLvl5UNBJsBauwIRcauZULBxjXwr0V+DXTjFv3JQHtjFAXKsfChBbvXCzx8xBegvNRGH8LRz8PySbZJXtkQGLynRyTUzImE8LJved7217Pe/R3fFgH6Hvrm3wif5W/9wRIEbQ/</latexit>

©2021 Mende 28
Simulating a lognormal price process
1. Determine parameters for underlying distribution

2. Scale parameters appropriately for sampling interval

3. Draw random numbers from standard normal distribution Computebased

4. Generate simulated returns for each time period

5. Construct ensemble of price paths

6. Compute and plot appropriate analytics and curves

©2021 Mende 29
Simulating a lognormal price process
sigma <- 0.3 # Set annualized volatility to 30%
mu <- 0.1 # Set annualized drift/return to 10%
dt <- 1/252 # Set time step scale factor to one day, (252 trading days per year)
z <- matrix(rnorm(Nt*Np),nrow=Nt) # Generate a set of standard normal random draws
r <- mu*dt + z*sigma*sqrt(dt) # Draw daily return from scaled N(mu,sigma^2)
r <- matrix(rnorm(Nt*Np, mean=mu*dt, sd=sigma*sqrt(dt)),nrow=Nt) # 1-step generation
s <- matrix(0,Nt+1,Np)
for (t in 1:Nt) {
s[t+1,] <- s[t,] + r[t,]
}
P <- exp(s)
matplot(P[,1:3],type="l")

©2021 Mende 30
Simulating a lognormal price process
> R <- P[Nt+1,] – 1

> mean(R)
[1] 0.1547869
> exp(mu+sigma^2/2)-1
[1] 0.1560396

> sd(R)
[1] 0.3563872
> sqrt(exp(2*mu+sigma^2)*(exp(sigma^2)-1))
[1] 0.3547634

hist(R,breaks=50)
hist(log(1+R))
plot.ecdf(1+R)
barplot(sort(1+R))
qqnorm(1+R)

R = PT /P0 1
h i 2
r(T )
E [R] = E e 1 = eµ+ /2
1
⇣ 2 ⌘
2µ+ 2
Var(R) = e e 1
©2021 Mende 31
Simulating a lognormal price process
> R <- P[Nt+1,] – 1

> mean(R)
[1] 0.1547869
> exp(mu+sigma^2/2)-1
[1] 0.1560396

> sd(R)
[1] 0.3563872
> sqrt(exp(2*mu+sigma^2)*(exp(sigma^2)-1))
[1] 0.3547634

hist(R,breaks=50)
hist(log(1+R))
plot.ecdf(1+R)
barplot(sort(1+R))
qqnorm(1+R)

R = PT /P0 1
h i 2
r(T )
E [R] = E e 1 = eµ+ /2
1
⇣ 2 ⌘
2µ+ 2
Var(R) = e e 1
©2021 Mende 32
Simulating a lognormal price process
> R <- P[Nt+1,] – 1

> mean(R)
[1] 0.1547869
> exp(mu+sigma^2/2)-1
[1] 0.1560396

> sd(R)
[1] 0.3563872
> sqrt(exp(2*mu+sigma^2)*(exp(sigma^2)-1))
[1] 0.3547634

hist(R,breaks=50)
hist(log(1+R))
plot.ecdf(1+R)
barplot(sort(1+R))
qqnorm(1+R)

R = PT /P0 1
h i 2
r(T )
E [R] = E e 1 = eµ+ /2
1
⇣ 2 ⌘
2µ+ 2
Var(R) = e e 1
©2021 Mende 33
Simulating a lognormal price process
> R <- P[Nt+1,] – 1

> mean(R)
[1] 0.1547869
> exp(mu+sigma^2/2)-1
[1] 0.1560396

> sd(R)
[1] 0.3563872
> sqrt(exp(2*mu+sigma^2)*(exp(sigma^2)-1))
[1] 0.3547634

hist(R,breaks=50)
hist(log(1+R))
plot.ecdf(1+R)
barplot(sort(1+R))
qqnorm(1+R)

R = PT /P0 1
h i 2
r(T )
E [R] = E e 1 = eµ+ /2
1
⇣ 2 ⌘
2µ+ 2
Var(R) = e e 1
©2021 Mende 34
Allowustocompare
QQslots
l distributions

Simulating a lognormal price process y


> R <- P[Nt+1,] – 1

> mean(R)
[1] 0.1547869
> exp(mu+sigma^2/2)-1
[1] 0.1560396

> sd(R)
[1] 0.3563872
> sqrt(exp(2*mu+sigma^2)*(exp(sigma^2)-1))
[1] 0.3547634

hist(R,breaks=50)
hist(log(1+R))
plot.ecdf(1+R)
barplot(sort(1+R))
qqnorm(1+R)

R = PT /P0 1
h i 2
r(T )
E [R] = E e 1 = eµ+ /2
1
⇣ 2 ⌘
2µ+ 2
Var(R) = e e 1
©2021 Mende 35
Simulating an AR(1) process Re re
lambda <- 0.4; mu <- 0.1 # Set mean-reversion strength and drift
R <- matrix(0,Nt,Np) # Reserve space for sample processes
epsilon <- matrix(rnorm(Nt*Np,sd=sigma*sqrt(dt)),nrow=Nt) # Simulate noise
for (t in 2:Nt)
{ # Run simulation process forward in time
R[t,] <- (1+lambda)*(mu*dt) - lambda*R[t-1,] + epsilon[t,]
}
r <- log(1+R) # Interpret R as simple return, r as continuous return
acf(R[,1]) # Show autocorrelation coefficients as function of lag

©2021 Mende 36
Simulating an AR(1) process
lambda <- 0.4; mu <- 0.1 # Set mean-reversion strength and drift
R <- matrix(0,Nt,Np) # Reserve space for sample processes
epsilon <- matrix(rnorm(Nt*Np,sd=sigma*sqrt(dt)),nrow=Nt) # Simulate noise
for (t in 2:Nt)
{ # Run simulation process forward in time
R[t,] <- (1+lambda)*(mu*dt) - lambda*R[t-1,] + epsilon[t,]
}
r <- log(1+R) # Interpret R as simple return, r as continuous return
acf(R[,1]) # Show autocorrelation coefficients as function of lag

©2021 Mende 37
Monte Carlo Methods
Summary
§ Monte Carlo sampling uses computer random number generators to
simulate data that follows a given model, process, or distribution

§ Simulations provide an idealized testing environment for theory,


statistics, and financial analytics. They provide a "best case" setting
since
- The "true" data-generating process is rarely known, if it even exists
- Real financial history happens only once and can never be repeated

§ Asset price paths are simulated by drawing successive period returns


from chosen distributions.
- Closed-form analytics are replaced by statistical approximations.
- Results are subject to sampling error, machine limitations.
- Advanced techniques can greatly improve efficiency and accuracy.

©2021 Mende 38
Testing the Random Walk

©2021 Mende 39
A random walk down Wall Street
Do stock prices follow random walks?
§ Model for returns drawn from lognormal distribution

Xt = Xt 1 + rt , Xt ⌘ log Pt /P0 , rt = Xt Xt 1 = log Pt /Pt 1


2
rt = µ + ✏ t , ✏t = zt ⇠ N (0, )

§ More generally, random shocks could be IID, drawn from other


distributions

©2021 Mende 40
Random walks, efficient markets, and the real world
How do stock prices behave?
How should stock prices behave?

§ Deterministic?
§ Noisy?
§ Random?

§ Are markets efficient?


§ Are asset prices predictable?

These are empirical questions.


Let's look at the data.

©2021 Mende 41
Model predictions
Two-parameter model, as written, holds for all time periods with same
parameter values.
<latexit sha1_base64="Vt3geqAofRJNIXUYYMEysSVNkrU=">AAACBnicbZDNSsQwFIVv/Xf8G124cRMUQRBKK6JuBMGNSwVnRpgOJc3cjsGkLcmtOI4+hW/gVl/AnfgW7n0QMx0X/h0IOZyTSy5fUihpKQjevbHxicmp6ZnZ2tz8wuJSfXm+afPSCGyIXOXmIuEWlcywQZIUXhQGuU4UtpKr42HfukZjZZ6dU7/Ajua9TKZScHJRXF81MbFDFumSbbPIyp7m7DamuL4R+EEl9teEX2bjyIdKp3H9I+rmotSYkVDc2nYYFNQZcENSKLyvRaXFgosr3sO2sxnXaDuDav97tumSLktz405GrEq/Twy4travE/dSc7q0v7th+F/XLik96AxkVpSEmRh9lJaKUc6GMFhXGhSk+s5wYaTblYlLbrggh6wWVYOsSHUXU+sT3jgs4W8If01zxw/3/J2zXZiBNViHLQhhH47gBE6hAQLu4BGe4Nl78F681xHAMW90wwr8kPf2Cfqtm0U=</latexit>

rt = µ + zt

So re-estimation in different periods or with different data should yield same


parameter values. How significant are variations?
Model predicts aggregation properties over time.
§ Scaling relationships
§ Case study: Tootsie Roll (TR)
- Founded: 1896
- Found by reddit: 2020
- "How many licks?"

©2021 Mende 42
Testing the random walk
§ Scaling behavior
§ Variance ratio test
§ Frequency-dependence
§ Long-range behavior
§ Alternative models
§ Serial correlation
§ Implications for market efficiency

©2021 Mende 43
Exploratory data analysis
In the case of Tootsie Roll, a quick plot of the return series appears to show non-constant
variance.

©2021 Mende 44
Exploratory data analysis
> summary(tr) # Summary of imported Yahoo data for TR
Summarize vital statistics Min.
Date
:1987-12-30 Min.
Open
:19.55 Min.
High
:19.66 Min.
Low
:19.00
§ Length of series 1st Qu.:1995-04-03
Median :2002-07-18
1st Qu.:28.95
Median :33.00
1st Qu.:29.17
Median :33.26
1st Qu.:28.64
Median :32.61
§ Max, min, sum, mean, std. deviation, Mean :2002-07-18
3rd Qu.:2009-10-29
Mean :38.72
3rd Qu.:42.00
Mean :39.07
3rd Qu.:42.50
Mean :38.37
3rd Qu.:41.75
etc. Max. :2017-02-15 Max. :83.50 Max. :84.50 Max. :82.50
Close Volume Adj Close
§ Example: Tootsie Roll (TR): mean return Min. :19.46 Min. : 0 Min. : 2.587
and volatility: 8.5% and 24.4% 1st Qu.:28.94 1st Qu.: 34800 1st Qu.: 8.797
Median :32.94 Median : 68300 Median :19.457
Histogram Mean :38.74 Mean : 90813 Mean :17.417
3rd Qu.:42.12 3rd Qu.: 114750 3rd Qu.:22.523
§ Useful for returns, not prices (Why?) Max. :83.75 Max. :5819300 Max. :41.550

> P <- tr$`Adj Close` # Define price using split&div adjusted values
> N <- length(P); N
[1] 7342
> r <- diff(log(P)) #Define log returns from successive daily prices
> summary(r)
Min. 1st Qu. Median Mean 3rd Qu. Max.
Normal? -0.1527000 -0.0078470 0.0000000 0.0003375 0.0082100 0.1726000
Symmetric?
> mean(r)*252 # Mean return for TR (annualize by 252 days/year)
[1] 0.08506148
> sd(r)*sqrt(252) # Volatility of TR (annualize with square root!)
[1] 0.2442396
> hist(r, breaks=50)

©2021 Mende 45
Flavors of Random Walk
RW1: IID – Independent and identically distributed increments (or
"innovations")
2 2
Xt = Xt 1 + µ + ✏t , ✏t ⇠ IID(0, ), E[✏t ✏t0 ] = tt0
E[Xt |X0 ] = X0 + µt,
2
Var(Xt |X0 ) = t

RW2: INID – Independent but non-identically distributed increments


§ For example, each day's return is independently lognormal, but volatility
parameter varies each day.

RW3: Dependent, non-identical innovations, but increments are


uncorrelated
§ For example, volatility clustering modeled with correlated squares of
increments
E[✏t ✏t0 ] = 0, E[✏2t ✏2t0 ] 6= 0, t 6= t0
©2021 Mende 46
Variance ratios
§ Start with returns at some base frequency (weekly, daily, hourly, etc.)

§ Aggregate to form time series of 2-period, 3-period, q-period returns with


common terminal observation
q
X
(2) (q)
rt = rt + rt 1 = log(Pt /Pt 2 ), rt = rt i+1 = log(Pt /Pt q)
i=1

§ If returns are uncorrelated, then variance computed from each series is


proportional to its length
(q)
Var(rt ) = qVar(rt )

§ Therefore test whether or not the variance ratio


(q)
Var(rt )
=1
qVar(rt )

©2021 Mende 47
Variance and ratios

Variance <- var(diff(log(P)))


Random walk model predicts that variance
has simple linear scaling with sampling for (n in 2:100) {
Variance[n] <- var(diff(log(P[seq(from=n, to=N, by=n)])))
interval }
§ Example: Tootsie Roll data set 1988- plot(Variance,xlab="n",main="Variance of Returns From n-day
2017 from Yahoo Finance Observations");grid()

- Close to linear?
- Close enough?

©2021 Mende 48
Variance ratio estimators and data

§ Need to match length of time series 1X


b=
µ rt ,
T
1X
§ Longer base periods have fewer 2
ba = (rt b)2
µ
contributions T
2 1X
bb (q) = (rt µ) 2
qb
§ Asymptotic distribution to determine T
expected size of deviations from unity p
T bb2 (q) 2
⇠ N (0, q 4
)
§ Bias corrections
nq
1 X
§ Overlapping returns bc2 (q) = (log(Stk /Stk q ) µ) 2 ,
qb
qT
k=q

T = nq

©2021 Mende 49
Variance ratio test
Test performed to see if ratio equals one

ˆb2 (q) p ⇣ ⌘
d
V R(q) = , T VdR(q) 1 ⇠ N (0, 2(q 1))
qˆa2

Define test statistic to have normalized distribution of deviations under null

s
T ⇣ ⌘
z(q) = d
V R(q) 1 ⇠ N (0, 1)
2(q 1)

©2021 Mende 50
Variance ratio tests: as easy as a, b, c…

Definitions refined to improve power,


remove bias, and enable comparison of 1
µ̂ ⌘ (XT X0 )
multiple window sizes. T
T
2 1X
§ Initially consider T = nq + 1 sequential ˆa ⌘ (Xt Xt 1 µ̂)2
T t=1
observations and group them q at a
nq
time for q-period windows. 1 X
ˆb2 (q) ⌘ (Xqk Xqk q q µ̂)2
nq
k=1
§ Final form uses overlapping windows, nq
which improves power. 1 X
ˆc2 (q) ⌘ (Xt Xt q q µ̂)2
nq 2 t=q

©2021 Mende 51
variance.c <- function(X, q) {

Variance and ratios # Compute variance statistic from overlapping q-period windows
# See Lo & MacKinlay (1988), p. 47, Eq. 12

T <- length(X) - 1
mu <- (X[T+1] - X[1])/T
§ Lo and MacKinlay add further m <- (T-q)*(T-q+1)*q/T
refinements and consider whether sumsq <- 0
variance ratios over different q-day for (t in q:T) {
sumsq <- sumsq + (X[t+1] - X[t-q+1] - q*mu)^2
window sizes are statistically identical }
return(sumsq/m)
}
§ The idea is to construct a sampling
statistic z(q) that follows a standard z <- function(X, q) {
Normal distribution if the random walk # Compute sampling statistic for variance ratio
hypothesis holds. # See Lo & MacKinlay (1988), p. 47, last line (after Eqs. 12-14)
T <- length(X) - 1
c <- sqrt(T*(3*q)/(2*(2*q-1)*(q-1)))
§ Large values of z(q) are unlikely. The p- M <- variance.c(X,q)/variance.c(X,1) - 1

value gives the probability of observing a z <- c*M


return(z)
value at least as large. }

Vc <- 0; for (q in 1:100) {Vc[q] <- variance.c(log(P),q)}


zstats <- 0; for (q in 2:100) {zstats[q] <- z(log(P),q) }
pValues <- 2*pnorm(-abs(zstats))
barplot(zstats)

©2021 Mende 52
Variance ratio test
Bias correction and improved statistics from overlapping terms

ˆc2 p
¯c2= , nq V R(q) 1 ⇠ N (0, 2(2q 1)(q 1)/3q)
(1 1/n + 1/nq)(1 1/n)
s
p 3q
z(q) = nq V R(q) 1
2(2q 1)(q 1)

©2021 Mende 53
Variance ratio test

§ Evaluation for stocks, indices


§ Period and frequencies
§ Baseline reference period
§ Data presentation

©2021 Mende 54
Variance and ratios

Random walk model predicts that volatility > sigma <- sqrt(252)*sd(diff(log(P)))
has square-root scaling with sampling > for (n in 2:100) {
interval sigma[n] <- sqrt(252/n)*sd(diff(log(P[seq(from=n, to=N, by=n)])))
}> barplot(sigma,xlab="n",ylab="Standard Deviation (annualized) /
Example: Tootsie Roll 1988-2017 sqrt(n)",main="Volatility Scaling of Returns From n-day
Observations");grid()
Let's present data so that it appears
constant if the model is correct:
§ Compute annualized volatility from
every day, every other day, every third
day, etc.
§ Divide each volatility by sqrt(n)
§ Does the data support the model? How
significant are the variations?

©2021 Mende 55
Variance and ratios
> P.MC <- exp(cumsum(rnorm(N)*0.02)) # Monte Carlo returns 32% vol
How significant are the variations? > sigma.MC <- sqrt(252)*sd(diff(log(P.MC)))

§ Quick & dirty visualization: compare > for (n in 2:100) {


sigma.MC[n] <- sqrt(252/n)*sd(diff(log(P.MC[seq(from=n, to=N,
with simulated price path from a pure by=n)])))
random-walk process that is subject }
> barplot(sigma.MC,xlab="n",ylab="Standard Deviation (annualized) /
to statistical error sqrt(n)",main="Volatility Scaling of Returns From n-day
Observations");grid()
§ How can we minimize statistical error?
How do we identify departures that
violate the model's expected
behavior?

©2021 Mende 56
Testing the Random Walk
Summary
§ The random walk model predicts that variances scale linearly with
time.

§ The variance ratio test of Lo & MacKinlay analyzes how variances


scale as the observation frequency changes. It can be applied to
individual stocks, portfolios of stocks, or dynamic trading strategies
– anything with an empirical time series of returns.

§ The test is not dependent on the distribution of returns, only their


independence. It has been refined to handle other complexities.

§ Rejecting the random walk opens new questions


- Is there a better model? Or no model at all?
- In what sense, if any, are markets efficient?
- Are asset prices predictable?

©2021 Mende 57
References
§ Books
§ Campbell, Lo, and MacKinlay (1977) – "Econometrics of Financial Markets," Princeton
§ Feller, William (1968) – "Introduction to Probability and Its Applications (3rd ed.)," Wiley
§ Glasserman, Paul (2004) – "Monte Carlo Methods in Financial Engineering," Springer
§ Tsay, Ruey S. (2010) – "Analysis of Financial Time Series (3rd ed.)," Wiley

§ Articles
§ Fama, Eugene (1965) – "Random Walks in Stock Market Prices," Financial Analysts Journal,
Vol. 21, No. 5, pp. 55-59
§ Samuelson, Paul. (1965) – "Proof that Properly Anticipated Prices Fluctuate Randomly,"
Industrial Management Review, 6:2, 41-49
§ Lo, Andrew W. & A. Craig MacKinlay (1988) – "Stock Market Prices do not Follow Random
Walks: Evidence from a Simple Specification Test," Review of Financial Studies, Vol. 1, No. 1
(Spring, 1988), pp. 41-66

©2021 Mende 58

You might also like