* * FREQDESEASON.RPF * Frequency domain deseasonalization * open data oecdsample.rat calendar(m) 1960 * * Data are Canadian retail sales * data(format=rats) 1960:1 2007:3 canrett canretts * * Transform to logs and take the trend out * set logret = log(canrett) filter(type=hp) logret / removed set prepped = logret-removed * compute nords=2*%freqsize(2007:3) frequency 2 nords * rtoc # prepped # 1 fft 1 * * Create bands of width pi/16. Leave the low frequencies in. * cmask 2 / (nords/12) (nords/32) (nords/12)+1 cmult 1 2 ift 1 * * Send the deseasonalized data back, add back the removed trend and * exponentiate. * ctor 1960:1 %allocend() # 1 # deseason * set deseason = exp(deseason+removed) * * Graphs the deseasonalized series with the "officially" adjusted series. * graph 2 # canretts # deseason