[R] acf and pacf plot

Prof Brian Ripley ripley at stats.ox.ac.uk
Sat Apr 28 06:26:14 CEST 2007


On Fri, 27 Apr 2007, tom soyer wrote:

> Thanks Eric!
>
> I also noticed that in R, acf returns ac at lag 0, while pacf does not (pac
> for pacf starts at lag 1). Do you know if there is a good reason for that?
> Shouldn't ac at lag 0 always be 1?

No.  The acf is an autocovariance or autocorrelation function, depending 
on the arguments, and it is for multiple timeseries where the value at lag 
0 is the covariance/correlation matrix.


> On 4/27/07, Eric Thompson <ericthompso at gmail.com> wrote:
>>
>> The lines indicate the confidence interval (95% by default). I think
>> you mean that it is not documented in help(acf), but it directs you to
>> plot.acf in the "See Also" secion.
>>
>> From ?plot.acf:
>>
>> Note:
>>
>>     The confidence interval plotted in 'plot.acf' is based on an
>>     _uncorrelated_ series and should be treated with appropriate
>>     caution.  Using 'ci.type = "ma"' may be less potentially
>>     misleading.
>>
>> also see the description of the ci and ci.type arguments. As far as
>> HOW they are calculated, I believe that the default is
>>
>> qnorm(c(0.025, 0.975))/sqrt(n)
>>
>> And yes, I think that they are very important.
>>
>> Hope that helps.
>>
>> Eric
>>
>>
>> On 4/27/07, tom soyer <tom.soyer at gmail.com> wrote:
>>> Hi,
>>>
>>> I noticed that whenever I ran acf or pacf, the plot generated by R
>> always
>>> includes two horizontal blue doted lines. Furthermore, these two lines
>> are
>>> not documented in the acf documentation. I don't know what they are for,
>> but
>>> it seems that they are important. Could someone tell me what they are
>> and
>>> how are they calculated?
>>>
>>> Thanks,
>>>
>>> --
>>> Tom
>>>
>>>         [[alternative HTML version deleted]]
>>>
>>> ______________________________________________
>>> R-help at stat.math.ethz.ch mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>>> and provide commented, minimal, self-contained, reproducible code.
>>>
>>
>
>
>
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list