constructBasis: constructBasis

View source: R/helper.R

constructBasisR Documentation

constructBasis

Description

This function construct response basis functions.

Usage

constructBasis(
  splitMidPointY,
  y = NULL,
  splineDf = 2,
  basis,
  newKnots = F,
  eps = 0.001
)

Arguments

splitMidPointY

vector of representative response values in each bin after discretization.

y

vector of responses.

splineDf

the number of response basis functions.

basis

a character or a function specifying sufficient statistics, i.e., spline basis. For basis = "Gaussian", y, y^2 are used. For basis = "nsTransform", transformed natural cubic splines are used. If basis is a function, it should take a vector of response values and output a basis matrix: each row stands for a response value and each column stands for a basis function.

newKnots

if TRUE, quantiles of y are used as the knots for splines. If FALSE, quantiles of splitMidPointY are used as the knots for splines.

eps

a non-negative scalar added to the penalty for computational stability. Default is 0.001.

Value

This function returns a list of values.

  • z: the spline basis matrix.

  • penalty: a vector of penalty.factors.


ZijunGao/LinCDE documentation built on Jan. 2, 2023, 11:14 p.m.