The model of the following form is fit to the data:
$$y_t = \mu + \alpha y_{t-1} + \epsilon$$
Where \(\epsilon \sim \mathcal{N}(0,\sigma^2)\) and \(t\) indexes the time step.
A time series is stationary, and predictable, when \(|\alpha|< 1\). Stationarity can be enforced, using the argument setting stationary = TRUE
. This setting utilizes the priors \(p(\alpha) \sim \mathcal{N}\)(0, 1000) truncated at (-1,1), and \(p(\mu) \sim \mathcal{N}\)(0, var(y)*100
) for inference, producing a posterior distribution for \(\alpha\) constrained to be within (-1,1).
When fitting a model where stationarity is not enforced, the Jeffreys prior of \(p(\mu,\alpha)\propto 1\) is used.
The Jeffreys prior of \(p(\sigma^2)\propto 1/\sigma^2\) is used for all inference of \(\sigma^2\)
A stationary time series will have an expected value of:
$$\frac{\mu}{1-\alpha}$$
Samples of this expectation are included in the output if stationary = TRUE
or if none of the samples of \(\alpha\) lie outside of (-1,1).
The output list is a BMB
object, passing the output to plot.BayesMassBal
allows for observation of the results.