This function fits either an autoregressive (AR) or a periodic autoregressive (PAR) model and extract the estimates for the autoregressive or periodic autoregressive coefficients.
1 2  fit.ar.par (wts, type, detcomp, p)

wts 
a univariate time series object. 
type 
A character string indicating whether the model to fit is an autoregressive model,

detcomp 
deterministic components to include in the model. Three types of regressors can be included: regular deterministic components, seasonal deterministic components, and any regressor variable previously defined by the user. This argument must be a list object with the following elements:

p 
the lag order of the model. 
If type
is "AR"
the following model is estimated by ordinary least squares:
y_t = φ_{1} y_{t1} + φ_{2} y_{t2} + ... + φ_{p} y_{tp} + ε_t.
If type
is "PAR"
, the following model is estimated by ordinary least squares:
y_t = α_{1s} y_{t1} + α_{2s} y_{t2} + ... + α_{ps} y_{tp} + ε_t,
for s=1,...,S, where S
is the periodicity of the time series.
Deterministic components can be added to models above. Be careful when defining the detcomp
argument. To include an intercept and seasonal intercepts, or a regular trend with seasonal trends, will
cause multicollinearity problems.
A fit.partsmclass
class object reporting the estimates of the autoregressive or periodic
autoregressive coefficients. See fit.partsmclass
to check further information available
from this class via the methods show
and summary
.
Javier LopezdeLacalle javlacalle@yahoo.es.
P.H. Franses: Periodicity and Stochastic Trends in Economic Time Series (Oxford University Press, 1996).
fit.piartsmclass
, fit.partsmclass
, and PAR.MVreprmethods
.
1 2 3 4 5 6 7 8 9 10 11 12  ## Models for the the logarithms of the Real GNP in Germany.
data("gergnp")
lgergnp < log(gergnp, base=exp(1))
## Fit an AR(4) model with intercept and seasonal dummies.
detcomp < list(regular=c(1,0,c(1,2,3)), seasonal=c(0,0), regvar=0)
out.ar < fit.ar.par(wts=lgergnp, type="AR", detcomp=detcomp, p=4)
## Fit a PAR(2) model with seasonal intercepts.
detcomp < list(regular=c(0,0,0), seasonal=c(1,0), regvar=0)
out.par < fit.ar.par(wts=lgergnp, type="PAR", detcomp=detcomp, p=2)

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
Please suggest features or report bugs with the GitHub issue tracker.
All documentation is copyright its authors; we didn't write any of that.