Computing Autocovariances
Posted: Wed Mar 02, 2011 1:29 pm
Greetings,
I am trying to use RATS to compute the autocovariances of a series. I use
correlate(covariances, results=mycovs) myvar
I am wondering if you can tell me what formula this instruction uses to compute these autocovariances. I tried looking in the reference manual under "correlate" but could not find this formula.
One thing that seems suspect is that the lag 0 autocovariance does not match the variance displayed under the STAT instruction. Also, I computed the autocovariances myself, using the following for lag k (for series y of length N):
gamma(k) = (1/N-k-1) * \sum_{i=k+1}^{N} (y_i - ybar) (y_{i-k} - ybar)
My answers are somewhat close, but still different, than those computed by RATS.
(at lag 0 my answer does match the variance shown under the STAT instruction)
Thanks for your help,
- cap
I am trying to use RATS to compute the autocovariances of a series. I use
correlate(covariances, results=mycovs) myvar
I am wondering if you can tell me what formula this instruction uses to compute these autocovariances. I tried looking in the reference manual under "correlate" but could not find this formula.
One thing that seems suspect is that the lag 0 autocovariance does not match the variance displayed under the STAT instruction. Also, I computed the autocovariances myself, using the following for lag k (for series y of length N):
gamma(k) = (1/N-k-1) * \sum_{i=k+1}^{N} (y_i - ybar) (y_{i-k} - ybar)
My answers are somewhat close, but still different, than those computed by RATS.
(at lag 0 my answer does match the variance shown under the STAT instruction)
Thanks for your help,
- cap