Syntax


The following statements are available in PROC KRIGE2D.

  • PROC KRIGE2D options ;

    • COORDINATES COORD coordinate- variables ;

    • GRID grid-options ;

    • PREDICT PRED P predict-options ;

    • MODEL model-options ;

The PREDICT and MODEL statements are hierarchical; the PREDICT statement is followed by one or more MODEL statements. All the MODEL statements following a PREDICT statement use the variable and neighborhood specifications in that PREDICT statement.

You must specify at least one PREDICT statement and one MODEL statement. You must supply a single COORDINATES statement to identify the x and y coordinate variables in the input data set. You must also specify a single GRID statement to include the grid information.

The following table outlines the options available in PROC KRIGE2D classified by function.

Table 37.1: Options Available in the KRIGE2D Procedure

Task

Statement

Option

Data Set Options

specify input data set

PROC KRIGE2D

DATA=

specify grid data set

GRID

GDATA=

specify model data set

MODEL

MDATA=

write kriging estimates and standard errors

PROC KRIGE2D

OUTEST=

write neighborhood information for each grid point

PROC KRIGE2D

OUTNBHD=

Declaring the Role of Variables

specify the variables to be estimated (kriged)

PREDICT

VAR=

specify the x and y coordinate variables in the DATA= data set

COORDINATES

XC= YC=

specify the x and y coordinate variables in the GDATA= data set

GRID

XC= YC=

Controlling Kriging Neighborhoods

specify the radius of a neighborhood for all grid points

PREDICT

RADIUS=

specify the number of neighbors for all grid points

PREDICT

NUMPOINTS=

specify the maximum of neighbors for all grid points

PREDICT

MAXPOINTS=

specify the minimum of neighbors for all grid points

PREDICT

MINPOINTS=

specify action when maximum not met

PREDICT

NODECREMENT

specify action when minimum not met

PREDICT

NOINCREMENT

Controlling the Semivariogram Model

specify a nugget effect

MODEL

NUGGET=

specify a functional form

MODEL

FORM=

specify a range parameter

MODEL

RANGE=

specify a scale parameter

MODEL

SCALE=

specify an angle for an anisotropic model

MODEL

ANGLE=

specify a minor-major axis ratio for an anisotropic model

MODEL

RATIO=

PROC KRIGE2D Statement

  • PROC KRIGE2D options ;

You can specify the following options in the PROC KRIGE2D statement.

DATA = SAS-data-set

  • specifies a SAS data set containing the x and y coordinate variables and the VAR= variables in the PREDICT statement.

OUTEST= SAS-data-set

OUTE= SAS-data-set

  • specifies a SAS data set in which to store the kriging estimates, standard errors and grid location. For details, see the section OUTEST= SAS-data-set on page 2060.

OUTNBHD= SAS-data-set

OUTN= SAS-data-set

  • specifies a SAS data set in which to store the neighborhood information for each grid point. Information is written to this data set only if one or more PREDICT statements have options specifying local kriging. For details, see the section OUTNBHD= SAS- data-set on page 2060.

SINGULARMSG= number

SMSG= number

  • controls the number of warning messages displayed for a singular matrix. When local kriging is performed, a separate kriging system is solved for each grid point. Anytime a singular matrix is encountered , a warning message is displayed up to a total of SINGULARMSG= n times. The default is SINGULARMSG=10.

COORDINATES Statement

  • COORDINATES COORD coordinate-variables ;

The following two options specify the names of the variables in the DATA= data set containing the values of the x and y coordinates of the data.

Only one COORDINATES statement is allowed, and it is applied to all PREDICT statements. In other words, it is assumed that all the VAR= variables in all PREDICT statements have the same x and y coordinates.

This is not a limitation. Since each VAR= variable is processed separately, observations for which the current VAR= variable is missing are excluded. With the next VAR= variable, the entire data are read again, this time excluding missing values in this next variable. Hence, a single run of PROC KRIGE2D can be used for variables measured at different locations without overlap.

XCOORD= (variable- name )

XC= (variable-name)

  • specifies the name of the variable containing the x coordinate of the data locations in the DATA= data set.

YCOORD= (variable-name)

YC= (variable-name)

  • specifies the name of the variable containing the y coordinate of the data locations in the DATA= data set.

GRID Statement

  • GRID grid-options ;

You can use the following options to specify the grid of spatial locations for the kriging estimates. The grid specification is applied to all PREDICT and MODEL statements.

There are two basic methods for specifying the grid. You can specify the x and y coordinates explicitly, or they can be read from a SAS data set. The options for the explicit specification of grid locations are as follows .

X= number

X= x 1 , ,x m

X= x 1 to x m

X= x 1 to x m by x

  • specifies the x coordinate of the grid locations.

Y= number

Y= y 1 , ,y m

Y= y 1 to y m

Y= y 1 to y m by y

  • specifies the y coordinate of the grid locations.

  • For example, the following two GRID statements are equivalent.

      grid x=1,2,3,4,5  y=0,2,4,6,8,10;   grid x=1 to 5 y=0 to 10 by 2;  
  • To specify grid locations from a SAS data set, you must give the name of the data set and the variables containing the values of the x and y coordinates.

GRIDDATA= SAS-data-set

GDATA = SAS-data-set

  • specifies a SAS data set containing the x and y grid coordinates.

XCOORD= (variable-name)

XC= (variable-name)

  • specifies the name of the variable containing the x coordinate of the grid locations in the GRIDDATA= data set.

YCOORD= (variable-name)

YC= (variable-name)

  • specifies the name of the variable containing the y coordinate of the grid locations in the GRIDDATA= data set.

PREDICT Statement

  • PREDICT PRED P predict-options ;

You can specify the following options in a PREDICT statement.

MAXPOINTS= number

MAXPOINTS= number

MAXP= number

  • specifies the maximum number of data points in a neighborhood. You specify this option in conjunction with the RADIUS= option. When the number of data points in the neighborhood formed at a given grid point by the RADIUS= option is greater than the MAXPOINTS= value, the RADIUS= value is decreased just enough to honor the MAXPOINTS= value unless you specify the NODECREMENT option.

MINPOINTS= number

MINP= number

MIN= number

  • specifies the minimum number of data points in a neighborhood. You specify this option in conjunction with the RADIUS= option. When the number of data points in the neighborhood formed at a given grid point by the RADIUS= option is less than the MINPOINTS= value, the RADIUS= value is increased just enough to honor the MINPOINTS= value unless you specify the NOINCREMENT option. The default is MINPOINTS=20. If enough data are available, this value should be increased to 30 to improve estimation.

NODECREMENT NODECR

  • requests that the RADIUS= value not be decremented when the MAX= value is exceeded at a grid point. This option is relevant only when you specify both a RADIUS= value and a MAXPOINTS= value. In this case, when the number of points in the neighborhood constructed from the RADIUS= specification is greater than the MAXPOINTS= value, the RADIUS= value is decremented enough to honor the MAXPOINTS= value, and the kriging system is solved for this grid point. If you specify the NODECREMENT option, no decrementing is done, estimation is skipped at this grid point, and a message is written to the log.

NOINCREMENT NOINCR

  • requests that the RADIUS= value not be incremented when the MIN= value is not met at a grid point. This option is relevant only when you specify both a RADIUS= value and a MINPOINTS= number. In this case, when the number of points in the neighborhood constructed from the RADIUS= specification is less than the MINPOINTS= value, the RADIUS= value is incremented enough to honor the MINPOINTS= value, and the kriging system is solved for this grid point. If you specify the NOINCREMENT option, no incrementing is done, estimation is skipped at this grid point, and a message is written to the log.

NUMPOINTS= number

NPOINTS= number

NPTS= number

NP= number

  • specifies the exact size of a neighborhood. This option is incompatible with all other PREDICT statement options controlling the neighborhood; it must appear by itself.

RADIUS= number

R= number

  • specifies the radius to use in a local kriging regression. When you specify this option, a separate kriging system is solved at each grid point by finding the neighborhood of this grid point consisting of all data points within the distance specified by the RADIUS= value. See the MAXPOINTS= and MINPOINTS= options for additional control on the neighborhood.

VAR= variable-name

  • specifies the single numeric variable used in the kriging system.

MODEL Statement

  • MODEL model-options ;

You can use the following options to specify a semivariogram or covariance model. The specified model is used in the kriging system defined by the most previous PREDICT statement.

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

In the second method, you 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 all are read from the MDATA= data set.

ANGLE= angle

ANGLE= (angle 1 , ,angle k )

  • 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=SPHERICAL EXPONENTIAL GAUSSIAN POWER

FORM=SPH EXP GAUSS PW

  • specifies the functional form of the semivariogram model. All the supported models are two-parameter models (SCALE= and RANGE=). A FORM= value is required; in the case of a nested semivariogram model, you must specify a form for each nesting.

    See the section Theoretical Semivariogram Models beginning on page 2045 for details on how the FORM= forms are determined.

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 variables NUGGET, ANGLE, and RATIO.

  • The FORM variable must be a character variable, assuming only the 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 semivariogram model. For example, to specify a nonnested model using a spherical covariance, an MDATA= data set might look like

      data md1;   input scale range form $;   datalines;   25 10 SPH   run;  
  • The PROC KRIGE2D statement to use the MDATA= specification is of the form

      proc krige2d data=. . . ;   pred var=. . . . ;   model mdata=md1;   run;  
  • This is equivalent to the following explicit specification of the covariance model parameters:

      proc krige2d data=. . . ;   pred var=. . . .;   model scale=25 range=10 form=sph;   run;  
  • The following MDATA= data set is an example of an anisotropic nested model:

      data md1;   input scale range form $ nugget angle ratio;   datalines;   20 8 S  5 35 0.7   12 3 G  5 0  0.8   4  1 G  5 45 0.5   ;  
  • This is equivalent to the following explicit specification of the covariance model parameters:

      proc krige2d data=. . . ;   pred var=. . . . ;   model scale=(20,12,4) range=(8,3,1) form=(S,G,G)   angle=(35,0,45) ratio=(0.7,0.8,0.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, see the section Theoretical and Computational Details of the Semivariogram on page 4872 in the chapter on the VARIOGRAM procedure.

NUGGET= number

  • specifies the nugget effect for the model. The nugget effect is due to a discontinuity in the semivariogram as determined by plotting the sample semivariogram (see the chapter on the VARIOGRAM procedure for details). For models without any nugget effect, this option is left out; the default is NUGGET=0.

RANGE= range

RANGE= (range 1 , ,range k )

  • specifies the range parameter in 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 except the power model. 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. See the section Theoretical Semivariogram Models beginning on page 2045 for details on how the RANGE= values are determined.

RATIO= ratio

RATIO= (ratio 1 , ,ratio k )

  • 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= (scale 1 , ,scale k )

  • 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 in the preceding PREDICT statement. See the section Theoretical Semivariogram Models beginning on page 2045 for details on how the SCALE= values are determined.

SINGULAR= number

  • gives the singularity criteria for solving kriging systems. The larger the value of the SINGULAR= option, the easier it is for a kriging system to be declared singular.

    The default is SINGULAR=1E-7. See the section Details of Ordinary Kriging beginning on page 2056 for more detailed information.




SAS.STAT 9.1 Users Guide (Vol. 3)
SAS/STAT 9.1, Users Guide, Volume 3 (volume 3 ONLY)
ISBN: B0042UQTBS
EAN: N/A
Year: 2004
Pages: 105

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net