Attached is code from Eviews 8.0 Example Files. Is there anybody who can explain evar, cov, ename? Thanks------------------------------------------------------------------------------
Cubic spline smoothing
The following program illustrates the use of the state-space object as a filtering/smoothing routine without estimating any parameters.
'cubic spline smooothing using sspace
'revised 3/7/2007
'change path to program path
%path = @runpath
cd %path
' load workfile
load nber
series y = m03054
smpl @first 42:06
'set smoothing parameter (signal-to-noise ratio)
!q = 0.005
'setup sspace
sspace ss1
ss1.append @signal y = sv1 + [var=1.0]
ss1.append @state sv1 = sv1(-1) + sv2(-1) + [ename=u1]
ss1.append @state sv2 = sv2(-1) + [ename=u2]
'c(1)*c(1) is the smoothing parameter (signal-to-noise ratio)
'ss1.append @evar cov(u1,u1)=c(1)*c(1)/3
'ss1.append @evar cov(u1,u2)=0.5*c(1)*c(1)
'ss1.append @evar cov(u2,u2)=c(1)*c(1)
ss1.append @evar cov(u1,u1)=!q/3
ss1.append @evar cov(u1,u2)=0.5*!q
ss1.append @evar cov(u2,u2)=!q
'parse (no parameters to estimate)
ss1.ml(d,m=100,c=1e-9)
'get smoothed estimate
ss1.makesignals(t=smooth) ys1
'get HP filtered series
!lambda = 14400
y.hpf(!lambda) ys2
'plot
graph graph1.line y ys1 ys2
graph1.setelem(1) legend(Actual)
graph1.setelem(2) legend(Cubic spline smoothing (q = !q))
graph1.setelem(3) legend(Hodrick-Prescott filter (lambda = !lambda))
graph1.legend position(.5,0) -inbox
graph1.options size(6,2)
show graph1


雷达卡



京公网安备 11010802022788号







