This function is related to Chapter 6 on dynamical models.
It returns the numerical value of the log-likelihood associated with a time
series and an AR(p) model, along with the natural coefficients \(psi\) of the AR(p) model
if it is defined via the roots lr
and lc
of the associated lag-polynomial.
The function thus uses either the natural parameterisation of the AR(p) model
$$x_t - \mu + \sum_{i=1}^p \psi_i (x_{t-i}-\mu) = \varepsilon_t$$
or the parameterisation via the lag-polynomial roots
$$\prod_{i=1}^p (1-\lambda_i B) x_t = \varepsilon_t$$
where \(B^j x_t = x_{t-j}\).
ARllog(p,dat,pr, pc, lr, lc, mu, sig2, compsi = TRUE, pepsi = c(1, rep(0, p)))
value of the log-likelihood
vector of the \(\psi_i\)'s
order of the AR\((p)\) model
time series modelled by the AR\((p)\) model
number of real roots
number of non-conjugate complex roots
real roots
complex roots, stored as real part for odd indices and imaginary part for even indices
drift coefficient \(\mu\) such that \((x_t-\mu)_t\) is a standard AR\((p)\) series
variance of the Gaussian white noise \((\varepsilon_t)_t\)
boolean variable indicating whether the coefficients \(\psi_i\) need to be retrievedfrom the roots of the lag-polynomial, i.e. if the model is defined by pepsi
(when compsi
is FALSE
) or by lr
and lc
(when compsi
is TRUE
).
potential p+1 coefficients \(\psi_i\) if compsi
is FALSE
, with 1 asthe compulsory first value
MAllog
,ARmh
ARllog(p=3,dat=faithful[,1],pr=3,pc=0,
lr=c(-.1,.5,.2),lc=0,mu=0,sig2=var(faithful[,1]),compsi=FALSE,pepsi=c(1,rep(.1,3)))
Run the code above in your browser using DataLab