Learn R Programming

gmwmx2 (version 0.0.5)

ar1: AR(1) process (time_series_model)

Description

Constructs a time_series_model for a stationary AR(1) process with parameter phi and innovation variance sigma2. The model is \(X_t = \phi X_{t-1} + \varepsilon_t, \; \varepsilon_t \stackrel{\text{i.i.d.}}{\sim} N(0, \sigma^2)\). The autocovariance is \( \gamma(h) = \mathrm{cov}(X_t, X_{t+h}) = \frac{\sigma^2}{1 - \phi^2}\,\phi^{\lvert h \rvert} \).

Usage

ar1(phi = NULL, sigma2 = NULL)

Value

A time_series_model object.

Arguments

phi

AR(1) coefficient in (-1, 1).

sigma2

Innovation variance (> 0).

Examples

Run this code
mod <- ar1(phi = 0.8, sigma2 = 1)
mod

Run the code above in your browser using DataLab