Usage
Krig(x, Y, cov.function=exp.cov, lambda=NA, df = NA,
cost=1, knots, weights=rep(1,length(Y)),
m=2, return.matrices=T, nstep.cv=80, scale.type="user",
x.center=rep(0, ncol(x)), x.scale=rep(1, ncol(x)), rho=NA, sigma2=NA,
method="GCV", decomp="DR", verbose=F, cond.number=10^8, mean.obj=NULL,
sd.obj=NULL, yname=NULL, return.X=T, null.function=make.tmatrix, offset=0,
outputcall = NULL, cov.by.name = T,...)
Arguments
x
Matrix of independent variables.
Y
Vector of dependent variables.
cov.function
Covariance function for data in the form of an S-PLUS function (see exp.cov).
Default assumes that correlation is an exponential function of distance.
df
The effective number of parameters for the fitted surface. Conversely,
N- df, where N is the total number of observations is the degrees of
freedom associated with the residuals.
This is an
alternative to specifying lambda and much more interpretable.
lambda
Smoothing parameter that is the ratio of the error variance (sigma**2)
to the scale parameter of the
covariance function (rho). If omitted this is estimated by GCV ( see
method below).
cost
Cost value used in GCV criterion. Corresponds to a penalty for
increased number of parameters.
knots
A matrix of locations similar to x. These can define an alternative set of
basis functions for representing the estimate. One choice may be a
space-filling subset of the original x locations. (See details.)
weights
Weights are proportional to the reciprocal variance of the measurement
error. The default is no weighting i.e. vector of unit weights.
m
A polynomial function of degree (m-1) will be
included in the model as the drift (or spatial trend) component.
return.matrices
Matrices from the decompositions are returned. The default is T.
nstep.cv
Number of grid points for minimum GCV search.
scale.type
This is a character string among: "range", "unit.sd", "user", "unscaled".
The independent variables and knots are scaled to the specified scale.type.
By default no scaling is done. Scale type of
"range" scales the data to the interval (0,1) by forming
(
x.center
Centering values to be subtracted from each column of the x matrix.
x.scale
Scale values that are divided into each column after centering.
rho
Scale factor for covariance.
sigma2
Variance of the errors, often called the nugget variance. If weights are
specified then the error variance is sigma2 divided by weights.
method
How should the "smoothing" parameter be estimated? The default is by
standard GCV
Other choices are: GCV.model, GCV.one, RMSE, pure error. The differences
are explained below.
decomp
Type of matrix decompositions used to compute the solution. Default is
"DR" Demmler-Reinsch an alternative that more numerically stable is
"WBW" Wendelberger-Bates-Wahba. This is the strategy used in GCV pack.
"WBW" can not be used if knots are spe
verbose
If true will print out all kinds of intermediate stuff. Default is false,
of course.
cond.number
Maximum size of condition number to allow when using DR decomposition.
mean.obj
Object to predict the mean of the spatial process. This used in when
fitting a correlation model with varying spatial means and varying
marginal variances. (See details.)
sd.obj
Object to predict the marginal standard deviation of the spatial process.
return.X
If true returns the big X matrix used for the estimate.
null.function
An S function that creates the matrices for the null space model.
The default is make.tmatrix, an S function that creates polynomial
null spaces of degree up to m-1. (See details)
offset
The offset to be used in the GCV criterion. Default is 0. This would be
used when Krig is part of a backfitting algorithm and the offset has to be
adjusted to reflect other model degrees of freedom.
cov.by.name
If false, a local copy of the covariance function is attached to the Krig
output object. This provides an unambiguous version and guards
against the problem of the covariance function being changed after the
Krig object is created. If true just the name o
outputcall
If NULL the output object will have a $call argument based on this call.
If no NULL the output call will have whatever is passed. This is kludge
for the Tps function so that it return a Krig object but have the right
call argument.
...
Optional arguments that appear are assume to be additional arguments
to the covariance function.