{"id":4618,"date":"2022-11-04T17:06:11","date_gmt":"2022-11-04T09:06:11","guid":{"rendered":"https:\/\/fanyuzhao.com\/?p=4618"},"modified":"2022-11-07T12:22:45","modified_gmt":"2022-11-07T04:22:45","slug":"simulating-geometric-brownian-motion-gbm","status":"publish","type":"post","link":"https:\/\/fanyuzhao.com\/?p=4618","title":{"rendered":"Simulating Geometric Brownian Motion (GBM)"},"content":{"rendered":"\n<div class=\"wp-block-file\"><a id=\"wp-block-file--media-a112eddd-4bca-459d-808d-65dea7f84f0a\" href=\"https:\/\/fanyuzhao.com\/wp-content\/uploads\/2022\/11\/Simulating-Geometric-Brownian-Motion-GBM.html\">Simulating-Geometric-Brownian-Motion-GBM<\/a><a href=\"https:\/\/fanyuzhao.com\/wp-content\/uploads\/2022\/11\/Simulating-Geometric-Brownian-Motion-GBM.html\" class=\"wp-block-file__button\" download aria-describedby=\"wp-block-file--media-a112eddd-4bca-459d-808d-65dea7f84f0a\">Download<\/a><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>Here is a realisation of the previous blog, <a href=\"https:\/\/fanyuzhao.com\/?p=4597\">A bit Stochastic Calculus<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Implications<\/h2>\n\n\n\n<ul><li>1. Stochastic Integral is different from Ordinary Integral, so as to differentiation. The Stochastic Differential Equation, S.D.E. we normally use to mimic the movement of a stock is as the following,<\/li><\/ul>\n\n\n\n<p>$$ d S=\\mu S d + \\sigma S dW$$ <\/p>\n\n\n\n<p>, where <span class=\"katex math inline\">dW<\/span> follows a Brownian Motion.<\/p>\n\n\n\n<p>The Brownian Motion also has the following critical properties:<\/p>\n\n\n\n<ol><li>Martingale: <span class=\"katex math inline\">E(S_{t+k}|F_t)=E(S_t|F_t)<\/span> for k>1.<\/li><li>Quadratic Variation: <span class=\"katex math inline\">\\sum_{i=1}^n (S_i-S_{i-1})^2 \\to  t<\/span><\/li><li>Normality: An increment of <span class=\"katex math inline\">S_{t+dt}<\/span> is normally distributed, with mean zero and variance <span class=\"katex math inline\">t_i &#8211; t_{i-1}<\/span><\/li><\/ol>\n\n\n\n<ul><li>2. What does Ito&#8217;s Lemma tell us? <\/li><\/ul>\n\n\n\n<p>If the stock price, <span class=\"katex math inline\">S_t<\/span>, follows a stochastic process, then the financial contracts <span class=\"katex math inline\">F(S_t)<\/span>, as a function of the underlying stock price, follow another stochastic process.<\/p>\n\n\n\n<ul><li>3. Taylor Expansion helps<\/li><\/ul>\n\n\n\n<p>See notes about Paul Willmott&#8217;s book&#8217;s paragraph.<\/p>\n\n\n\n<ul><li>4. Different Forms of Stochastic Processes could be applied.<\/li><\/ul>\n\n\n\n<p>Example 1: <span class=\"katex math inline\">dS=\\mu \\ dt + \\sigma \\ dX<\/span><\/p>\n\n\n\n<p>Example 2: <span class=\"katex math inline\">dS=\\mu S \\ dt +\\sigma S \\ dX<\/span><\/p>\n\n\n\n<p>For this, <span class=\"katex math inline\">dV = \\frac{\\partial V}{\\partial t}dt+\\frac{\\partial V}{\\partial S}dS+\\frac{1}{2}\\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}dt<\/span>, which is also called the <strong>Geometric Brownian Motion<\/strong> (GBM). If in a specific form of value function <span class=\"katex math inline\">V=F(S)=ln(S)<\/span>, then <span class=\"katex math inline\">dF = (\\mu -\\frac{1}{2}\\sigma^2)dt + \\sigma \\ dX<\/span>.<strong> See derivation in attached notes.<\/strong><\/p>\n\n\n\n<p> Example 3: A mean-reverting random walk. <span class=\"katex math inline\">dS=(v-\\mu S)dt +\\sigma dX<\/span><\/p>\n\n\n\n<p>Example 4: Another mean-reverting r.w. <span class=\"katex math inline\">dS=(v-\\mu S)dt +\\sigma S^{1\/2}dX<\/span><\/p>\n\n\n\n<p>The stochastic term is altered compared with example 3. Now if S ever gets close to zero the randomness decreases,<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here is a realisation of the previous blog, A bit Stochastic Calculus. Implications 1. Stochastic Integral is different from Ordinary Integral, so as to differentiation. The Stochastic Differential Equation, S.D.E. we normally use to mimic the movement of a stock is as the following, $$ d S=\\mu S d + \\sigma S dW$$ , where &hellip; <a href=\"https:\/\/fanyuzhao.com\/?p=4618\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Simulating Geometric Brownian Motion (GBM)<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,18,26],"tags":[],"_links":{"self":[{"href":"https:\/\/fanyuzhao.com\/index.php?rest_route=\/wp\/v2\/posts\/4618"}],"collection":[{"href":"https:\/\/fanyuzhao.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fanyuzhao.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fanyuzhao.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fanyuzhao.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4618"}],"version-history":[{"count":34,"href":"https:\/\/fanyuzhao.com\/index.php?rest_route=\/wp\/v2\/posts\/4618\/revisions"}],"predecessor-version":[{"id":4654,"href":"https:\/\/fanyuzhao.com\/index.php?rest_route=\/wp\/v2\/posts\/4618\/revisions\/4654"}],"wp:attachment":[{"href":"https:\/\/fanyuzhao.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4618"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fanyuzhao.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4618"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fanyuzhao.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4618"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}