Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible error in autocov? #665

Closed
bgctw opened this issue Mar 1, 2021 · 1 comment
Closed

Possible error in autocov? #665

bgctw opened this issue Mar 1, 2021 · 1 comment

Comments

@bgctw
Copy link

bgctw commented Mar 1, 2021

In thinking how to compute the autocorrelation of a series with missings, I wondered whether the code of autocov is correct. To my understanding of the source code, the code estimates the E[(x1-mean(x1))(x2-mean(x2))] by using the dot function and afterwards dividing by lx = length(x), which is the length of the original series. However, to my understanding for lag k, the two vectors x1 and x2 being correlated are subsets of the original series of only length lx -k.

Hence, I think lines 73 and 90 in signalcorr.jl should be changed to
r[k] = _autodot(z, lx, lags[k]) / (lx -k)

What am I missing?

@andreasnoack
Copy link
Member

Please see #273

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants