Chapter Contents Previous Next
 The SIM2D Procedure

## SIMULATE Statement

SIMULATE simulate-options ;

The SIMULATE statement specifies details on the simulation and the covariance model used in the simulation. You can specify the following options with a SIMULATE statement, which can be abbreviated by SIM.

NUMREAL=number
NUMR=number
NR=number
specifies the number of realizations to produce for the spatial process specified by the covariance model. Note that the number of observations in the OUTSIM= data set contributed by a given SIMULATE statement is the product of the NUMREAL= value with the number of grid points. This can cause the OUTSIM= data set to become large even for moderate values of the NUMREAL= option.

VAR= (variable-name)
specifies the single numeric variable used as the conditioning variable in the simulation. In other words, the simulation is conditional on the values of the VAR= variable found in the DATA= data set. If you omit the VAR= option, the simulation is unconditional. Since multiple SIMULATE statements are allowed, you can perform both unconditional and conditional simulations with a single PROC SIM2D statement.

### Covariance Model Specification

There are two ways to specify a semivariogram or covariance model. In the first method, you can specify the required parameters SCALE, RANGE, and FORM, and possibly the optional parameters NUGGET, ANGLE, and RATIO, explicitly in the SIMULATE statement.

In the second method, you can specify an MDATA= data set. This data set contains variables corresponding to the required SCALE, RANGE, and FORM parameters, and, optionally, variables for the NUGGET, ANGLE, and RATIO parameters.

The two methods are exclusive; either you specify all parameters explicitly, or they are all are read from the MDATA= data set.

ANGLE=angle
ANGLE=(angle1,...,anglek)
specifies the angle of the major axis for anisotropic models, measured in degrees clockwise from the N-S axis. In the case of a nested semivariogram model, you can specify an angle for each nesting. The default is ANGLE=0.

FORM=form_spec
FORM=(form_spec1, form_spec2,...,form_speck)
specifies the functional form or forms of the semivariogram model, where form_spec can take only the values SPHERICAL, EXPONENTIAL, and GAUSSIAN. The two ways of specifying the FORM= parameter allows specification of both nested and nonnested models. The following abbreviations are permitted. For the spherical model, you can specify the form_spec as FORM=SPHERICAL, FORM=SPH, or FORM=S. For the exponential model, you can specify the form_spec as FORM=EXPONENTIAL, FORM=EXP, or FORM=E. For the Gaussian model, you can specify the form_spec as FORM=GAUSSIAN, FORM=GAUSS, or FORM=G.

MDATA=SAS-data-set
specifies the input data set that contains parameter values for the covariance or semivariogram model. The MDATA= data set must contain variables named SCALE, RANGE, and FORM, and it can optionally contain the variables NUGGET, ANGLE, and RATIO.

The FORM variables must be character, and they can assume the same values allowed in the explicit FORM= syntax described previously. The RANGE and SCALE variables must be numeric. The optional variables ANGLE, RATIO, and NUGGET must also be numeric if present.

The number of observations present in the MDATA= data set corresponds to the level of nesting of the covariance or semivariogram model. For example, to specify a non-nested model using a spherical covariance, an MDATA= data set might look like the following.

```   data md1;
input scale range form \$;
datalines;
25 10 sph
run;
```

The PROC SIM2D statement to use the MDATA= specification is of the form

```   proc sim2d data=...;
sim var=.... mdata=md1;
run;
```

This is equivalent to the following explicit specification of the covariance model parameters:

```   proc sim2d data=...;
sim var=.... scale=25 range=10 form=sph;
run;
```

The following MDATA= data set is an example of an anisotropic nested model:

```   data md2;
input scale range form \$ nugget angle ratio;
datalines;
20 8 S  5 35 .7
12 3 G  5 0  .8
4  1 G  5 45 .5
;

proc sim2d data=...;
sim var=.... mdata=md2;
run;
```

This is equivalent to the following explicit specification of the covariance model parameters:

```   proc sim2d data=...;
sim var=.... scale=(20,12,4) range=(8,3,1) form=(S,G,G)
angle=(35,0,45) ratio=(.7,.8,.5) nugget=5;
run;
```

This example is somewhat artificial in that it is usually hard to detect different anisotropy directions and ratios for different nestings using an experimental semivariogram. Note that the NUGGET value is the same for all nestings. This is always the case; the nugget effect is a single additive term for all models. For further details, refer to the section "The Nugget Effect" in Chapter 34, "The KRIGE2D Procedure."

The SIMULATE statement can be given a label. This is useful for identification in the OUTSIM= data set when multiple SIMULATE statements are specified.

For example,
```   proc sim2d data=...;
gauss1: sim var=.... form=gauss;
mean ....;
gauss2: sim var=.... form gauss;
mean ....;
exp1: sim var=.... form=exp;
mean ....;
exp2: sim var=.... form=exp;
mean ....;
run;
```

In the OUTSIM= data set, the values 'GAUSS1', 'GAUSS2', 'EXP1', and 'EXP2' for the LABEL variable help to identify the realizations corresponding to the four SIMULATE statements. If you do not provide a label for a SIMULATE statement, a default label of SIMn is given, where n is the number of unlabeled SIMULATE statements seen so far.

NUGGET=number
specifies the nugget effect for the model. This effect is due to a discontinuity in the semivariogram as determined by plotting the sample semivariogram (refer to the section "The Nugget Effect" in the chapter on the KRIGE2D procedure for details). For models without any nugget effect, the NUGGET= option is left out. The default is NUGGET=0.

RANGE=range
RANGE=(range1,...,rangek)
specifies the range parameter in the semivariogram models. In the case of a nested semivariogram model, you must specify a range for each nesting.

The range parameter is the divisor in the exponent in all supported models. It has the units of distance or distance squared for these models, and it is related to the correlation scale for the underlying spatial process. Refer to the section "Theoretical Semivariogram Models" in the chapter on the KRIGE2D procedure for details on how the RANGE= values are determined.

RATIO=ratio
RATIO=(ratio1,...,ratiok)
specifies the ratio of the length of the minor axis to the length of the major axis for anisotropic models. The value of the RATIO= option must be between 0 and 1. In the case of a nested semivariogram model, you can specify a ratio for each nesting. The default is RATIO=1.

SCALE=scale
SCALE=(scale1,...,scalek)
specifies the scale parameter in semivariogram models. In the case of a nested semivariogram model, you must specify a scale for each nesting.

The scale parameter is the multiplicative factor in all supported models; it has the same units as the variance of the VAR= variable. Refer to the section "Theoretical Semivariogram Models" in the chapter on the KRIGE2D procedure for details on how the SCALE= values are determined.

SEED=seed value
specifies the seed to use for the random number generator. If you omit the SEED= value, the system clock is used.

SINGULAR=number
gives the singularity criteria for solving the set of linear equations involved in the computation of the mean and covariance of the conditional distribution associated with a given SIMULATE statement. The larger the value of the SINGULAR= option, the easier it is for the covariance matrix system to be declared singular. The default is SINGULAR=1E-8. For more details on the use of the SINGULAR= option, see the section "Computational and Theoretical Details of Spatial Simulation".

 Chapter Contents Previous Next Top