Chapter Contents |
Previous |
Next |

The G3GRID Procedure |

About the Input Data Set |

The input data set must contain at least three numeric variables:

- two horizontal variables, (
**x**,**y**) - one or more vertical variables,
**z**through**z**-**n**, that will be interpolated or smoothed as if it were a function of the two horizontal variables.

The procedure can process multiple vertical variables
for each pair of horizontal variables that you specify. If you specify more
than one vertical variable, the G3GRID procedure performs a separate analysis
and produces interpolated or smoothed values for each vertical variable. If
more than one observation in the input data set has the same values for both
horizontal variables, **x** and **y**, a warning message
is printed, and only the first such point is used in the interpolation.

By default, the interpolation is performed after both
variables are similarly scaled because the interpolation methods assume that
the scales of **x** and **y** are comparable.

Multiple Vertical Variables |

Horizontal Variables Along a Nonlinear Curve |

If the horizontal variable points are collinear, the procedure interpolates the function as constant along lines perpendicular to the line in the plane that is generated by the input data points.

About the Output Data Set |

You can control both the number of **x** and **y** values in the output data set and the values themselves. In addition,
you can specify an interpolation method.

Interpolation Methods |

This default method of interpolation works best for fairly smooth functions with values given at uniformly distributed points in the plane. If the data points in the input data set are erratic, the default interpolated surface can be erratic.

This default method is a modification of that described by Akima (1978). This method consists of

- dividing the plane into nonoverlapping triangles
that use the positions of the available points
- fitting a bivariate fifth degree polynomial within
each triangle
- calculating the interpolated values by evaluating
the polynomial at each grid point that falls in the triangle.

The coefficients for the polynomial are computed based on

- the values of the function at the vertices of
the triangle
- the estimated values for the first and second
derivatives of the function at the vertices.

The estimates of the first and second derivatives are
computed using the **n** nearest neighbors of the point, where **n** is the number specified in the GRID statement's NEAR= option. A
Delauney triangulation (Ripley 1981, p. 38) is used for the default method.
The coordinates of the triangles are available in an output data set if requested
by the OUTTRI= option in the PROC G3GRID statement.

The function **u**, formed when you specify
the SPLINE option, is determined by letting

and

where

The coefficients **c**_{1}, **c**_{2},..., **c _{n}**
and

and

where

**E**- is the
**n**×**n**matrix E(**t**,_{i}**t**)_{j} **I**- is the
**n**×**n**identity matrix - is the smoothing parameter that is specified in the SMOOTH= option
**c**- is (
**c**_{1},...,**c**)_{n} **z**- is (
**z**_{1},...,**z**)_{n} **d**- is (
**d**_{1},**d**_{2},**d**_{3}) **T**- is the
**n**× 3 matrix whose**i**th row is (1,**x**,_{i}**y**)._{i}

See Wahba (1979) for more detail.

To produce a smoothed spline, you can use the GRID statement's SMOOTH= option with the SPLINE option. The value or values specified in the SMOOTH= option are substituted for in the equation that is described in Spline Interpolation. A smoothed spline trades closeness to the original data points for smoothness. To find a value that produces the best balance between smoothness and fit to the original data, you can try several values for the SMOOTH= option.

Chapter Contents |
Previous |
Next |
Top of Page |

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.