|
| 1 | +<!doctype html><html lang="en"> |
| 2 | + |
| 3 | +<head> |
| 4 | + |
| 5 | + |
| 6 | + <style media="screen"> |
| 7 | + body { |
| 8 | + padding-top: 70px; |
| 9 | + padding-bottom: 70px; |
| 10 | + } |
| 11 | + |
| 12 | + h1, |
| 13 | + h2, |
| 14 | + h3 { |
| 15 | + display: inline-block; |
| 16 | + /* Ensures that the heading and the span are on the same line */ |
| 17 | + margin: 0; |
| 18 | + /* Optional: Reset margin for better control */ |
| 19 | + position: relative; |
| 20 | + /* Ensures that the span can be positioned relative to the heading */ |
| 21 | + } |
| 22 | + |
| 23 | + .copy-span { |
| 24 | + cursor: pointer; |
| 25 | + /* Changes the cursor to a pointer when hovering over the # */ |
| 26 | + color: #81C240; |
| 27 | + /* Sets the color of the # */ |
| 28 | + margin-left: 5px; |
| 29 | + /* Adds some space between the heading text and the # */ |
| 30 | + font-size: 0.9em; |
| 31 | + /* Adjusts the font size of the # to be slightly smaller relative to the heading */ |
| 32 | + visibility: hidden; |
| 33 | + /* Initially hides the # */ |
| 34 | + } |
| 35 | + |
| 36 | + h1:hover .copy-span, |
| 37 | + h2:hover .copy-span, |
| 38 | + h3:hover .copy-span, |
| 39 | + .copy-span:hover { |
| 40 | + visibility: visible; |
| 41 | + text-decoration: none; |
| 42 | + color: #81C240; |
| 43 | + /* Makes the # visible when hovering over the heading or the span */ |
| 44 | + } |
| 45 | + </style> |
| 46 | + <!-- Required meta tags --> |
| 47 | + <meta charset="utf-8"> |
| 48 | + <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> |
| 49 | + |
| 50 | + <!-- Bootstrap CSS --> |
| 51 | + <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" |
| 52 | + integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous"> |
| 53 | + <link rel="stylesheet" href="../../static/css/custom_style.css?h=00853bf3"> |
| 54 | + <link rel="stylesheet" href="../../static/css/table_style.css?h=c677f945"> |
| 55 | + |
| 56 | + <!-- Highlight.js for syntax highlighting --> |
| 57 | + <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.7.2/styles/default.min.css"> |
| 58 | + |
| 59 | + |
| 60 | + <!-- Extra meta tags: social site cards, browser icons... --> |
| 61 | + <meta name="theme-color" content="#ffffff"> |
| 62 | + <link rel="shortcut icon" href="../../static/favicon.ico?h=d935d59e"> |
| 63 | + <link rel="apple-touch-icon" sizes="180x180" href="../../static/apple-touch-icon.png?h=2bad941d"> |
| 64 | + <link rel="icon" type="image/png" sizes="32x32" href="../../static/favicon-32x32.png?h=1673bb68"> |
| 65 | + <link rel="icon" type="image/png" sizes="16x16" href="../../static/favicon-16x16.png?h=089e66cb"> |
| 66 | + |
| 67 | + <title>Stochastic Volatility Model with PyMC - PyMC Labs</title> |
| 68 | + <meta name="twitter:card" content="summary"> |
| 69 | + <meta property="og:url" content="https://pymc-labs.github.io/blog-posts/01-xpost-tw-stochastic-volatility/" /> |
| 70 | + <meta property="og:type" content="website" /> |
| 71 | + <link rel="canonical" href=""> |
| 72 | + <meta property="og:title" content="Stochastic Volatility Model with PyMC - PyMC Labs" /> |
| 73 | + <meta property="og:description" content="Explore the concept of time-varying volatility in asset prices, modeled using a stochastic process. The example demonstrates the computation of this volatility based on the daily returns of the S&P 500 using PyMC." /> |
| 74 | + <meta property="og:image" |
| 75 | + content="https://pymc-labs.github.io/blog-posts/01-xpost-tw-stochastic-volatility/cover.png" /> |
| 76 | + <meta name="description" |
| 77 | + content="We are a Bayesian consulting firm specializing in data analysis and predictive modeling. Contact us today to learn how we can help your business."> |
| 78 | + <meta name="keywords" content="Bayesian consulting, data analysis, predictive modeling"> |
| 79 | + |
| 80 | + <!-- Highlight.js for syntax highlighting --> |
| 81 | + <!-- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.0.0/styles/default.min.css"> --> |
| 82 | + <!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.0.0/highlight.min.js"></script> --> |
| 83 | + <!-- <script>hljs.highlightAll();</script> --> |
| 84 | + |
| 85 | + <!-- From: https://github.com/lektor/lektor-markdown-highlighter --> |
| 86 | + <!-- We use this to do syntax highlighting --> |
| 87 | + <link rel="stylesheet" href="../../static/pygments.css"> |
| 88 | + <!-- Global site tag (gtag.js) - Google Analytics --> |
| 89 | + <script async src="https://www.googletagmanager.com/gtag/js?id=G-F3RDLH8R8X"></script> |
| 90 | + <script> |
| 91 | + window.dataLayer = window.dataLayer || []; |
| 92 | + function gtag() { dataLayer.push(arguments); } |
| 93 | + gtag('js', new Date()); |
| 94 | + |
| 95 | + gtag('config', 'G-F3RDLH8R8X'); |
| 96 | + </script> |
| 97 | + |
| 98 | + <script> |
| 99 | + document.addEventListener("DOMContentLoaded", function () { |
| 100 | + // Base URL of the page (removing any existing fragment part) |
| 101 | + const baseURL = window.location.href.split('#')[0]; |
| 102 | + // Select all h3 elements within elements of class 'blogpost' |
| 103 | + const h3Elements = document.querySelectorAll('h3, h2, h1'); |
| 104 | + h3Elements.forEach((element) => { |
| 105 | + const copyAnchor = document.createElement('a'); |
| 106 | + copyAnchor.textContent = `#`; |
| 107 | + copyAnchor.classList.add('copy-span'); // Add a class for styling |
| 108 | + copyAnchor.setAttribute('href', baseURL+`#${element.id}`); // Set href attribute to a placeholder |
| 109 | + copyAnchor.setAttribute('title', 'Copy URL to clipboard'); // Tooltip text |
| 110 | + // Insert the anchor after the <h1>, <h2>, or <h3> element |
| 111 | + element.appendChild(copyAnchor); |
| 112 | + }); |
| 113 | + }); |
| 114 | + </script> |
| 115 | + |
| 116 | + |
| 117 | +<script src="../../static/scripts/toggle_code.js?h=3a00c72f" defer></script> |
| 118 | + |
| 119 | +</head> |
| 120 | + |
| 121 | +<body> |
| 122 | + <!-- Navigation --> |
| 123 | + <nav class="navbar navbar-expand-lg navbar-light bg-light fixed-top"> |
| 124 | + <div class="container"> |
| 125 | + <!-- <a class="navbar-brand" href="/">PyMC Labs</a> --> |
| 126 | + <a class="navbar-brand" href="/"><img alt="logo" loading="eager" width="88" height="70" title="logo" |
| 127 | + class="navbar-logo" src="../../static/images/pymc-labs-logo.png?h=999c3177'"></a> |
| 128 | + <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarTop" |
| 129 | + aria-controls="navbarTop" aria-expanded="false" aria-label="Toggle navigation"> |
| 130 | + <span class="navbar-toggler-icon"></span> |
| 131 | + </button> |
| 132 | + <div class="collapse navbar-collapse" id="navbarTop"> |
| 133 | + <ul class="navbar-nav ml-auto"> |
| 134 | + |
| 135 | + <li class="nav-item"> |
| 136 | + <a class="nav-link" href="/what-we-do"><i class="fa fa-info-circle" |
| 137 | + aria-hidden="true"></i> |
| 138 | + What we do</a> |
| 139 | + </li> |
| 140 | + |
| 141 | + <li class="nav-item"> |
| 142 | + <a class="nav-link" href="/products"><i class="fa fa-shopping-cart" |
| 143 | + aria-hidden="true"></i> |
| 144 | + Products</a> |
| 145 | + </li> |
| 146 | + |
| 147 | + <li class="nav-item"> |
| 148 | + <a class="nav-link" href="/team"><i class="fa fa-user-friends" |
| 149 | + aria-hidden="true"></i> |
| 150 | + Team</a> |
| 151 | + </li> |
| 152 | + |
| 153 | + <li class="nav-item"> |
| 154 | + <a class="nav-link" href="/clients"><i class="fa fa-microphone" |
| 155 | + aria-hidden="true"></i> |
| 156 | + Clients</a> |
| 157 | + </li> |
| 158 | + |
| 159 | + <li class="nav-item"> |
| 160 | + <a class="nav-link" href="/workshops"><i class="fa fa-chalkboard-teacher" |
| 161 | + aria-hidden="true"></i> |
| 162 | + Workshops</a> |
| 163 | + </li> |
| 164 | + |
| 165 | + <li class="nav-item"> |
| 166 | + <a class="nav-link" href="/blog-posts"><i class="fa fa-book-open" |
| 167 | + aria-hidden="true"></i> |
| 168 | + Blog</a> |
| 169 | + </li> |
| 170 | + |
| 171 | + </ul> |
| 172 | + </div> |
| 173 | + </div> |
| 174 | + </nav> |
| 175 | + |
| 176 | + <div class="container"> |
| 177 | + |
| 178 | + |
| 179 | +<div class="row"> |
| 180 | + <div class="col-md-2"></div> |
| 181 | + <div class="col-md-8 blogpost"> |
| 182 | + <h2 class="font-roboto">Stochastic Volatility Model with PyMC</h2> |
| 183 | + |
| 184 | + <p class="mb-2 text-muted">Explore the concept of time-varying volatility in asset prices, modeled using a stochastic process. The example demonstrates the computation of this volatility based on the daily returns of the S&P 500 using PyMC.</p> |
| 185 | + |
| 186 | + <hr> |
| 187 | + <div class="row"> |
| 188 | + <div class="col-md-6 author_name"> |
| 189 | + <small class="text-muted">AUTHORED BY</small> |
| 190 | + <p class="font-bold"> |
| 191 | + |
| 192 | + |
| 193 | + |
| 194 | + |
| 195 | + |
| 196 | + |
| 197 | + |
| 198 | + |
| 199 | + |
| 200 | + Thomas Wiecki |
| 201 | + |
| 202 | + |
| 203 | + |
| 204 | + |
| 205 | + </p> |
| 206 | + </div> |
| 207 | + <div class="col-md-6 author_date"> |
| 208 | + <!-- <p>2022-01-15</p> --> |
| 209 | + |
| 210 | +<small class="text-muted">DATE</small> |
| 211 | +<p class="font-lighter">2022-01-15</p> |
| 212 | + |
| 213 | +<!--<div class="cover-blogposts"><img src="../../static/images/blog_post/cover.jpg?h=653e9b57"></div>--> |
| 214 | + |
| 215 | + </div> |
| 216 | + |
| 217 | + |
| 218 | + <div class="blog-cover-container"> |
| 219 | + <img loading="lazy" title="cover image" alt="" class="cover-blogposts" src="cover.png"> |
| 220 | + </div> |
| 221 | + |
| 222 | + </div> |
| 223 | + <hr> <p>Asset prices have time-varying volatility (variance of day over day returns). In some periods, returns are highly variable, while in others very stable. Stochastic volatility models model this with a latent volatility variable, modeled as a stochastic process. In this example, we compute the time-varying volatility based on daily returns of the S&P 500.</p> |
| 224 | +<p>For the full example, see:<br> |
| 225 | +<a href="https://www.pymc.io/projects/examples/en/latest/case_studies/stochastic_volatility.html">Stochastic Volatility Model with PyMC</a></p> |
| 226 | + |
| 227 | + <!--THIS IS THE FOOTER OF THE BLOGPSOT--> |
| 228 | + <hr> |
| 229 | + <!--div class="container"--> |
| 230 | + <h2 class="font-roboto">Work with PyMC Labs</h2> |
| 231 | + <p>If you are interested in seeing what we at PyMC Labs can do for you, then please email <a href=" mailto:[email protected]" >[email protected]</a>. We work with companies at a variety of scales and with varying levels of existing modeling capacity. |
| 232 | + |
| 233 | +We also run <a href="https://www.pymc-labs.com/workshops/">corporate workshop training events</a> and can provide sessions ranging from introduction to Bayes to more advanced topics. |
| 234 | + </p> |
| 235 | + <!--/div--> |
| 236 | + |
| 237 | + </div> |
| 238 | + <div class="col-md-2"></div> |
| 239 | +</div> |
| 240 | + |
| 241 | + |
| 242 | + </div> |
| 243 | + |
| 244 | + <!-- Optional JavaScript --> |
| 245 | + <!-- jQuery first, then Popper.js, then Bootstrap JS --> |
| 246 | + <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" |
| 247 | + integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" |
| 248 | + crossorigin="anonymous"></script> |
| 249 | + <script src=" https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" |
| 250 | + integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" |
| 251 | + crossorigin="anonymous"></script> |
| 252 | + <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" |
| 253 | + integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" |
| 254 | + crossorigin="anonymous"></script> |
| 255 | + <script src="https://kit.fontawesome.com/8cc267a9ab.js" crossorigin="anonymous"></script> |
| 256 | + |
| 257 | + <nav class="navbar navbar-expand-lg navbar-light bg-light fixed-bottom"> |
| 258 | + <div class="container"> |
| 259 | + <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarBottom" |
| 260 | + aria-controls="navbarBottom" aria-expanded="false" aria-label="Toggle navigation"> |
| 261 | + <span class="navbar-toggler-icon"></span> |
| 262 | + </button> |
| 263 | + <div class="collapse navbar-collapse" id="navbarBottom"> |
| 264 | + <ul class="navbar-nav ml-auto"> |
| 265 | + |
| 266 | + <li class="nav-item"> |
| 267 | + <a class="nav-link" href="https://twitter.com/pymc_labs"><i class="fa fa-twitter" |
| 268 | + aria-hidden="true"></i> |
| 269 | + Twitter</a> |
| 270 | + </li> |
| 271 | + |
| 272 | + <li class="nav-item"> |
| 273 | + <a class="nav-link" href="https://github.com/pymc-labs"><i class="fa fa-github" |
| 274 | + aria-hidden="true"></i> |
| 275 | + GitHub</a> |
| 276 | + </li> |
| 277 | + |
| 278 | + <li class="nav-item"> |
| 279 | + <a class="nav-link" href="https://www.linkedin.com/company/pymc-labs/"><i class="fa fa-linkedin" |
| 280 | + aria-hidden="true"></i> |
| 281 | + LinkedIn</a> |
| 282 | + </li> |
| 283 | + |
| 284 | + <li class="nav-item"> |
| 285 | + <a class="nav-link" href="https://www.youtube.com/c/PyMCLabs"><i class="fa fa-youtube" |
| 286 | + aria-hidden="true"></i> |
| 287 | + YouTube</a> |
| 288 | + </li> |
| 289 | + |
| 290 | + <li class="nav-item"> |
| 291 | + <a class="nav-link" href="https://www.meetup.com/pymc-labs-online-meetup/"><i class="fa fa-meetup" |
| 292 | + aria-hidden="true"></i> |
| 293 | + Meetup</a> |
| 294 | + </li> |
| 295 | + |
| 296 | + <li class="nav-item"> |
| 297 | + <a class="nav-link" href="/newsletter"><i class="fa fa-solid fa-bell" |
| 298 | + aria-hidden="true"></i> |
| 299 | + Newsletter</a> |
| 300 | + </li> |
| 301 | + |
| 302 | + <li class="nav-item"> |
| 303 | + <a class="nav-link" href="/privacy-policy"><i class="fa fa-solid fa-lock" |
| 304 | + aria-hidden="true"></i> |
| 305 | + Privacy Policy</a> |
| 306 | + </li> |
| 307 | + |
| 308 | + <li class="nav-item"> |
| 309 | + <a class="nav-link" href="/impressum"><i class="fa fa-solid fa-info-circle" |
| 310 | + aria-hidden="true"></i> |
| 311 | + Impressum</a> |
| 312 | + </li> |
| 313 | + |
| 314 | + </ul> |
| 315 | + </div> |
| 316 | + </div> |
| 317 | + </nav> |
| 318 | + |
| 319 | + <!-- Mathjax for latex/equations --> |
| 320 | + <!-- Mathjax --> |
| 321 | + <script type="text/javascript" async |
| 322 | + src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-MML-AM_CHTML"> |
| 323 | + </script> |
| 324 | + |
| 325 | + <script type="text/x-mathjax-config"> |
| 326 | + MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$']]}}); |
| 327 | + </script> |
| 328 | + |
| 329 | +</body> |
| 330 | + |
| 331 | +</html> |
0 commit comments