orbit.models package

Submodules

orbit.models.ets module

orbit.models.ets.ETS(seasonality=None, seasonality_sm_input=None, level_sm_input=None, estimator='stan-mcmc', **kwargs)
Parameters
  • seasonality (int) – Length of seasonality

  • seasonality_sm_input (float) – float value between [0, 1], applicable only if seasonality > 1. A larger value puts more weight on the current seasonality. If None, the model will estimate this value.

  • level_sm_input (float) – float value between [0.0001, 1]. A larger value puts more weight on the current level. If None, the model will estimate this value.

  • estimator (string; {'stan-mcmc', 'stan-map'}) – default to be ‘stan-mcmc’.

  • response_col (str) – Name of response variable column, default ‘y’

  • date_col (str) – Name of date variable column, default ‘ds’

  • n_bootstrap_draws (int) – Number of samples to bootstrap in order to generate the prediction interval. For full Bayesian and variational inference forecasters, samples are drawn directly from original posteriors. For point-estimated posteriors, it will be used to sample noise parameters. When -1 or None supplied, full Bayesian and variational inference forecasters will assume number of draws equal the size of original samples while point-estimated posteriors will mute the draw and output prediction without interval.

  • prediction_percentiles (list) – List of integers of prediction percentiles that should be returned on prediction. To avoid reporting any confident intervals, pass an empty list

  • **kwargs – additional arguments passed into orbit.estimators.stan_estimator

orbit.models.lgt module

orbit.models.lgt.LGT(seasonality=None, seasonality_sm_input=None, level_sm_input=None, regressor_col=None, regressor_sign=None, regressor_beta_prior=None, regressor_sigma_prior=None, regression_penalty='fixed_ridge', lasso_scale=0.5, auto_ridge_scale=0.5, slope_sm_input=None, estimator='stan-mcmc', **kwargs)
Parameters
  • seasonality (int) – Length of seasonality

  • seasonality_sm_input (float) – float value between [0, 1], applicable only if seasonality > 1. A larger value puts more weight on the current seasonality. If None, the model will estimate this value.

  • level_sm_input (float) – float value between [0.0001, 1]. A larger value puts more weight on the current level. If None, the model will estimate this value.

  • regressor_col (list) – Names of regressor columns, if any

  • regressor_sign (list) – list with values { ‘+’, ‘-’, ‘=’ } such that ‘+’ indicates regressor coefficient estimates are constrained to [0, inf). ‘-’ indicates regressor coefficient estimates are constrained to (-inf, 0]. ‘=’ indicates regressor coefficient estimates can be any value between (-inf, inf). The length of regressor_sign must be the same length as regressor_col. If None, all elements of list will be set to ‘=’.

  • regressor_beta_prior (list) – list of prior float values for regressor coefficient betas. The length of regressor_beta_prior must be the same length as regressor_col. If None, use non-informative priors.

  • regressor_sigma_prior (list) – list of prior float values for regressor coefficient sigmas. The length of regressor_sigma_prior must be the same length as regressor_col. If None, use non-informative priors.

  • regression_penalty ({ 'fixed_ridge', 'lasso', 'auto_ridge' }) – regression penalty method

  • lasso_scale (float) – float value between [0, 1], applicable only if regression_penalty == ‘lasso’

  • auto_ridge_scale (float) – float value between [0, 1], applicable only if regression_penalty == ‘auto_ridge’

  • slope_sm_input (float) – float value between [0, 1]. A larger value puts more weight on the current slope. If None, the model will estimate this value.

  • estimator (string; {'stan-mcmc', 'stan-map', 'pyro-svi'}) – default to be ‘stan-mcmc’.

  • response_col (str) – Name of response variable column, default ‘y’

  • date_col (str) – Name of date variable column, default ‘ds’

  • n_bootstrap_draws (int) – Number of samples to bootstrap in order to generate the prediction interval. For full Bayesian and variational inference forecasters, samples are drawn directly from original posteriors. For point-estimated posteriors, it will be used to sample noise parameters. When -1 or None supplied, full Bayesian and variational inference forecasters will assume number of draws equal the size of original samples while point-estimated posteriors will mute the draw and output prediction without interval.

  • prediction_percentiles (list) – List of integers of prediction percentiles that should be returned on prediction. To avoid reporting any confident intervals, pass an empty list

  • **kwargs – additional arguments passed into orbit.estimators.stan_estimator or orbit.estimators.pyro_estimator

orbit.models.dlt module

orbit.models.dlt.DLT(seasonality=None, seasonality_sm_input=None, level_sm_input=None, regressor_col=None, regressor_sign=None, regressor_beta_prior=None, regressor_sigma_prior=None, regression_penalty='fixed_ridge', lasso_scale=0.5, auto_ridge_scale=0.5, slope_sm_input=None, period=1, damped_factor=0.8, global_trend_option='linear', global_cap=1.0, global_floor=0.0, forecast_horizon=1, estimator='stan-mcmc', **kwargs)
Parameters
  • seasonality (int) – Length of seasonality

  • seasonality_sm_input (float) – float value between [0, 1], applicable only if seasonality > 1. A larger value puts more weight on the current seasonality. If None, the model will estimate this value.

  • level_sm_input (float) – float value between [0.0001, 1]. A larger value puts more weight on the current level. If None, the model will estimate this value.

  • regressor_col (list) – Names of regressor columns, if any

  • regressor_sign (list) – list with values { ‘+’, ‘-’, ‘=’ } such that ‘+’ indicates regressor coefficient estimates are constrained to [0, inf). ‘-’ indicates regressor coefficient estimates are constrained to (-inf, 0]. ‘=’ indicates regressor coefficient estimates can be any value between (-inf, inf). The length of regressor_sign must be the same length as regressor_col. If None, all elements of list will be set to ‘=’.

  • regressor_beta_prior (list) – list of prior float values for regressor coefficient betas. The length of regressor_beta_prior must be the same length as regressor_col. If None, use non-informative priors.

  • regressor_sigma_prior (list) – list of prior float values for regressor coefficient sigmas. The length of regressor_sigma_prior must be the same length as regressor_col. If None, use non-informative priors.

  • regression_penalty ({ 'fixed_ridge', 'lasso', 'auto_ridge' }) – regression penalty method

  • lasso_scale (float) – float value between [0, 1], applicable only if regression_penalty == ‘lasso’

  • auto_ridge_scale (float) – float value between [0, 1], applicable only if regression_penalty == ‘auto_ridge’

  • slope_sm_input (float) – float value between [0, 1]. A larger value puts more weight on the current slope. If None, the model will estimate this value.

  • period (int) – Used to set time_delta as 1 / max(period, seasonality). If None and no seasonality, then time_delta == 1

  • damped_factor (float) – Hyperparameter float value between [0, 1]. A smaller value further dampens the previous global trend value. Default, 0.8

  • global_trend_option ({ 'linear', 'loglinear', 'logistic', 'flat'}) – Transformation function for the shape of the forecasted global trend.

  • global_cap (float) – Maximum value of global logistic trend. Default is set to 1.0. This value is used only when global_trend_option = ‘logistic’

  • global_floor (float) – Minimum value of global logistic trend. Default is set to 0.0. This value is used only when global_trend_option = ‘logistic’

  • estimator (string; {'stan-mcmc', 'stan-map'}) – default to be ‘stan-mcmc’.

  • response_col (str) – Name of response variable column, default ‘y’

  • date_col (str) – Name of date variable column, default ‘ds’

  • n_bootstrap_draws (int) – Number of samples to bootstrap in order to generate the prediction interval. For full Bayesian and variational inference forecasters, samples are drawn directly from original posteriors. For point-estimated posteriors, it will be used to sample noise parameters. When -1 or None supplied, full Bayesian and variational inference forecasters will assume number of draws equal the size of original samples while point-estimated posteriors will mute the draw and output prediction without interval.

  • prediction_percentiles (list) – List of integers of prediction percentiles that should be returned on prediction. To avoid reporting any confident intervals, pass an empty list

  • **kwargs – additional arguments passed into orbit.estimators.stan_estimator

orbit.models.ktrlite module

orbit.models.ktrlite.KTRLite(level_knot_scale=0.1, level_segments=10, level_knot_distance=None, level_knot_dates=None, seasonality=None, seasonality_fs_order=None, seasonality_segments=2, seasonal_initial_knot_scale=1.0, seasonal_knot_scale=0.1, degree_of_freedom=30, date_freq=None, estimator='stan-map', **kwargs)
Parameters
  • level_knot_scale (float) – sigma for level; default to be .1

  • level_segments (int) – the number of segments partitioned by the knots of level (trend)

  • level_knot_distance (int) – the distance between every two knots of level (trend)

  • level_knot_dates (array like) – list of pre-specified dates for the level knots

  • seasonality (int, or list of int) – multiple seasonality

  • seasonality_fs_order (int, or list of int) – fourier series order for seasonality

  • seasonality_segments (int) – the number of segments partitioned by the knots of seasonality

  • seasonal_initial_knot_scale (float) – scale parameter for seasonal regressors initial coefficient knots; default to be 1

  • seasonal_knot_scale (float) – scale parameter for seasonal regressors drift of coefficient knots; default to be 0.1.

  • degree_of_freedom (int) – degree of freedom for error t-distribution

  • date_freq (str) – date frequency; if not supplied, pd.infer_freq will be used to imply the date frequency.

  • estimator (string; {'stan-map'}) –

  • response_col (str) – Name of response variable column, default ‘y’

  • date_col (str) – Name of date variable column, default ‘ds’

  • n_bootstrap_draws (int) – Number of samples to bootstrap in order to generate the prediction interval. For full Bayesian and variational inference forecasters, samples are drawn directly from original posteriors. For point-estimated posteriors, it will be used to sample noise parameters. When -1 or None supplied, full Bayesian and variational inference forecasters will assume number of draws equal the size of original samples while point-estimated posteriors will mute the draw and output prediction without interval.

  • prediction_percentiles (list) – List of integers of prediction percentiles that should be returned on prediction. To avoid reporting any confident intervals, pass an empty list

  • **kwargs – additional arguments passed into orbit.estimators.stan_estimator

Module contents