Re: [R] a question on autocorrelation acf

2011-12-06 Thread Bazman76
http://r.789695.n4.nabble.com/file/n4164630/R_example.xlsx R_example.xlsx Hi there, I attach an excel file which I use to produce the data. It simulates a simple AR(1) process y_t=0.5y_{t-1}+z_t. In column E I have cut and paste values so that we can compare like with like. When I run the ac

Re: [R] a question on autocorrelation acf

2011-12-06 Thread R. Michael Weylandt
The code provided was the hard-to-find C part: there's also some R code involved that you can get in your console by typing acf without parentheses. I'm inclined to believe V&R over any Excel implementation (and I don't know what "pc" is) but perhaps you can provide a (small) data-set using the dp

Re: [R] a question on autocorrelation acf

2011-12-05 Thread Bazman76
Hi there, I have now cheked the results against pc give and the excel add-in poptools. Poptools and pc give get the same answer but R is quite different especially for the acf and pacf()? I looked at the book you recommended on p390 itshows the formulas and they look pretty standard. However lo

Re: [R] a question on autocorrelation acf

2011-12-05 Thread R. Michael Weylandt
Did you check the MASS reference given above in the thread? If you want to see the source, it's here: http://svn.r-project.org/R/trunk/src/library/stats/src/filter.c (best I can tell) Michael On Mon, Dec 5, 2011 at 2:24 PM, Bazman76 wrote: > Hi there, > > I am wondering how R calculates the acf

Re: [R] a question on autocorrelation acf

2011-12-05 Thread Bazman76
Hi there, I am wondering how R calculates the acf too? I have a data set of approx 1500 returns when I calculate the lag 1 autocorrelation in excel I get a value of -0.4 but in R its approximately -0.18? I have cross checked with PC give and PC give agrees with excel? I'm sure its just some kin

Re: [R] a question on autocorrelation acf

2010-04-30 Thread John Ramey
I think you are Googling the wrong "reference." Note in ?acf the following: References: Venables, W. N. and Ripley, B. D. (2002) _Modern Applied Statistics with S_. Fourth Edition. Springer-Verlag. (This contains the exact definitions used.) On Fri, Apr 30, 2010 at 10:42 AM, z

Re: [R] a question on autocorrelation acf

2010-04-30 Thread zhenjiang xu
Thanks, Duncan, but there are no reference in ?acf. The only probably related stuff is "Author(s): Original: Paul Gilbert, Martyn Plummer. Extensive modifications and univariate case of 'pacf' by B.D. Ripley." And I didn't find anything with google search of it. On Thu, Apr 29, 2010

Re: [R] a question on autocorrelation acf

2010-04-29 Thread Duncan Murdoch
On 29/04/2010 6:22 PM, zhenjiang xu wrote: Hi R users, where can I find the equations used by acf function to calculate autocorrelation? See the reference listed in ?acf. Duncan Murdoch I think I misunderstand acf. Doesn't acf use following equation to calculate autocorrelation? [image: R(

[R] a question on autocorrelation acf

2010-04-29 Thread zhenjiang xu
Hi R users, where can I find the equations used by acf function to calculate autocorrelation? I think I misunderstand acf. Doesn't acf use following equation to calculate autocorrelation? [image: R(\tau) = \frac{\operatorname{E}[(X_t - \mu)(X_{t+\tau} - \mu)]}{\sigma^2}\, ,] If it does, then the a