I'm learning time series and following this tutorial
When it comes to simulation, there are 2 types AR:
AR1: x1 = arima.sim(list(order=c(1,0,0), ar=.9), n=100)
AR2: x = arima.sim(list(order=c(2,0,0), ar=c(1,-.9)), n=100)
The value in ar
is called phi. But I don't know what is it? In AR2, there are 2 values in ar
, do you know why?
Best Answer
The AR(1) model is usually written as:
$$Y_{t}=c+\phi Y_{{t-1}}+\varepsilon_{t}\,,$$
or in mean-corrected form as
$$Y_{t}-\mu=\phi (Y_{{t-1}}-\mu)+\varepsilon_{t}\,.$$
(For example, see Wikipedia's Autoregressive Model - Example: an AR(1) process. )
That symbol $\phi$ is "phi", and this is where the "phi" comes from in that list.
Similarly the AR(2) model is usually written as:
$$Y_{t}=c+\phi_1 Y_{{t-1}}+\phi_2 Y_{{t-2}}+\varepsilon_{t}\,,$$
or
$$Y_{t}-\mu=\phi_1 (Y_{{t-1}}-\mu)+\phi_2 (Y_{{t-2}}-\mu)+\varepsilon_{t}\,.$$
The two phi parameters there are why there are two values in
ar
.(For example see Wikipedia's Autoregressive model - Definition.)