Fits a 2-dimensional spline surface using
REML, and estimates its extreme point (D.B. Baird).
|What to print (
||What to plot (
||Spline basis to use (
||Knots to be fitted in spline model, if a scalar, this is the total number of knots to be fitted; if a variate of length 2, this is the number of knots in the
||Which tensor spline penalty to use (
||Degree of polynomial used to form the underlying spline; default 1 for
||Differencing order for p-spline penalty; default 2|
||Saves the estimated value of y at the extreme point|
||Saves the standard error of the estimated value of y at the extreme point|
||Type of extreme to be identified (
||Method of returning predictions (
||The number of bootstrap samples to estimate standard errors and confidence limits; default 100|
||Number of times to retry bootstrap sampling when the
||The seed used to initialize the randomization in the bootstrap sampling; default 0 continues an existing sequence or, if none, selects a seed automatically|
||Probability level for confidence intervals for parameter estimates; default 0.95|
||Colours for the plots|
||Y-variate to which the spline surface will be fitted|
||The first X-variate which defines the spline surface|
||The second X-variate which defines the spline surface|
||Estimated value of each x-variate at the extreme point|
||Standard error of the estimated value of each x-variate at the extreme point|
||Number of values or values at which to evaluate each
||Title to use for graphs; default automatically made from the variate identifiers used for
||Window number for the graphs; default 3|
||Whether to clear the screen before plotting or to continue plotting on the old screen (
||Exit code from the
VSURFACE fits a spline surface defined by the
X2 parameters to the
Y variate, and estimates the extreme point within the region bounded by the values of x-variates. Parameters
SE can save the estimated value of each x-variate, and their standard errors, at the extreme point. The y-value at the extreme point, and its standard error, can be saved by the
SEEXTREME options. The
TYPEEXTREME option specifies whether the extreme is a minimum or a maximum.
BASIS option specifies whether to use thin-plate (the default), p-splines or penalized splines to construct the basis: p-splines or penalized splines are jointly known as tensor splines. Thin-plate splines are 2-dimensional cubic smoothing splines, and are formed using the
The positions of the knots used in the basis functions are specified by the KNOTS parameter. This can be if a scalar, specifying the total number of knots to be fitted; the procedure will then use equi-spaced knots divided proportionally to the number of distinct points in the two directions. Alternatively, it can be a variate of length 2 specifying the number of equi-spaced of knots in the
X2 directions. Finally, it can be a pointer to 2 variates whose values are used for knots in the
The degree of polynomial used to form the underlying tensor spline basis functions is specified by the
DEGREE option. This has a default of 3 for p-spline models, and 1 for penalized spline models. The
DIFFORDER option specifies the differencing order to be used with p-spline models. This determines the strength of the penalty (for a given smoothness parameter). The default is to use second-order differencing. For a p-spline model, the underlying fixed polynomial in each dimension has degree d equal to
DIFFORDER-1. For a penalized spline model, the underlying fixed polynomial in each dimension has degree d equal to the value specified by the
DEGREE option. The tensor-spline basis is constructed via interactions of the one-dimensional spline bases, as detailed in the
PENALTYMETHOD option controls the interaction between the one-dimensional spline bases. An
unconstrained penalty (the default) allows a separate smoothing parameter for each term. In this case, the basis pointer has 2d+3 matrices, one for each term. With the
semiconstrained penalty, the same smoothing parameter is imposed across the interaction of polynomials in the first dimension with random terms in the second, and for the interaction of random terms in the first dimension with polynomials in the second dimension. An
isotropic penalty uses a single common penalty, and the terms are combined into a single matrix.
description description of the data and spline basis to be fitted,
model description of model fitted,
components estimates of variance components and estimated parameters of covariance models,
effects estimates of the fixed and random effects,
vcovariance variance-covariance matrix of the estimated components,
deviance deviance of the fitted model (-2 × log-likelihood RL),
waldtests Wald tests for fixed terms,
extreme y and x-values of the extreme fitted value, with
confidence estimated confidence limits of the extreme y and x-values obtained from the bootstrap analysis, and
monitoring monitoring information at each iteration in the REML fitting and for each sample of the bootstrap analysis
EXIT parameter saves a scalar containing the exit code from
REML if the fit failed (-2, -1 or 1…8), or 9 if the extreme is on the boundary of the
X2 region (so the optimum may be outside the region), or 10 if the bootstrapping has not found
NBOOT successful fits before
NRETRIES failures (see below).
EXIT will be 0 if an interior optimum has been found and any bootstrapping has been successful.
If standard errors or confidence limits are required, these are formed by bootstrapping the observations. The
NBOOT option controls the number of bootstrap samples that are taken. If the
REML fit for a sample fails, an extra sample will be taken until a total of
NRETRIES samples have failed, in which case the procedure exits with parameter
EXIT set to 10. The
SEED option controls the randomization seed used for the bootstrapping, and the
CIPROBABILITY controls the probability levels of the confidence limits. The value of
NBOOT must be large enough that at least one sample falls outside the confidence limits on either side (i.e.
NBOOT >= 2/(1 - CIPROBABILITY)).
PREDICTIONS option can save predictions and fitted values from the fitted spline model. If option
PMETHOD=list it saves both of these, while if
PMETHOD=grid it saves just the grid of predictions. The
LEVELS parameter specifies the values at which to form predictions. This can be a scalar giving the number of equi-spaced grid points between the minimum and maximum of each x-variate, or a variate of length 2 which contains the number of equi-spaced grid points in the
X2 direction, or a pointer to two variates containing the grid points to be used for
X2. The predictions are stored either in a matrix (the default if the structure type is not set) or in a pointer.
PLOT option specifies which plots to display, with settings:
contour for a contour plot, and
surface for surface plot.
By default nothing is plotted. The
COLOURS option specifies a text or variate to define the colours to use. (This is used as the setting of the
PENFILL parameter of
DSURFACE.) The default is a text containing the values ‘
darkgreen‘ and ‘
SCREEN parameters control the title, window and whether a new plot is started in similar manner to those used in
DSURFACE. Note that if both surface and contour plots are produced, then
SCREEN=keep will cause these to over-plot each other in the same window.
VSURFACE forms the spline basis functions using the
TENSORSPLINE procedures, and fits using
REML. The extreme value from the fitted surface (over observations and grid points), is then found. Standard errors and confidence limits are formed by bootstrap resampling of the observations.
REML, either the y-variate or x-variates can be restricted to analyse a subset of the data. If more than one of
X2 are restricted, the restrictions must be consistent.
CAPTION 'VSURFACE example'; STYLE=major "Sinusoidal peak with diagonal trend on a 9 x 9 grid with 2 replicates" VARIATE x1,x2,y; VALUES = !(9(1...9)2),!((1...9)18),!(162(*)); DECIMALS=2(0),2 CALC [SEED=5635] y = 10*SIN(x1/3)*SIN(x2/3) + (x1-4)*(x2-5)/5 + \ GRNORMAL(162;0;0.2) VSURFACE [PLOT=surface] y; X1=x1; X2=x2 VSURFACE [PRINT=extreme,confidence; PLOT=contour; EXTREME=max; \ SEEXTREME=semax; PREDICTIONS=Predictions; NBOOT=20; NRETRIES=10; \ CIPROB=0.9; SEED=345; COLOURS=!T('red','yellow')] \ y; X1=x1; X2=x2; ESTIMATE=xpos; SE=sexpos; EXIT=exit; \ TITLE='Thin-plate spline fit to sinusoidal peak with diagonal trend' PRINT max,semax PRINT xpos,sexpos PRINT [RLWIDTH=4] Predictions; FIELDWIDTH=6; DECIMALS=2