Skip to content

Commit

Permalink
main content
Browse files Browse the repository at this point in the history
  • Loading branch information
juanitorduz committed Aug 29, 2024
1 parent c1e3c0f commit 03c9a31
Show file tree
Hide file tree
Showing 4 changed files with 206 additions and 2 deletions.
54 changes: 52 additions & 2 deletions Presentations/pydata_amsterdam_2024/timeseries_numpyro.html
Original file line number Diff line number Diff line change
Expand Up @@ -778,13 +778,63 @@ <h2>Censored Likelihood</h2>
</section>
<section id="censored-time-series-forecast" class="slide level2">
<h2>Censored Time Series Forecast</h2>

<img data-src="timeseries_numpyro_files/static/images/demand_files/demand_48_0.png" class="quarto-figure quarto-figure-center r-stretch" width="1000"><div class="footer">
<p><a href="https://juanitorduz.github.io/demand/">Demand Forecasting with Censored Likelihood</a></p>
</div>
</section>
<section id="hierarchical-exponential-smoothing" class="slide level2">
<h2>Hierarchical Exponential Smoothing</h2>
<div class="quarto-figure quarto-figure-center">
<figure>
<p><img data-src="timeseries_numpyro_files/static/images/demand_files/demand_48_0.png" class="quarto-figure quarto-figure-center" width="1000"></p>
<p><img data-src="timeseries_numpyro_files/static/images/hierarchical_exponential_smoothing_files/hierarchical_exponential_smoothing_45_0.png" class="quarto-figure quarto-figure-center" height="1950"></p>
</figure>
</div>
</section>
<section id="hierarchical-exponential-smoothing-1" class="slide level2">
<h2>Hierarchical Exponential Smoothing</h2>

<img data-src="timeseries_numpyro_files/static/images/hierarchical_exponential_smoothing_files/hierarchical_exponential_smoothing_47_0.png" class="quarto-figure quarto-figure-center r-stretch" width="1000"><div class="footer">
<p><a href="https://juanitorduz.github.io/hierarchical_exponential_smoothing/">Hierarchical Exponential Smoothing Model</a></p>
</div>
</section>
<section id="hierarchical-exponential-smoothing-2" class="slide level2">
<h2>Hierarchical Exponential Smoothing</h2>

<img data-src="timeseries_numpyro_files/static/images/hierarchical_exponential_smoothing_files/hierarchical_exponential_smoothing_69_0.png" class="quarto-figure quarto-figure-center r-stretch" width="1000"><div class="footer">
<p><a href="https://juanitorduz.github.io/hierarchical_exponential_smoothing/">Hierarchical Exponential Smoothing Model</a></p>
</div>
</section>
<section id="pymc-time-series" class="slide level2">
<h2>PyMC &amp; Time Series</h2>

<img data-src="timeseries_numpyro_files/static/images/pymc-ts.svg" class="quarto-figure quarto-figure-center r-stretch" width="600"><div class="footer">
<p><a href="https://www.pymc.io/projects/examples/en/latest/time_series/Time_Series_Generative_Graph.html">Time Series Models Derived From a Generative Graph</a></p>
</div>
</section>
<section id="pymc-time-series-1" class="slide level2">
<h2>PyMC &amp; Time Series</h2>

<img data-src="timeseries_numpyro_files/static/images/pymc-ts-forecast.png" class="quarto-figure quarto-figure-center r-stretch" width="1000"><div class="footer">
<p><a href="https://www.pymc.io/projects/examples/en/latest/time_series/Time_Series_Generative_Graph.html">Time Series Models Derived From a Generative Graph</a></p>
</div>
</section>
<section id="pymc-state-space-module" class="slide level2">
<h2>PyMC State Space Module</h2>
<center>
<iframe width="560" height="315" src="https://www.youtube.com/embed/G9VWXZdbtKQ" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen="">
</iframe>
</center>
<div class="sourceCode" id="cb11"><pre class="sourceCode numberSource python number-lines code-with-copy"><code class="sourceCode python"><span id="cb11-1"><a href=""></a><span class="im">from</span> pymc_experimental.statespace <span class="im">import</span> structural <span class="im">as</span> st</span>
<span id="cb11-2"><a href=""></a></span>
<span id="cb11-3"><a href=""></a>slow_trend <span class="op">=</span> st.LevelTrendComponent(order<span class="op">=</span><span class="dv">2</span>, innovations_order<span class="op">=</span>[<span class="dv">0</span>, <span class="dv">1</span>])</span>
<span id="cb11-4"><a href=""></a>seasonality <span class="op">=</span> st.FrequencySeasonality(name<span class="op">=</span><span class="st">"annual_seasonality"</span>, season_length<span class="op">=</span><span class="dv">52</span>, n<span class="op">=</span><span class="dv">2</span>, innovations<span class="op">=</span><span class="va">False</span>)</span>
<span id="cb11-5"><a href=""></a>exog <span class="op">=</span> st.RegressionComponent(name<span class="op">=</span><span class="st">"exog"</span>, state_names<span class="op">=</span>X.columns.tolist(), innovations<span class="op">=</span><span class="va">False</span>)</span>
<span id="cb11-6"><a href=""></a>measurement_error <span class="op">=</span> st.MeasurementError(<span class="st">"measurement_error"</span>)</span>
<span id="cb11-7"><a href=""></a></span>
<span id="cb11-8"><a href=""></a>ss_mod <span class="op">=</span> (slow_trend <span class="op">+</span> seasonality <span class="op">+</span> exog <span class="op">+</span> measurement_error).build()</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="footer">
<p><a href="https://juanitorduz.github.io/demand/">Demand Forecasting with Censored Likelihood</a></p>
<p><a href="https://github.com/jessegrabowski/statespace-presentation">https://github.com/jessegrabowski/statespace-presentation</a></p>
</div>
<div class="quarto-auto-generated-content">
<p><img src="timeseries_numpyro_files/static/images/juanitorduz_logo_small.png" class="slide-logo"></p>
Expand Down
57 changes: 57 additions & 0 deletions Presentations/pydata_amsterdam_2024/timeseries_numpyro.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -437,4 +437,61 @@ Change likelihood distribution in a time-series model:

::: footer
[Demand Forecasting with Censored Likelihood](https://juanitorduz.github.io/demand/)
:::

## Hierarchical Exponential Smoothing

![](timeseries_numpyro_files/static/images/hierarchical_exponential_smoothing_files/hierarchical_exponential_smoothing_45_0.png){fig-align="center" height="1950"}


## Hierarchical Exponential Smoothing

![](timeseries_numpyro_files/static/images/hierarchical_exponential_smoothing_files/hierarchical_exponential_smoothing_47_0.png){fig-align="center" width="1000"}

::: footer
[Hierarchical Exponential Smoothing Model](https://juanitorduz.github.io/hierarchical_exponential_smoothing/)
:::

## Hierarchical Exponential Smoothing

![](timeseries_numpyro_files/static/images/hierarchical_exponential_smoothing_files/hierarchical_exponential_smoothing_69_0.png ){fig-align="center" width="1000"}

::: footer
[Hierarchical Exponential Smoothing Model](https://juanitorduz.github.io/hierarchical_exponential_smoothing/)
:::

## PyMC & Time Series

![](timeseries_numpyro_files/static/images/pymc-ts.svg){fig-align="center" width="600"}

::: footer
[Time Series Models Derived From a Generative Graph](https://www.pymc.io/projects/examples/en/latest/time_series/Time_Series_Generative_Graph.html)
:::

## PyMC & Time Series
![](timeseries_numpyro_files/static/images/pymc-ts-forecast.png){fig-align="center" width="1000"}

::: footer
[Time Series Models Derived From a Generative Graph](https://www.pymc.io/projects/examples/en/latest/time_series/Time_Series_Generative_Graph.html)
:::

## PyMC State Space Module

<center>
<iframe width="560" height="315" src="https://www.youtube.com/embed/G9VWXZdbtKQ" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</center>

```{.python}
from pymc_experimental.statespace import structural as st
slow_trend = st.LevelTrendComponent(order=2, innovations_order=[0, 1])
seasonality = st.FrequencySeasonality(name="annual_seasonality", season_length=52, n=2, innovations=False)
exog = st.RegressionComponent(name="exog", state_names=X.columns.tolist(), innovations=False)
measurement_error = st.MeasurementError("measurement_error")
ss_mod = (slow_trend + seasonality + exog + measurement_error).build()
```

::: footer
[https://github.com/jessegrabowski/statespace-presentation](https://github.com/jessegrabowski/statespace-presentation)
:::
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 03c9a31

Please sign in to comment.