Displaying 20 results from an estimated 10000 matches similar to: "Help with acf"
2006 Nov 13
1
bug in acf (PR#9360)
Full_Name: Ian McLeod
Version: 2.3.1
OS: Windows
Submission from: (NULL) (129.100.76.136)
> There is a simple bug in acf as shown below:
>
> z <- 1
> acf(z,lag.max=1,plot=FALSE)
> Error in acf(z, lag.max = 1, plot = FALSE) :
> 'lag.max' must be at least 1
>
This is certainly a bug.
There are two problems:
(i) the error message is wrong since lag.max is
2011 Nov 05
1
acf?
I started to check what I thought I knew with autocovariance and it doesn’t
jive with the the calculations given by ‘R’. I was wondering if there is
some scaling or something that I am not aware of.
Take the example
Ø d <- 1:10
Ø (a <- acf(d, type="covariance", demean=FALSE, plot=FALSE))
Autocovariances of series ‘d’, by lag
0 1 2 3 4 5 6
2009 Jun 02
2
variance does not equal serial covariance of lag zero?
Dear all,
Does this make any sense:
var() = cov() != acf(lag.max=0, type="covariance")?
I have daily data of IBM for May 2005, and I'm using the logarithmic return:
> ibm200505$LRAdj.Close
[1] NA 0.0203152 0.0005508 -0.0148397 -0.0025182 0.0092025
-0.0013889
[8] 0.0098196 -0.0103757 -0.0274917 0.0005716 -0.0159842 -0.0074306
0.0091710
[15] 0.0002898 0.0226306
2005 Nov 28
3
How Can I change the acf's plot type?
In the R Document, the usage of the acf() is as follow:
acf(x, lag.max = NULL,
type = c("correlation", "covariance", "partial"),
plot = TRUE, na.action = na.fail, demean = TRUE, ...)
But now I want to get the result picture like:
plot(x,type="l")
or
plot(x,type="p")
How can I do this with acf function?
仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭仭佒伮
伬侎仯仭
2010 Dec 08
1
Newbie trying to understand $ so I can understand acf function in stats
I am trying to understand the function acf
stats:::acf shows me the function
I am having trouble understanding the usage "$acf" in the following
acf <- array(.C(R_acf, as.double(x), as.integer(sampleT),
as.integer(nser), as.integer(lag.max), as.integer(type ==
"correlation"), acf = double((lag.max + 1L) * nser *
nser), NAOK =
2005 May 12
3
acf problem ?
Hi
I'm getting the following error that do not make sense to me, what am
Idoing wrong ?
> acf(Recsim[1,], lag.max=1)
Error in acf(Recsim[1, ], lag.max = 1) : 'lag.max' must be at least 1
Regards
EJ
2003 Dec 02
1
Help with this topic
Dear ladies and gentlemen,
I would like to calculate autocovarinace and cross-covariance scores 1,
2 and 3 of four classes A, B, C and D. I am using acf and ccf from time
sires library. My problem is that I can not separate my data among the
classes A, B, C and D. When I calculated acf for Score 1, I got a wrong
result. The reason being that instead of using ony 60, 40 and 20, the
program
2006 Oct 02
1
CCF and ACF
Dear all,
given two numeric vectors x and y, the ACF(x) at lag k is
cor(x(t),x(t+k)) while the CCF(x,y) at lag k is cor(x(t),y(t-k)). See
below for a simple example.
> set.seed(1)
> x <- rnorm(10)
> y <- rnorm(10)
> x
[1] -0.6264538 0.1836433 -0.8356286 1.5952808 0.3295078 -0.8204684
0.4874291 0.7383247 0.5757814 -0.3053884
> y
[1] 1.51178117 0.38984324
2004 Mar 09
2
corARMA and ACF in nlme
Hi R-sters,
Just wondering what I might be doing wrong. I'm trying to fit a multiple
linear regression model, and being ever mindful about the possibilities of
autocorrelation in the errors (it's a time series), the errors appear to
follow an AR1 process (ar(ts(glsfit$residuals)) selected order 1). So,
when I go back and try to do the simultaneous regression and error fit with
gls,
2011 Aug 25
1
Autocorrelation using acf
Dear R list
As suggested by Prof Brian Ripley, I have tried to read acf literature. The main problem is I am not the statistician and hence have some problem in understanding the concepts immediately. I came across one literature (http://www.stat.nus.edu.sg/~staxyc/REG32.pdf) on auto-correlation giving the methodology. As per that literature, the auto-correlation is arrived at as per following.
2012 Dec 30
1
acf () and pacf()
I have used acf() and pacf() in R to get the acf and pacf values at
max/lag=20
but the output did not show the values associated with lag numbers. lag
numbers is shown in decimals.
--
Rashid Ameer
View my recent publication at
*
http://www.emeraldinsight.com/fwd.htm?id=aob&ini=aob&doi=10.1108/17538391211282854
*
Details for my works are available directly at
2010 Apr 29
1
a question on autocorrelation acf
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 autocorrelation of a sine function should give a
cosine; however, the following code gives a
2001 Nov 19
2
acf mis-feature (PR#1177)
Full_Name: Hiroyuki Kawakatsu
Version: 1.3.1
OS: win2k
Submission from: (NULL) (130.158.140.105)
the lag labels in the acf plot is screwed when the ts frequency>1.
try, for example,
#acf mis-feature
x <- ts(rnorm(200), frequency=4);
acf(x,lag.max=24);
h.
> version
_
platform i386-pc-mingw32
arch x86
os Win32
system x86, Win32
2006 Mar 23
2
Default lag.max in ACF
Hi,
The default value for lag.max in ACF implementation is 10*log10(N)
There several publications recommending setting lag.max to:
- N/4 (Box and Jenkins, 1970; Chatfield, 1975; Anderson, 1976;
Pankratz, 1983; Davis, 1986; etc.)
- sqrt(N)+10 (Cryer, 1986)
- 20<=N<=40 (Brockwell and Davis)
Why R uses 10*log10(N) as a default?
Please, give me a reference to a book or article where the
2008 Jan 17
1
acf lag1 value
Hi R,
I have doubt.
>x= c(4,5,6,3,2,4,5)
>acf(x,plot=F,lag.max=1)
Autocorrelations of series 'x', by lag
0 1
1.000 0.182
But if I actually calculate the autocorrelation at lag1 I get,
>cor(x[-1],x[-length(x)])
[1] 0.1921538
Even in excel I get 0.1921538 value. So, I want to know what the 'acf'
function is calculating here....
2006 Oct 28
1
labelling of horizontal axis in acf function
this one is not a false alarm like my previous message.
i have cut and paste the code below so if anyone could run it would be
appreciated. basically,
my question is why the horizontal axis of the acf plot is labelled with
such huge numbers when
the labels should be 1 through 10 since may lag.max = 10 ?
i looked at the cdoe of acf but it was pretty much beyond me. i think it
has something to
2010 Apr 17
2
interpreting acf plot
Hello,
I am attending a course in Computational Statistics at ETH and in one of the assignments I am asked to prove that a time series is not autocorrelated using the R function "acf".
I tried out the acf function with the given data, according to what I found here: http://landshape.org/enm/options-for-acf-in-r/ this test data does not look IID but rather shows some trends so how can I
2010 Apr 26
1
Why am I getting different results from cor VS ccf ?
Hi all,
I am getting different results from ccf and cor,
Here is a simple example:
set.seed(100)
N <- 100
x1 <- sample(N)
x2 <- x1 + rnorm(N,0,5)
ccf(x1,x2)$acf[ccf(x1,x2)$lag == -1]
cor(x1[-N], x2[-1])
Results:
> ccf(x1,x2)$acf[ccf(x1,x2)$lag == -1]
[1] -0.128027
> cor(x1[-N], x2[-1])
[1] -0.1301427
Thanks,
Tal
----------------Contact
2006 Aug 18
3
Query: how to modify the plot of acf
I need to modify the graph of the autocorrelation. I tried to do it through plot.acf but with no success.
1. I would like to get rid of the lag zero
2. I would like to have numbers on the x-axis only at lags 12, 24, 36, 48, 60, ...
Could anybody help me in this?
Any help will be appreciated
Thank you for your attention
Stefano
[[alternative HTML version deleted]]
2008 Nov 20
1
different ACF results
Dear all,
I have one Model (M3) fitted using the lme package, and I have
checked the correlation structure of within-group errors using
plot(ACF (M3,maxLag=10),alpha=0.05)
But now I am not sure how to interpret this plot for the empirical
autocorrelation function.
The problem is that I am used to see/interpret diagrams in which all
the autocorrelation Lags, except lag-1, are inside the