Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Felipe Angelim committed Apr 29, 2024
1 parent f4fd716 commit d5dd7bb
Show file tree
Hide file tree
Showing 4 changed files with 253 additions and 29 deletions.
6 changes: 0 additions & 6 deletions docs/examples/hierarchical.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,6 @@
" default_exogenous_prior=(\"Normal\", 0, 0.1),\n",
" # exogenous_effects={\"sin\": (\"^sin_.*\", LinearEffect(\"sin\", effect_mode=\"multiplicative\"))},\n",
" noise_scale=0.05,\n",
" mcmc_chains=1,\n",
" mcmc_samples=300,\n",
" mcmc_warmup=3000,\n",
" optimizer_name=\"Adam\",\n",
" optimizer_kwargs={\"step_size\": 0.0001},\n",
" inference_method=\"map\",\n",
Expand Down Expand Up @@ -491,9 +488,6 @@
"\n",
"\n",
"model_hier = HierarchicalProphet(\n",
" mcmc_chains=1,\n",
" mcmc_samples=500,\n",
" mcmc_warmup=3000,\n",
" trend=\"logistic\",\n",
" changepoint_prior_scale=0.1,\n",
" capacity_prior_loc=1.5,\n",
Expand Down
265 changes: 249 additions & 16 deletions docs/examples/univariate.ipynb

Large diffs are not rendered by default.

9 changes: 3 additions & 6 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

This library was created to make a numpyro-based Prophet model for timeseries forecasting. In addition, it also provides an extension that allows for hierarchical forecasting simultaneously, with potentially shared coefficients between timeseries. All implementations (hierarchical and univariate) are based on sktime interface.

The idea was not to fully reproduce Prophet, but to provide an extension where the capacity is a random variable, and the hierarchical structure is considered. The hierarchical one creates a Prophet-like model for each bottom series, but uses a multivariate normal likelihood based on the hierarchy structure to also consider information of middle-top levels.
The idea was not to fully reproduce Prophet, but to provide an extension with some extra features.


## Installation
Expand All @@ -25,9 +25,6 @@ poetry add prophetverse
```



# Remarks

## Differences between this Prophet and the original one

The main differences with the original Prophet model are:
Expand All @@ -44,9 +41,9 @@ The main differences with the original Prophet model are:
trend = \frac{C}{1 + \exp(-(kt + m'))}
$$

which are equivalent. The priors for those parameters $k$ and $m$ are chosen in a data driven way, so that they match the maximum and minimum value of the series.
which are equivalent. The priors for those parameters $k$ and $m'$ are chosen in a data driven way, so that they match the maximum and minimum value of the series.

2. The capacity is also modelled as a random variable, and it's assumed constant.
2. The capacity is also modelled as a random variable, and it's assumed constant. The user can pass the capacity prior as a parameter.
3. One can set different prior distributions for the parameters of the model. The parameters also may be different for different groups of variables, which allows to force positive coefficients for some groups and not for others (with HalfNormal prior, for example).
4. Changepoint interval is used instead of changepoint number. Motivation: as the timeseries evolve, a given changepoint number may have different meanings. For example, a changepoint number of 10 may be too much for a series with 100 observations, but too little for a series with 1000 observations. The changepoint interval may avoid this problem.
5. The exogenous variable inputs are not scaled. They should be scaled prior to the model fitting, with sktime transfomers for example.
Expand Down
2 changes: 1 addition & 1 deletion src/prophetverse/sktime/seasonality.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ def seasonal_transformer(freq="D", yearly_seasonality=False, weekly_seasonality=
fourier_term_list.append(weekly_seasonality_num_terms)

return FourierFeatures(
sp_list=sp_list, fourier_terms_list=fourier_term_list, freq=freq
sp_list=sp_list, fourier_terms_list=fourier_term_list, freq=freq, keep_original_columns=True
)

0 comments on commit d5dd7bb

Please sign in to comment.