* * Example from section 9.6 * Approximate methods for modelling stochastic volatility * ??? Parameterization??? * open data sv.dat data(format=free,skip=1) 1 945 xrate * set ysq = log(xrate**2)+log(2)-%digamma(1) * nonlin phi sw sv logsigsq compute phi=.9,sw=.011,sv=1.0 dlm(method=bfgs,y=ysq-logsigsq,a=phi,c=1.0,sw=sw,sv=sv,$ sx0=sw/(1-phi**2),type=smooth) 1 945 states * set stderr = exp(.5*states(t)(1)) graph(footer="Figure 9.12 Estimated volatility for the Pound Series") # stderr * nonlin phi gamma sw sv dlm(method=bfgs,y=ysq,a=phi,z=gamma,c=1.0,sw=sw,sv=sv,$ sx0=sw/(1-phi**2),x0=gamma/(1-phi),type=smooth) 1 945 states * set stderr = exp(.5*states(t)(1)) graph(footer="Figure 9.12 Estimated volatility for the Pound Series") # stderr