MAllog {bayess} R Documentation

## log-likelihood associated with an MA(p) model

### Description

This function returns the numerical value of the log-likelihood associated with a time series and an MA(p) model in Chapter 7. It either uses the natural parameterisation of the MA(p) model

x_t-\mu = \varepsilon_t - \sum_{j=1}^p \psi_{j} \varepsilon_{t-j}

or the parameterisation via the lag-polynomial roots

x_t - \mu = \prod_{i=1}^p (1-\lambda_i B) \varepsilon_t

where B^j \varepsilon_t = \varepsilon_{t-j}.

### Usage

MAllog(p,dat,pr,pc,lr,lc,mu,sig2,compsi=T,pepsi=rep(0,p),eps=rnorm(p))


### Arguments

 p order of the MA model dat time series modelled by the MA(p) model pr number of real roots in the lag polynomial pc number of complex roots in the lag polynomial, necessarily even lr real roots lc complex roots, stored as real part for odd indices and imaginary part for even indices. (lc is either 0 when pc=0 or a vector of even length when pc>0.) mu drift parameter \mu such that (X_t-\mu)_t is a standard MA(p) series sig2 variance of the Gaussian white noise (\varepsilon_t)_t compsi boolean variable indicating whether the coefficients \psi_i need to be retrieved from the roots of the lag-polynomial (if TRUE) or not (if FALSE) pepsi potential coefficients \psi_i, computed by the function if compsi is TRUE eps white noise terms (\varepsilon_t)_{t\le 0} with negative indices

### Value

 ll  value of the log-likelihood ps  vector of the \psi_i's, similar to the entry if compsi is FALSE

ARllog, MAmh
MAllog(p=3,dat=faithful[,1],pr=3,pc=0,lr=rep(.1,3),lc=0,