ar_analysis

ar_analysis(
    data,
    order_p=1,
    include_intercept=True,
    training_time_steps=None,
    forecasting_time_steps=0,
    sampler='DEMCz',
    iterations=3000,
    output_length=10000,
    credible_level=0.9,
    seed=12345,
    thinning_interval=-1,
)

Bayesian autoregressive AR(p) time-series analysis.

Fit an AR(order_p) model to the observed series data and return the posterior forecast curve and credible band.

Parameters

Name Type Description Default
data array_like Observed time series. required
order_p int Autoregressive order p. 1
include_intercept bool Include an intercept term. True
training_time_steps int Number of training time steps. Defaults to the model’s own default (max(30, floor(0.8 * n))), which is invalid for short series – set it explicitly (e.g. 15) when n is small. None
forecasting_time_steps int Extends the forecast horizon past the observed series. 0
sampler ('DEMCz', 'DEMCzs', 'ARWMH', 'NUTS') MCMC sampler. "DEMCz"
iterations int Number of post-warmup MCMC iterations. 3000
output_length int Number of posterior samples used to build the credible band. 10000
credible_level float Credible-interval width. 0.90
seed int PRNG seed for the sampler. 12345
thinning_interval int MCMC thinning interval; -1 keeps the sampler’s own default. -1

Returns

Name Type Description
dict The same shape as univariate_analysis: parameters, mode_curve, mean_curve, lower_ci, upper_ci, aic, bic, dic, rmse.

See Also

univariate_analysis, ma_analysis, arima_analysis, arimax_analysis