gpSpline: Generate a Basis Matrix for a Gaussian Process

Description Usage Arguments Value

View source: R/sdrtools.R

Description

The function has a usage similar to bs and ns in the splines package. However, this function utilizes smooth constructor in the package mgcv to construct a gaussian process basis matrix.

Usage

1
2
3
4
5
6
7
8
9
gpSpline(
  x,
  df = 5,
  knots = NULL,
  intercept = FALSE,
  fx = FALSE,
  S = NULL,
  m = c(3, -1, 1.4)
)

Arguments

x

the predictor variable. Missing values are allowed.

df

degrees of freedom of the basis matrix. The default is 5. The minimum allowed is 3.

knots

breakpoints that define the spline. by default these are automatically selected, and not defined by the user.

intercept

If TRUE, an intercept is included in the basis matrix.

fx

If TRUE, it removes the penalization.

S

penalty matrix, defined internally if NULL (the default).

m

a numeric vector. selects the covariance function, sets the scale parameter and, if applicable, shape parameter. m[1] between 1 and 5 selects the correlation function from respectively, spherical, power exponential, and Matern with kappa = 1.5, 2.5 or 3.5. m[2] if present specifies the scale parameter, with non-positive or absent indicating that the Kammann and Wand estimate should be used. m[3] can be used to specify the shape parameter for the power exponential function. See smooth.construct.gp.smooth.spec for more details. the default option here is c(3,-1,1.4) which indicates the power exponential covariance function with the Kammann and Wand scale estimate, and a shape parameter of 1.4.

Value

A matrix with class "gp" and class "basis".


abnormally-distributed/cvreg documentation built on May 3, 2020, 3:45 p.m.