ar2cor {INLAspacetime} | R Documentation |
Illustrative code to compute the auto-correlation for an AR2 model.
Description
Computes the auto-correlation.
Usage
ar2cor(a1, a2, k = 30)
Arguments
a1 |
the first auto-regression coefficient. |
a2 |
the second auto-regression coefficient. |
k |
maximum lag for evaluating the auto-correlation. |
Value
the autocorrelation as a vector or matrix, whenever a1
or a2
are
scalar or vector.
Details
Let the second order auto-regression model defined as
x_t + a_1 x_{t-1} + a_2 x_{t-2} = w_t
where w_t ~ N(0, 1)
.
See Also
Examples
plot(ar2cor(-1.7, 0.963), type = "o")
[Package INLAspacetime version 0.1.8 Index]