sts_semi_local_linear_trend | R Documentation |
Like the sts_local_linear_trend
model, a semi-local linear trend posits a
latent level
and slope
, with the level component updated according to
the current slope plus a random walk:
sts_semi_local_linear_trend( observed_time_series = NULL, level_scale_prior = NULL, slope_mean_prior = NULL, slope_scale_prior = NULL, autoregressive_coef_prior = NULL, initial_level_prior = NULL, initial_slope_prior = NULL, constrain_ar_coef_stationary = TRUE, constrain_ar_coef_positive = FALSE, name = NULL )
observed_time_series |
optional |
level_scale_prior |
optional |
slope_mean_prior |
optional |
slope_scale_prior |
optional |
autoregressive_coef_prior |
optional |
initial_level_prior |
optional |
initial_slope_prior |
optional |
constrain_ar_coef_stationary |
if |
constrain_ar_coef_positive |
if |
name |
the name of this model component. Default value: 'SemiLocalLinearTrend'. |
level[t] = level[t-1] + slope[t-1] + Normal(0., level_scale)
The slope component in a sts_semi_local_linear_trend
model evolves according to
a first-order autoregressive (AR1) process with potentially nonzero mean:
slope[t] = (slope_mean + autoregressive_coef * (slope[t-1] - slope_mean) + Normal(0., slope_scale))
Unlike the random walk used in LocalLinearTrend
, a stationary
AR1 process (coefficient in (-1, 1)
) maintains bounded variance over time,
so a SemiLocalLinearTrend
model will often produce more reasonable
uncertainties when forecasting over long timescales.
an instance of StructuralTimeSeries
.
For usage examples see sts_fit_with_hmc()
, sts_forecast()
, sts_decompose_by_component()
.
Other sts:
sts_additive_state_space_model()
,
sts_autoregressive_state_space_model()
,
sts_autoregressive()
,
sts_constrained_seasonal_state_space_model()
,
sts_dynamic_linear_regression_state_space_model()
,
sts_dynamic_linear_regression()
,
sts_linear_regression()
,
sts_local_level_state_space_model()
,
sts_local_level()
,
sts_local_linear_trend_state_space_model()
,
sts_local_linear_trend()
,
sts_seasonal_state_space_model()
,
sts_seasonal()
,
sts_semi_local_linear_trend_state_space_model()
,
sts_smooth_seasonal_state_space_model()
,
sts_smooth_seasonal()
,
sts_sparse_linear_regression()
,
sts_sum()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.