The MODEL Procedure


Example 19.19 EMM Estimation of a Stochastic Volatility Model

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 19.17 with the EMM method.

Suppose that your data are the time series $\{ y_1, y_2, \ldots ,y_ n \} $, and the model that you want to estimate, or the structural model, is characterized by the vector of parameters $\btheta $. For the SV model, $\btheta $ is given by $(a, b, s)$.

The first step of the EMM method is to fit the data with an auxiliary model (or score generator) that has transition density $f(y_ t|Y_{t-1}, \bm {\eta })$, parameterized by the pseudo parameter $\bm {\eta }$, where $Y_{t-1}=\{ y_{t-1}, \ldots , y_1\} $. 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 $\bm {\eta }$ be greater than or equal to that of the structural parameter $\btheta $.

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

\begin{eqnarray*}  y_ t & =&  \sigma _ t z_ t \\ \sigma _ t^2 & =&  \omega + \alpha y_{t-1} + \beta \sigma _{t-1}^2 \end{eqnarray*}

The pseudo parameter vector $\bm {\eta }$ is given by $(\omega , \alpha , \beta )$.

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

\[  f(y_ t| Y_{t-1}, \bm {\eta }) \propto \frac{1}{\sigma _ t} \exp \left( -\frac{y_ t^2}{2\sigma _ t^2} \right)  \]

Therefore the score vector can easily be computed analytically.

The AUTOREG procedure provides the ML estimates, $\hat{\bm {\eta }}_ 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

\[  \hat{\bV }_ n = \frac{1}{n}\sum _{t=1}^ n s_ f(Y_ t, \hat{\bm {\eta }}_ n) s_ f(Y_ t, \hat{\bm {\eta }}_ n)^{\prime }  \]

where $s_ f(Y_ t, \hat{\bm {\eta }}_ n)= (\partial / \partial \bm {\eta }_ n ) \log f(y_ t|Y_{t-1}, \hat{\bm {\eta }}_ n)$ 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 $\hat{\bV }_ 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 $\hat{\bV }$ matrix must be formatted to be used with the VDATA= option of the MODEL procedure. See the section VDATA= Input data set for more information about the VDATA= data set.

/* Create a VDATA dataset acceptable to PROC MODEL */

/* Transpose the last obs in the dataset */
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 $\btheta $ by using SMM, where the moment conditions are given by the scores of the auxiliary model.

Given a fixed value of the parameter vector $\btheta $ and an arbitrarily large T, one can simulate a series $\{ \hat{y}_1(\btheta ), \hat{y}_2(\btheta ), \ldots , \hat{y}_ T(\btheta )\} $ from the structural model. The EMM estimator is the value $\hat{\btheta }_ n$ that minimizes the quantity

\[  m_ T(\btheta , \hat{\bm {\eta }}_ n)^{\prime } \hat{\bV }_ n^{-1} m_ T(\btheta , \hat{\bm {\eta }}_ n)  \]

where

\[  m_ T(\btheta , \hat{\bm {\eta }}_ n) = \frac{1}{T} \sum _{k=1}^ T s_ f(\hat{Y}_ k(\btheta ), \hat{\bm {\eta }}_ n)  \]

is the sample moment condition evaluated at the fixed estimated pseudo parameter $\hat{\bm {\eta }}_ n$. Note that the target function depends on the parameter $\btheta $ only through the simulated series $\hat{y}_ k$.

The following statements generate a data set that contains $T=20,000$ replicates of the estimated pseudo parameter $\hat{\bm {\eta }}_ 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 $\hat{\bV }_ 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 dataset 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 19.19.1.

Output 19.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