srf | R Documentation |
This function generates the design for a 2-D penalized spline using (almost)
radial basis functions. Use this type of term to account for spatial
variation. Smooth interactions between covariates are often better fitted via
the interactions of lin
and sm
terms, because
they allow a decomposition into (linear and smooth) marginal trends and
(linear-linear, linear-smooth/"varying coefficients", and smooth-smooth)
interactions. This decomposition usually makes no sense for spatial data.
srf( coords, K = min(50, sum(nd)/4), rankZ = 0.999, centerBase = TRUE, baseType = c("B", "thinPlate"), decomposition = c("ortho", "MM", "asIs"), tol = 1e-10 )
coords |
a |
K |
(approximate) number of basis functions in the original basis
(defaults to 50). If |
rankZ |
how many eigenvectors to retain from the eigen decomposition: either a number > 3 or the proportion of the sum of eigenvalues the retained eigenvectors must represent at least. Defaults to .999. |
centerBase |
project the basis of the penalized part into the complement of the column space of the basis of the unpenalized part? defaults to TRUE |
baseType |
Defaults to |
decomposition |
use a (truncated) spectral decomposition of the implied
prior covariance of f(x, y) for a low rank representation with
orthogonal basis functions and i.i.d. coefficients ( |
tol |
count eigenvalues smaller than this as zero |
Note that srf()
expects coords
to be a data.frame
within
the larger data.frame
supplied to spikeSlabGAM
in its
data
argument, i.e. coords
is considered a two-dimensional
covariate.
If baseType
is 'thinPlate'
, knot locations for the thin plate
spline basis are chosen via a space-filling algorithm (i.e. medoids returned
by clara
) as suggested in Ruppert/Wand/Carroll, ch.
13.5. Since the thin plate penalty term penalizes deviations from a linear
trend, it is recommended to add marginal linear trends and their interaction
to the model if baseType ="thinPlate"
to improve the fit.
Note that predictions outside the convex hull (sometimes even just close its border) of the original data tend to become rather unstable very quickly.
a design matrix for the 2-D spline.
Fabian Scheipl
Ruppert, D., Wand, M.P., Carroll, R.J. (2003). Semiparametric Regression. Cambridge University Press
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.