MODEL Procedure

Example 24.17 Simulated Method of Moments—Stochastic Volatility Model

(View the complete code for this example.)

This example illustrates how to use SMM to estimate a stochastic volatility model as in Andersen and Sorensen (1996):

StartLayout 1st Row 1st Column y Subscript t 2nd Column equals 3rd Column sigma Subscript t Baseline z Subscript t 2nd Row 1st Column l o g left-parenthesis sigma Subscript t Superscript 2 Baseline right-parenthesis 2nd Column equals 3rd Column a plus b l o g left-parenthesis sigma Subscript t minus 1 Superscript 2 Baseline right-parenthesis plus s u Subscript t 3rd Row 1st Column left-parenthesis z Subscript t Baseline comma u Subscript t Baseline right-parenthesis 2nd Column tilde 3rd Column i i d upper N left-parenthesis 0 comma upper I 2 right-parenthesis EndLayout

This model is widely used in modeling the return process of stock prices and foreign exchange rates. This is called the stochastic volatility model because the volatility is stochastic as the random variable u Subscript t appears in the volatility equation. The following SAS statements use three moments: absolute value, the second-order moment, and absolute value of the first-order autoregressive moment. Note the ADJSMMV option in the FIT statement to request the SMM covariance adjustment for the parameter estimates. Although these moments have a closed form solution as shown by Andersen and Sorensen (1996), the simulation approach significantly simplifies the moment conditions.

%let nobs=1000;
data _tmpdata;
   a = -0.736; b=0.9; s=0.363;
   ll=sqrt( exp(a/(1-b)));;
   do i=-10 to &nobs;
      u = rannor( 101 );
      z = rannor( 101 );
      lnssq = a+b*log(ll**2) +s*u;
      st = sqrt(exp(lnssq));
      ll = st;
      y = st * z;
      if i > 0 then output;
   end;
run;

title1 'Simulated Method of Moments for Stochastic Volatility Model';

proc model data=_tmpdata ;
   parms a b .5 s 1;
   instrument / intonly;

   u = rannor( 8801 );
   z = rannor( 9701 );
   lsigmasq = xlag(sigmasq,exp(a));
   lnsigmasq = a + b * log(lsigmasq) + s * u;
   sigmasq = exp( lnsigmasq );

   ysim = sqrt(sigmasq) * z;
   eq.m1 = abs(y) - abs(ysim);
   eq.m2 = y**2 - ysim**2;
   eq.m5 = abs(y*lag(y))-abs(ysim*lag(ysim));

   fit m1 m2 m5 / gmm npreobs=10 ndraw=10 adjsmmv;
   bound s > 0, 1 > b > 0;
run;

The output of the MODEL procedure is shown in Output 24.17.1.

Output 24.17.1: PROC MODEL Output

Simulated Method of Moments for Stochastic Volatility Model

The MODEL Procedure

Model Summary
Parameters 3
Equations 3
Number of Statements 10
Program Lag Length 1

Parameters(Value) a b(0.5) s(1)
Equations m1 m2 m5

The 3 Equations to Estimate
m1 = F(a, b, s)
m2 = F(a, b, s)
m5 = F(a, b, s)
Instruments 1

Nonlinear GMM Parameter Estimates
Parameter Estimate Approx Std Err t Value Approx
Pr > |t|
a -2.2299 1.1357 -1.96 0.0499
b 0.695469 0.1554 4.47 <.0001
s 0.747779 0.1648 4.54 <.0001


Last updated: June 19, 2025