{"id":4722,"date":"2022-11-14T13:17:27","date_gmt":"2022-11-14T05:17:27","guid":{"rendered":"https:\/\/fanyuzhao.com\/?p=4722"},"modified":"2022-11-14T13:25:08","modified_gmt":"2022-11-14T05:25:08","slug":"volatility-forecast-ornstein-uhlenbeck-process","status":"publish","type":"post","link":"https:\/\/fanyuzhao.com\/?p=4722","title":{"rendered":"Volatility Forecast &#8211; Ornstein Uhlenbeck Process"},"content":{"rendered":"\n<div class=\"wp-block-file\"><a id=\"wp-block-file--media-6cb82e5b-56cb-4033-b79c-e114f49a4aa3\" href=\"https:\/\/fanyuzhao.com\/wp-content\/uploads\/2022\/11\/VolatilityForecast_OrnsteinUhlenbeck.html\">VolatilityForecast_OrnsteinUhlenbeck<\/a><a href=\"https:\/\/fanyuzhao.com\/wp-content\/uploads\/2022\/11\/VolatilityForecast_OrnsteinUhlenbeck.html\" class=\"wp-block-file__button\" download aria-describedby=\"wp-block-file--media-6cb82e5b-56cb-4033-b79c-e114f49a4aa3\">Download<\/a><\/div>\n\n\n\n<p>See notes and the realisation.<\/p>\n\n\n\n<p>We assume the volatility of returns follows a stochastic process. Define it as the Ornstein-Uhlenbeck process,<\/p>\n\n\n\n<p>$$dX_t = \\kappa (\\theta &#8211; X_t)dt +\\sigma \\ dW_t$$<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">What\u2019s the distribution function of the Ornstein-Uhlenbeck process?<\/h4>\n\n\n\n<p>We could apply the <a href=\"https:\/\/fanyuzhao.com\/?p=4704\">MLE estimation<\/a> to find the parameter of the above random process. <\/p>\n\n\n\n<p>Recall our Vasicek Form Ornstein-Uhlenbeck process is like the following:<\/p>\n\n\n\n<p>$$ dX_t = \\kappa (\\theta &#8211; X_t)dt +\\sigma \\ dW_t $$<\/p>\n\n\n\n<p>Multiply both sides by <span class=\"katex math inline\">e^{kt}<\/span>, then we get,<\/p>\n\n\n\n<p>$$ e^{kt}dX_t = \\kappa e^{kt} \\theta \\ dt &#8211; \\kappa e^{kt} X_t \\ dt +\\sigma e^{kt}\\ dW_t $$<\/p>\n\n\n\n<p>We know that <span class=\"katex math inline\">d( e^{kt} X_t )=e^{kt}dX_t + k e^{kt}X_t dt<\/span>, and substitute it inside. Then, we get,<\/p>\n\n\n\n<p>$$ d(e^{kt}X_t)=e^{kt}\\theta \\ dt + e^{kt}\\sigma \\ dW_t $$<\/p>\n\n\n\n<p>Take an integral from [0,T],<\/p>\n\n\n\n<p>$$ \\int_0^T d(e^{kt}X_t)= \\int_0^T e^{kt}\\theta \\ dt + \\int_0^T e^{kt}\\sigma \\ dW_t $$<\/p>\n\n\n\n<p>$$ X_T = X_0 e^{-kT} +\\theta (1-e^{-kT}) + \\int_0^T e^{-k(T-t)}\\sigma \\ dW_t $$<\/p>\n\n\n\n<p>$\\int_0^T e^{-k(T-t)}\\sigma \\ dW_t \\sim N(0, \\sigma^2\\int_0^T e^{-2k(T-t)}dt)$<\/p>\n\n\n\n<p>We then find <span class=\"katex math inline\">\\mathbb{E}(X_T)<\/span> and <span class=\"katex math inline\">Var(X_T)<\/span>.<\/p>\n\n\n\n<p>$ \\mathbb{E}(X_T) =\\mathbb{E}\\bigg( X_0 e^{-kT} +\\theta (1-e^{-kT}) + \\int_0^T e^{-k(T-t)}\\sigma \\ dW_t \\bigg)$<\/p>\n\n\n\n<p>$ \\mathbb{E}(X_T)= X_0 e^{-kT} +\\theta (1-e^{-kT}) $<\/p>\n\n\n\n<p>$Var(X_T) = \\mathbb{E}\\bigg( \\big( X_T &#8211; \\mathbb{E}(X_T) \\big)^2 \\bigg)$<\/p>\n\n\n\n<p>$Var(X_T)= \\mathbb{E}\\bigg( \\big( \\int_0^T e^{-k(T-t)}\\sigma \\ dW_t \\big)^2 \\bigg) $<\/p>\n\n\n\n<p>By Ito&#8217;s Isometry: <span class=\"katex math inline\">I(t)=\\int_0^t \\Delta(s)dW_s<\/span>, then<\/p>\n\n\n\n<p>$Var[I(t)]=\\mathbb{E}[(I^2(t))]=\\int_0^t \\Delta^2(s)ds$<\/p>\n\n\n\n<p>Then,<\/p>\n\n\n\n<p>$ Var(X_T)= \\int_0^T e^{-2k(T-t)}\\sigma^2 \\ dt $<\/p>\n\n\n\n<p>$ Var(X_T)= \\frac{\\sigma^2}{2k}\\big( 1-e^{-2kT} \\big) $<\/p>\n\n\n\n<p><strong>Therefore, we finally get,<\/strong><\/p>\n\n\n\n<p>$ X_T \\sim N\\bigg(X_0 e^{-kT} +\\theta (1-e^{-kT}), \\frac{\\sigma^2}{2k}\\big( 1-e^{-2kT} \\big) \\bigg)$<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">MLE of Ornsterin-Uhlenbeck Process<\/h4>\n\n\n\n<p>$X_t \\sim N(\\cdot,\\cdot)$<\/p>\n\n\n\n<p>,where <span class=\"katex math inline\">\\mathbb{E}(X_{t+\\delta t})=X_0 e^{-k\\ \\delta t} +\\theta (1-e^{-k\\ \\delta t})<\/span>, and <span class=\"katex math inline\">Var(X_{t+\\delta t})= \\frac{\\sigma^2}{2k}(1-e^{-2k\\ \\delta t})<\/span>.<\/p>\n\n\n\n<p>$$ f_{\\theta}(x_{t+\\delta t}|\\theta)=\\frac{1}{\\sqrt{2\\pi \\sigma^2}}e^{-\\frac{(x-\\mu)^2}{2\\sigma^2}} $$<\/p>\n\n\n\n<p>We replace <span class=\"katex math inline\">\\mu = \\mathbb{E}(X_{t+\\delta t})<\/span> and <span class=\"katex math inline\">\\sigma^2 = Var(X_{t+\\delta t})<\/span> insider.<\/p>\n\n\n\n<p>Code realisation could be found in notes.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>See notes and the realisation. We assume the volatility of returns follows a stochastic process. Define it as the Ornstein-Uhlenbeck process, $$dX_t = \\kappa (\\theta &#8211; X_t)dt +\\sigma \\ dW_t$$ What\u2019s the distribution function of the Ornstein-Uhlenbeck process? We could apply the MLE estimation to find the parameter of the above random process. Recall our &hellip; <a href=\"https:\/\/fanyuzhao.com\/?p=4722\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Volatility Forecast &#8211; Ornstein Uhlenbeck Process<\/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,8,26],"tags":[],"_links":{"self":[{"href":"https:\/\/fanyuzhao.com\/index.php?rest_route=\/wp\/v2\/posts\/4722"}],"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=4722"}],"version-history":[{"count":5,"href":"https:\/\/fanyuzhao.com\/index.php?rest_route=\/wp\/v2\/posts\/4722\/revisions"}],"predecessor-version":[{"id":4728,"href":"https:\/\/fanyuzhao.com\/index.php?rest_route=\/wp\/v2\/posts\/4722\/revisions\/4728"}],"wp:attachment":[{"href":"https:\/\/fanyuzhao.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4722"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fanyuzhao.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4722"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fanyuzhao.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4722"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}