Displaying 1 result from an estimated 1 matches for "specden".
Did you mean:
spec'ed
2010 Oct 20
0
autoregressive functions
...I have calculated as follows:
(The vector q contain some testing numbers.)
> q <- c(28,28,26,19,16,24,26,24,24,29,29,27,31,26,38,23,13,14,28,19,19,17,22,2,4,5,7,8,14,14,23,23)
> N <- length(q)
> Fourier <- fft(q)/N
> Fourier2 <- ( Re(Fourier)^2 + Im(Fourier)^2) * 2
> SpecDen <- array(0,dim=c(0,N/2-1))
> for (i in 2:(N/2+1))
+ {
+ SpecDen[i-1] <- Fourier2[i]
+ }
> SpecDen[N/2] <- SpecDen[N/2]/2
> k <- c(1:(N/2))
> freq <- (N/k)^-1
> plot(freq,SpecDen, type="l", lwd=1, col="blue")
To check if this computation is corr...