FFT/IFT
-
atrad
FFT/IFT
I would like to obtain the covariogram from the periodogram for a time series. To do this I first use rtoc using twice the number of observations, then apply fft, followed by cmult(scale=1/2*%nobs) and then ift. This I scale by 1/2*%pi. I appear to obtain the covariogram but it seems to only start with the first autocovariance. Will I never obtain the contemporaneous variance this way?
Re: FFT/IFT
The covariance should be in entry 1. The only scaling needed in this sequence is 1.0/actual observations. The 1/(2pi) is rather specific to a final estimate of the spectral density. The following sequence computes the covariogram using frequency domain operations and gives the same results as the cross instruction with the covariances option.atrad wrote:I would like to obtain the covariogram from the periodogram for a time series. To do this I first use rtoc using twice the number of observations, then apply fft, followed by cmult(scale=1/2*%nobs) and then ift. This I scale by 1/2*%pi. I appear to obtain the covariogram but it seems to only start with the first autocovariance. Will I never obtain the contemporaneous variance this way?
Code: Select all
seed 3439
set x 1 100 = %ran(1.0)
diff(center) x / cx
freq 1 2*%freqsize(100)
rtoc
# cx
# 1
fft 1
cmult(scale=1.0/100.0) 1 1
ift 1
cprint 1 10 1
corr(covar,method=yule,number=9) cx