'Heavy-tailed density: outlier in gas consumption. 'Ref: Durbin and Koopman (2012) page 318 'Open the workfile wfopen ".\EViews Addins\sspacetdist\gas_data.wf1" 'Put the model into state space form and estimate in Gaussian form sspace ss_gas ss_gas.append @signal gas = trend + season + [var=exp(c(1))] ss_gas.append @state trend = trend(-1) + dtrend(-1) ss_gas.append @state dtrend = dtrend(-1) + [var=exp(c(2))] ss_gas.append @state season = -season(-1)-season1(-1)-season2(-1) + [var=exp(c(3))] ss_gas.append @state season1 = season(-1) ss_gas.append @state season2 = season1(-1) ss_gas.append param c(1) .0 c(2) .0 c(3) .0 smpl 1960q1 1986q4 ss_gas.ml(optmethod=legacy) show ss_gas 'Get smoothed estimates of seasonal and irregular components - Gaussian Model ss_gas.makestates(t=smooth) *_sm1 ss_gas.makesignals(t=disturb) disturb1 'Estimate the model via add-in ss_gas.sspacetdist(iters=50,delta=1e-02,adjsave) show ss_gas_new 'Get smoothed estimates of seasonal and irregular components - Student's T Model ss_gas_new.makestates(t=smooth) *_sm2 ss_gas_new.makesignals(t=disturb) disturb2 'Group variables and draw the chart. Please note that you'll have to adjust the scale of third graph manually. group output.add season_sm1 season_sm2 disturb1 disturb2 freeze(mode=overwrite,chart) output.line(m)