Description Usage Arguments Value Author(s) Examples
These functions convert between the AR(p) coefficients phi
,
the partial autorcorrelation coefficients pacf
and the
autocorrelation function acf
.
The phi
-parameterization is the same as used for arima
-models in R
; see ?arima
and the parameter-vector a
in Details
.
1 2 3 4 | inla.ar.pacf2phi(pac)
inla.ar.phi2pacf(phi)
inla.ar.pacf2acf(pac, lag.max = length(pac))
inla.ar.phi2acf(phi, lag.max = length(phi))
|
pac |
The partial autorcorrelation coefficients |
phi |
The AR(p) parameters |
lag.max |
The maximum lag to compute the ACF for |
inla.ar.pacf2phi
returns phi
for given pacf
.
inla.ar.phi2pacf
returns pac
for given phi
.
inla.ar.phi2acf
returns acf
for given phi
.
inla.ar.pacf2acf
returns acf
for given pacf
.
Havard Rue hrue@r-inla.org
1 2 3 4 5 6 7 8 | pac = runif(5)
phi = inla.ar.pacf2phi(pac)
pac2 = inla.ar.phi2pacf(phi)
print(paste("Error:", max(abs(pac2-pac))))
print("Correlation matrix (from pac)")
print(toeplitz(inla.ar.pacf2acf(pac)))
print("Correlation matrix (from phi)")
print(toeplitz(inla.ar.phi2acf(phi)))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.