Learn R Programming

countSTAR (version 1.0.2)

splineBasis: Initialize and reparametrize a spline basis matrix

Description

Following Wand and Ormerod (2008), compute a low-rank thin plate spline basis which is diagonalized such that the prior variance for the nonlinear component is a scalar times a diagonal matrix. Knot locations are determined by quantiles and the penalty is the integrated squared second derivative.

Usage

splineBasis(tau, sumToZero = TRUE, rescale01 = TRUE)

Value

B_nl: the nonlinear component of the spline basis matrix

Arguments

tau

m x 1 vector of observed points

sumToZero

logical; if TRUE, enforce a sum-to-zero constraint (useful for additive models)

rescale01

logical; if TRUE, rescale tau to the interval [0,1] prior to computing basis and penalty matrices