Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting the confidence interval in acf plots

Tags:

r

time-series

I plotted the autocorrelation function of a given set of residuals I obtained from estimating a linear regression model:

> require("stats")
> acf(Reg$residuals)

It resulted in the following graphic:

acf plot

I then wanted to look up what kind of confidence interval (95%, 99%) is displayed, but there is no information on that within the help section of the function. In addition to that I could not find a way to adjust the confidence interval manually.

Is there a way to manually set the confidence interval displayed?

like image 964
shenflow Avatar asked Oct 23 '25 19:10

shenflow


1 Answers

See ?plot.acf:

plot(x, ci = 0.95, ...)

and:

ci: coverage probability for confidence interval. Plotting of the confidence interval is suppressed if ci is zero or negative.

That is, the default is 95% confidence intervals, and e.g.:

plot(acf(Reg$residuals), ci = 0.99)

should plot the 99% confidence intervals.

like image 81
Ben Bolker Avatar answered Oct 26 '25 09:10

Ben Bolker



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!