# Retrieving time series from a smoothed periodogram

If I were to smooth a periodogram and then filter out low level frequencies, how can I derive the filtered time series? For example, in the case of a non-smoothed periodogram: https://folk.uib.no/ngbnk/kurs/notes/node107.html

For example:

 ##MWE
set.seed(100)
funct <- vector(length=500)
for (t in 1:500) {

if(t>200&t<210){funct[t]<- sin(t*.1)+rnorm(1,0,.3)+rnorm(1,0,2)}else{funct[t]<- sin(t*.1)+rnorm(1,0,.3)}

}
plot(funct, type = "o")
spec.pgram(funct, log="no")

k<-kernel("daniell", 1)
a<- spec.pgram(funct,kernel=k, taper=5/10, log="no")

dstar <- vector(length=250)
for (t in 1:250) {
if(a$$spec[t]>10){dstar[t] <- a$$spec[t]}else{dstar[t]=0}
}
plot(dstar,type="o")   That is, how would I in this case retrieve the time series from the filtered (smoothed) spectral density?

• Could you describe what you mean by "retrieve"? It should be obvious you cannot reconstruct the original series exactly. Less obvious, perhaps, is that the periodogram gives you no information about the mean level of the original series, so that cannot be recovered either. This indicates your question needs some refinement: can you tell us more precisely which characteristics of the original series you are interested in "retrieving"? – whuber Mar 16 at 16:48
• You are right, I wasn't very clear - I do not want to retrieve the original time series but the "filtered" time series – BayesIsBaye Mar 16 at 22:27

You can NOT retrieve the time series from the filtered density and the reasons is the Heisenberg's Uncertainty Principle. In modelling time-frequency phenomena one cannot be simultaneously precise in time and frequency. Formally,

$$\Delta_f \Delta{\hat{f}} \geq \frac{1}{2}$$

where $$\Delta_f$$ is the spectral bandwidth and $$\Delta{\hat{f}}$$ the RMS duration of the bandwidth.

Note however that Wiener-Khinchin Theorem links the ACRF $$\rho (\tau)$$ of a stationary time series to the spectrum $$F(\omega)$$ via

$$\rho (\tau) = \int_{-\pi}^{\pi} e^{i \omega \tau}dF(\omega)$$

It can also be shown that

$$C_s = 4 \pi \int_{-\pi}^{\pi} I_N(\omega) e^{i s \omega}d \omega, \qquad I_N(\omega) \geq 0$$

where $$C_s = \frac{1}{N} \sum_{t=1}^{N-|s|}X_tX_{t+|s|}$$

and $$I_N(\omega)= \frac{2}{N} \left| \sum_{t=1}^{N}X_t e^{-\omega t}\right|^2$$ being the periodogram (assuming data have been mean deleted).

Hence using an estimate of the periodogram you can obtain an estimate of the ACRF. However the spectrum (and its estimate - the periodogram) does localise only frequencies (NOT time), hence locations in time are lost.

See below the smoothed periodogram of the original v.s. the shifted series. As you may see, smoothed periodogram remains identical, locations not kept (as we should have expected!).

I hope this demonstration now suffices. And another example. I am simulating and ARIMA process and then reversing it. You can see that both have got the same periodogram

    set.seed(100)
funct<- arima.sim(n = 500, list(ar = c(0.8897, -0.4858), ma = c(-0.2279, 0.2488)),
sd = sqrt(0.1796))

plot(funct, type="l")
spec.pgram(funct, log="no")

funct2 <- vector(length=500)
funct2[1:500] <- funct[500:1]
plot(funct2, type="l")
spec.pgram(funct2, log="no") • I updated the question, my wording was confusing - I do not aim to retrieve the original time series. – BayesIsBaye Mar 16 at 22:31
• Thanks but as I explained on my answer above, you can't retrieve any series (whether unfiltered or filtered) - you can invert spectral estimates in some way to get correlation estimates. – Stats Mar 16 at 23:07
• I see. Then how is i.imgur.com/WqQqhWk.png possible? – BayesIsBaye Mar 17 at 0:21
• for clarity, $I(\omega_{j})=|d(w_{j})|^{2}$ is the periodogram. $d(w_{j})$ is discrete fourier transform of the time series – BayesIsBaye Mar 17 at 1:12
• The equation on your link is essentially the Cramer representation of the series. It defines a process, it does NOT "retrieve" any series. I am modifying your data by changing only the location of series. See there, filtered periodogram remains identical. I did the same with a simulated arima process which I then reverted. See again, periodogram is identical. As mentioned, locations not kept on spectral analysis, just frequencies – Stats Mar 17 at 1:54