R_w_ma | R Documentation |

Procedure `R_w_ma`

computes the covariance matrix of the moving average
part of a PARMA sequence.
This is used in maximum likelihood estimation in conjunction with
the Ansley transformation method of computing the likelihood
of the sample conditioned on the firt `m = max(p; q)`

samples being ignored (or set to null); see Ansley or Brockwell and Davis for
background on the procedure. The method avoids the cumbersome calculation of
full covariance matrix.

```
R_w_ma(theta, nstart, nlen)
```

`theta` |
matrix of size |

`nstart` |
starting time, for conditional likelihood in PARMA set to |

`nlen` |
size of the covariance matrix. |

Procedure `R_w_ma`

implements calculation of covariance matrix of size `nlen-p`

from the parameters `theta`

and `phi`

of PARMA sequence.
The result is returned as two vectors, first containing non-zero
elements of covariance matrix and the second containing indexes of this parameters.
Using these vectors covariance matrix can be easily reconstructed.

procedure returns covariance matrix in sparse format as following:

`R` |
vector of non-zero elements of covariance matrix. |

`rindex` |
vector of indexes of non-zero elements. |

Harry Hurd

Ansley, (1979), An algorithm for the exact likelihood of a mixed autregressive moving average process, Biometrika, v.66, pp.59-65.

Brockwell, P. J., Davis, R. A. (1991), Time Series: Theory and Methods, 2nd Ed., Springer: New York.

`loglikec`

, `loglikef`

```
T=12
nlen=480
p=2
a=matrix(0,T,p)
q=1
b=matrix(0,T,q)
a[1,1]=.8
a[2,1]=.3
phia<-ab2phth(a)
phi0=phia$phi
phi0=as.matrix(phi0)
b[1,1]=-.7
b[2,1]=-.6
thetab<-ab2phth(b)
theta0=thetab$phi
theta0=as.matrix(theta0)
del0=matrix(1,T,1)
R_w_ma(cbind(del0,theta0),p+1,T)
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.