CSSM Procedure
Simulation Smoothing
Like the Kalman filter and Kalman smoother algorithms (DKFS) that are described in the section Filtering, Smoothing, Likelihood, and Structural Break Detection, the simulation smoother algorithm is an important tool in SSM-based data analysis. The simulation smoother in the CSSM procedure is loosely based on the algorithm described in Durbin and Koopman (2012, chap. 4, sec. 9). Recall that the smoothing phase of DKFS provides the mean and the covariance of a latent state at any time point ,
and
, conditional on the full observed sample
(see the section Smoothing Phase). However, the DKFS does not provide information about the joint conditional distribution at different time points; for example, it does not provide the conditional covariance
at two distinct time points,
and
. The simulation smoother provides a solution to this problem. You can use the simulation smoother to generate a random draw,
, from the joint conditional distribution of
, given the sample
. By making a sufficiently large number of draws from the joint conditional distribution, you can obtain the sampling distribution of arbitrarily complex functions of the conditional estimates of
.
In PROC CSSM, the simulation smoothing process is divided into two steps. In the first step, you save the fitted model to an output BLOB table by using the OUTMODEL= option in the SIMSMOOTH statement as follows:
proc cssm data=data-table;
id ...;
/*---model specification---*/
...;
simsmooth outmodel=blob-table;
run;
In the second step, you use the input data table that was used for model fitting and the BLOB table that was saved from the first step to generate the desired number of simulations from the conditional distribution as follows:
proc cssm data=data-table;
simsmooth inmodel=blob-table nsim=integer seed=integer
outstate=output-table outcomp=output-table
outpred=output-table;
run;
In this second step, because the loaded INMODEL= option BLOB table already contains the full model specification, you do not need to specify the statements that describe the model. Moreover, you can repeat this second step as many times as needed to get the desired simulation output. The primary output of the simulation smoother is the desired number of random draws of the latent states. You can save this output for later use in a table that you specify in the OUTSTATE= option. Depending on the size of the underlying state vector, the number of distinct time points in the input data table, and the specified number of random draws, the OUTSTATE= table can get quite large. In many practical situations, you might not need to save this level of detail. In fact, you might be interested only in the simulations of the predictions of the missing response values or of the components in the model. Because they are known linear combinations of the latent states, you can easily obtain them as a by-product of the state simulation output. You can save the simulations of the predictions of the missing response values in a table by using the OUTPRED= option, and you can save the simulations of the components in the model by using the OUTCOMP= option. The OUTPRED= and OUTCOMP= tables are usually much smaller than the OUTSTATE= table. For more information about the contents of these tables, see the section Output Tables Associated with Simulation Smoothing. For an application of simulation smoothing, see Example 14.21: Simulation-Smoothing-Based Sampling Distribution of the Sum of Forecasts.