Skip to content

Commit

Permalink
hierarchical forecasting
Browse files Browse the repository at this point in the history
  • Loading branch information
juanitorduz committed Oct 2, 2024
1 parent 6a91cee commit cd6197a
Show file tree
Hide file tree
Showing 20 changed files with 831 additions and 18 deletions.
7 changes: 7 additions & 0 deletions categories/bayesian/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@

<h2 class="archive-title">2024</h2>

<article class="archive-item">
<a href="../../numpyro_hierarchical_forecasting_1/" class="archive-item-link">From Pyro to NumPyro: Forecasting Hierarchical Models - Part I</a>
<span class="archive-item-date">
2024-10-03
</span>
</article>

<article class="archive-item">
<a href="../../numpyro_forecasting-univariate/" class="archive-item-link">From Pyro to NumPyro: Forecasting a univariate, heavy tailed time series</a>
<span class="archive-item-date">
Expand Down
12 changes: 11 additions & 1 deletion categories/bayesian/index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,17 @@
<description>Recent content in Bayesian on Dr. Juan Camilo Orduz</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-us</language>
<lastBuildDate>Tue, 01 Oct 2024 00:00:00 +0000</lastBuildDate><atom:link href="/categories/bayesian/index.xml" rel="self" type="application/rss+xml" />
<lastBuildDate>Thu, 03 Oct 2024 00:00:00 +0000</lastBuildDate><atom:link href="/categories/bayesian/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>From Pyro to NumPyro: Forecasting Hierarchical Models - Part I</title>
<link>/numpyro_hierarchical_forecasting_1/</link>
<pubDate>Thu, 03 Oct 2024 00:00:00 +0000</pubDate>

<guid>/numpyro_hierarchical_forecasting_1/</guid>
<description>In this notebook we provide a NumPyro implementation of the first model presented in the Pyro forecasting documentation: Forecasting III: hierarchical models. This model generalizes the local level model with seasonality presented in the univariate example Forecasting I: univariate, heavy tailed (see From Pyro to NumPyro: Forecasting a univariate, heavy tailed time series for the corresponding NumPyro implementation).
In this example, we continue working with the BART train ridership dataset.</description>
</item>

<item>
<title>From Pyro to NumPyro: Forecasting a univariate, heavy tailed time series</title>
<link>/numpyro_forecasting-univariate/</link>
Expand Down
2 changes: 1 addition & 1 deletion categories/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ <h2 class="archive-title">2024</h2>
<article class="archive-item">
<a href="../categories/bayesian/" class="archive-item-link">Bayesian</a>
<span class="archive-item-date">
2024-10-01
2024-10-03
</span>
</article>

Expand Down
4 changes: 2 additions & 2 deletions categories/index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<description>Recent content in Categories on Dr. Juan Camilo Orduz</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-us</language>
<lastBuildDate>Tue, 01 Oct 2024 00:00:00 +0000</lastBuildDate><atom:link href="/categories/index.xml" rel="self" type="application/rss+xml" />
<lastBuildDate>Thu, 03 Oct 2024 00:00:00 +0000</lastBuildDate><atom:link href="/categories/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>Bayesian</title>
<link>/categories/bayesian/</link>
<pubDate>Tue, 01 Oct 2024 00:00:00 +0000</pubDate>
<pubDate>Thu, 03 Oct 2024 00:00:00 +0000</pubDate>

<guid>/categories/bayesian/</guid>
<description></description>
Expand Down
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.
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@

<h2 class="archive-title">2024</h2>

<article class="archive-item">
<a href="./numpyro_hierarchical_forecasting_1/" class="archive-item-link">From Pyro to NumPyro: Forecasting Hierarchical Models - Part I</a>
<span class="archive-item-date">
2024-10-03
</span>
</article>

<article class="archive-item">
<a href="./numpyro_forecasting-univariate/" class="archive-item-link">From Pyro to NumPyro: Forecasting a univariate, heavy tailed time series</a>
<span class="archive-item-date">
Expand Down
12 changes: 11 additions & 1 deletion index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,17 @@
<description>Recent content on Dr. Juan Camilo Orduz</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-us</language>
<lastBuildDate>Tue, 01 Oct 2024 00:00:00 +0000</lastBuildDate><atom:link href="/index.xml" rel="self" type="application/rss+xml" />
<lastBuildDate>Thu, 03 Oct 2024 00:00:00 +0000</lastBuildDate><atom:link href="/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>From Pyro to NumPyro: Forecasting Hierarchical Models - Part I</title>
<link>/numpyro_hierarchical_forecasting_1/</link>
<pubDate>Thu, 03 Oct 2024 00:00:00 +0000</pubDate>

<guid>/numpyro_hierarchical_forecasting_1/</guid>
<description>In this notebook we provide a NumPyro implementation of the first model presented in the Pyro forecasting documentation: Forecasting III: hierarchical models. This model generalizes the local level model with seasonality presented in the univariate example Forecasting I: univariate, heavy tailed (see From Pyro to NumPyro: Forecasting a univariate, heavy tailed time series for the corresponding NumPyro implementation).
In this example, we continue working with the BART train ridership dataset.</description>
</item>

<item>
<title>From Pyro to NumPyro: Forecasting a univariate, heavy tailed time series</title>
<link>/numpyro_forecasting-univariate/</link>
Expand Down
5 changes: 4 additions & 1 deletion numpyro_forecasting-univariate/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,9 @@ <h2>Seasonal Features</h2>
fourier_modes_jax = periodic_features_jax(T2, 365.25 / 7)
# Verify that the Fourier features are the same as the Pyro code
assert jnp.allclose(jnp.array(fourier_modes_torch), fourier_modes_jax)</code></pre>
</div>
<div id="train---test-split" class="section level2">
<h2>Train - Test Split</h2>
<p>Next, we split these features into train and test.</p>
<pre class="python"><code>time = jnp.arange(T2)
time_train = time[:T1]
Expand Down Expand Up @@ -435,7 +438,7 @@ <h1>Inference with SVI</h1>
<center>
<img src="../images/numpyro_forecasting_univariate_files/numpyro_forecasting_univariate_33_2.png" style="width: 900px;"/>
</center>
<p>The elbo loss is decreasing as expected.</p>
<p>The ELBO loss is decreasing as expected.</p>
<div id="posterior-predictive-check" class="section level2">
<h2>Posterior Predictive Check</h2>
<p>We can use the fitted model to sample from the posterior predictive distribution and generate posterior samples for the train and test data.</p>
Expand Down
Loading

0 comments on commit cd6197a

Please sign in to comment.