MODEL Procedure

Example 24.19 EMM Estimation of a Stochastic Volatility Model

(View the complete code for this example.)

The efficient method of moments (EMM) (Bansal et al. 1993, 1995; Gallant and Tauchen 2001), can be considered a variant of SMM. The idea is to match the efficiency of the maximum likelihood (ML) estimation with the flexibility of the SMM procedure. ML itself can be interpreted as a method of moments procedure, where the score vector, the vector of derivatives of the log-likelihood function with respect to the parameters, provides the exactly identifying moment conditions. EMM employs an auxiliary (or pseudo) model that closely matches the true model. The score vector of the auxiliary model provides the moment conditions in the SMM step.

This example uses the SMM feature of PROC MODEL to estimate the simple stochastic volatility (SV) model of Example 24.17 with the EMM method.

Suppose that your data are the time series StartSet y 1 comma y 2 comma ellipsis comma y Subscript n Baseline EndSet, and the model that you want to estimate, or the structural model, is characterized by the vector of parameters bold-italic theta. For the SV model, bold-italic theta is given by left-parenthesis a comma b comma s right-parenthesis.

The first step of the EMM method is to fit the data with an auxiliary model (or score generator) that has transition density f left-parenthesis y Subscript t Baseline vertical-bar upper Y Subscript t minus 1 Baseline comma bold-italic eta right-parenthesis, parameterized by the pseudo parameter bold-italic eta, where upper Y Subscript t minus 1 Baseline equals StartSet y Subscript t minus 1 Baseline comma ellipsis comma y 1 EndSet. The auxiliary model must approximate the true data-generating process as closely as possible and be such that ML estimation is feasible.

The only identification requirement is that the dimension of the pseudo parameter bold-italic eta be greater than or equal to that of the structural parameter bold-italic theta.

Andersen, Chung, and Sorensen (1999) showed that the GARCH(1,1) is an appropriate auxiliary model that leads to a good performance of the EMM estimator for the SV model.

The analytical expression for the GARCH(1,1) model with mean zero is

StartLayout 1st Row 1st Column y Subscript t 2nd Column equals 3rd Column sigma Subscript t Baseline z Subscript t 2nd Row 1st Column sigma Subscript t Superscript 2 2nd Column equals 3rd Column omega plus alpha y Subscript t minus 1 plus beta sigma Subscript t minus 1 Superscript 2 EndLayout

The pseudo parameter vector bold-italic eta is given by left-parenthesis omega comma alpha comma beta right-parenthesis.

One advantage of such a class of models is that the conditional density of y Subscript t is Gaussian—that is,

f left-parenthesis y Subscript t Baseline vertical-bar upper Y Subscript t minus 1 Baseline comma bold-italic eta right-parenthesis proportional-to StartFraction 1 Over sigma Subscript t Baseline EndFraction exp left-parenthesis minus StartFraction y Subscript t Superscript 2 Baseline Over 2 sigma Subscript t Superscript 2 Baseline EndFraction right-parenthesis

Therefore the score vector can easily be computed analytically.

The AUTOREG procedure provides the ML estimates, ModifyingAbove bold-italic eta With caret Subscript n. The estimates are stored in the garchest data set.

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

/* estimate GARCH(1,1) model */
proc autoreg data=svdata(keep=y)
             outest=garchest
             noprint covout;
   model y =  / noint garch=(q=1,p=1,type=nonneg);
run;

If the pseudo model is close enough to the structural model, in a suitable sense, Gallant and Long (1997) showed that a consistent estimator of the asymptotic covariance matrix of the sample pseudo-score vector can be obtained from the formula

ModifyingAbove bold upper V With caret Subscript n Baseline equals StartFraction 1 Over n EndFraction sigma-summation Underscript t equals 1 Overscript n Endscripts s Subscript f Baseline left-parenthesis upper Y Subscript t Baseline comma ModifyingAbove bold-italic eta With caret Subscript n Baseline right-parenthesis s Subscript f Baseline left-parenthesis upper Y Subscript t Baseline comma ModifyingAbove bold-italic eta With caret Subscript n Baseline right-parenthesis prime

where s Subscript f Baseline left-parenthesis upper Y Subscript t Baseline comma ModifyingAbove bold-italic eta With caret Subscript n Baseline right-parenthesis equals left-parenthesis partial-differential slash partial-differential bold-italic eta Subscript n Baseline right-parenthesis log f left-parenthesis y Subscript t Baseline vertical-bar upper Y Subscript t minus 1 Baseline comma ModifyingAbove bold-italic eta With caret Subscript n Baseline right-parenthesis denotes the score function of the auxiliary model computed at the ML estimates.

The ML estimates of the GARCH(1,1) model are used in the following SAS statements to compute the variance-covariance matrix ModifyingAbove bold upper V With caret Subscript n:

/* compute the V matrix */
data vvalues;
   set scores;

   array score{*} dlldw dllda dlldb;
   array v_t{*} v_t_1-v_t_6;
   array v{*} v_1-v_6;

   /* compute external product of score vector */
   do i=1 to 3;
      do j=i to 3;
         v_t{j*(j-1)/2 + i} = score{i}*score{j};
      end;
   end;

   /* average them over t */
   do s=1 to 6;
      v{s}+ v_t{s}/&nobs;
   end;
run;

The ModifyingAbove bold upper V With caret matrix must be formatted to be used with the VDATA= option of the MODEL procedure. For more information about the VDATA= data set, see the section VDATA= Input Data Set.

/* Create a VDATA data set acceptable to PROC MODEL */

/* Transpose the last obs in the data set */
proc transpose data=vvalues(firstobs=&nobs keep=v_1-v_6)
               out=tempv;
run;

/* Add eq and inst labels */
data vhat;
   set tempv(drop=_name_);
   value = col1;
   drop col1;
   input _type_ $ eq_row $ eq_col $ inst_row $ inst_col $; *$;
   datalines;
      gmm m1 m1 1 1  /* intcpt is the only inst we use */
      gmm m1 m2 1 1
      gmm m2 m2 1 1
      gmm m1 m3 1 1
      gmm m2 m3 1 1
      gmm m3 m3 1 1
    ;

The last step of the EMM procedure is to estimate bold-italic theta by using SMM, where the moment conditions are given by the scores of the auxiliary model.

Given a fixed value of the parameter vector bold-italic theta and an arbitrarily large T, one can simulate a series StartSet ModifyingAbove y With caret Subscript 1 Baseline left-parenthesis bold-italic theta right-parenthesis comma ModifyingAbove y With caret Subscript 2 Baseline left-parenthesis bold-italic theta right-parenthesis comma ellipsis comma ModifyingAbove y With caret Subscript upper T Baseline left-parenthesis bold-italic theta right-parenthesis EndSet from the structural model. The EMM estimator is the value ModifyingAbove bold-italic theta With caret Subscript n that minimizes the quantity

m Subscript upper T Baseline left-parenthesis bold-italic theta comma ModifyingAbove bold-italic eta With caret Subscript n Baseline right-parenthesis prime ModifyingAbove bold upper V With caret Subscript n Superscript negative 1 Baseline m Subscript upper T Baseline left-parenthesis bold-italic theta comma ModifyingAbove bold-italic eta With caret Subscript n Baseline right-parenthesis

where

m Subscript upper T Baseline left-parenthesis bold-italic theta comma ModifyingAbove bold-italic eta With caret Subscript n Baseline right-parenthesis equals StartFraction 1 Over upper T EndFraction sigma-summation Underscript k equals 1 Overscript upper T Endscripts s Subscript f Baseline left-parenthesis ModifyingAbove upper Y With caret Subscript k Baseline left-parenthesis bold-italic theta right-parenthesis comma ModifyingAbove bold-italic eta With caret Subscript n Baseline right-parenthesis

is the sample moment condition evaluated at the fixed estimated pseudo parameter ModifyingAbove bold-italic eta With caret Subscript n. Note that the target function depends on the parameter bold-italic theta only through the simulated series ModifyingAbove y With caret Subscript k.

The following statements generate a data set that contains upper T equals 20,000 replicates of the estimated pseudo parameter ModifyingAbove bold-italic eta With caret Subscript n and that is then input to the MODEL procedure. The EMM estimates are found by using the SMM option of the FIT statement. The ModifyingAbove bold upper V With caret Subscript n matrix computed above serves as weighting matrix by using the VDATA= option, and the scores of the GARCH(1,1) auxiliary model evaluated at the ML estimates are the moment conditions in the GMM step.

Since the number of structural parameters to estimate (3) is equal to the number of moment equations (3) times the number of instruments (1), the model is exactly identified and the objective function has value zero at the minimum.

For simplicity, the starting values are set to the true values of the parameters.

/* USE SMM TO FIND EMM ESTIMATES */

/* Generate data set of length T */
data emm;
   set garchest(where=(_type_="PARM") rename=(_ah_0=w _ah_1=a _gh_1=b _mse_=mse)
                keep=_type_ _ah_0 _ah_1 _gh_1 _mse_);
   do i=1 to 20000;
      output;
   end;
   drop i;
run;

title2 'EMM estimates';
/* Find the EMM estimates */
proc model data=emm maxiter=1000 plot=none;
   parms aa -0.736 bb 0.9 ss 0.363;
   instruments _exog_ / intonly;

   /* Describe the structural model */
   u = rannor( 8801 );
   z = rannor( 9701 );
   lsigmasq = xlag(sigmasq,exp(aa));
   lnsigmasq = aa + bb * log(lsigmasq) + ss * u;
   sigmasq = exp( lnsigmasq );
   ysim = sqrt(sigmasq) * z;

   /* Compute scores of GARCH(1,1) */
   /* derivative of loglik wrt sigma-sq */
   ysim2 = ysim*ysim;
   lagvar = w + a*xlag(ysim2,mse) + xlag(lagvar,0)*b;
   var = lagvar + mse*b**_n_;
   dlldv = (-1 + ysim2/var)/var/2;

   /* arch 0 */
   dvdw = b*xlag(dvdw,0) + 1;
   dlldw = dlldv*dvdw;

   /* arch 1 */
   dvda = b*xlag(dvda,0) + xlag(ysim2,mse);
   dllda = dlldv*dvda;

   /* garch 1 */
   currdvdb = w + a*xlag(ysim2,mse);
   dvdb = - b*b*xlag2(dvdb,0) + 2*b*xlag(dvdb,0) + xlag(currdvdb,0);
   dlldb = dlldv*(dvdb + _n_*b**(_n_-1)*mse);

   /* Use scores of the GARCH model as moment conditions */
   eq.m1 = dlldw;
   eq.m2 = dllda;
   eq.m3 = dlldb;

   /* Fit scores using SMM and estimated Vhat */
   fit m1 m2 m3 / gmm npreobs=10 ndraw=1 /* smm options */
                  vdata=vhat /* use estimated Vhat */
                  kernel=(bart,0,) /* turn smoothing off */;
   bounds ss > 0, 0 < bb < 1;
quit;

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

Output 24.19.1: PROC MODEL Output

Efficient Method of Moments for Stochastic Volatility Model
EMM estimates

The MODEL Procedure

Model Summary
Parameters 3
Equations 3
Number of Statements 21

Parameters(Value) aa(-0.736) bb(0.9) ss(0.363)
Equations m1 m2 m3

The 3 Equations to Estimate
m1 = F(aa, bb, ss)
m2 = F(aa, bb, ss)
m3 = F(aa, bb, ss)
Instruments 1

Nonlinear GMM Parameter Estimates
Parameter Estimate Approx Std Err t Value Approx
Pr > |t|
aa -0.49702 0.0101 -49.40 <.0001
bb 0.930294 0.00137 677.59 <.0001
ss 0.316689 0.00395 80.14 <.0001


Last updated: June 19, 2025