Zncsspline: Calculates the design matrix for fitting the random component...

View source: R/mat.functions.r

ZncssplineR Documentation

Calculates the design matrix for fitting the random component of a natural cubic smoothing spline

Description

Calculates the design matrix, Z, of the random effects for a natural cubic smoothing spline as described by Verbyla et al., (1999). An initial design matrix, \bold{\Delta} \bold{\Delta}^{-1} \bold{\Delta}, based on the knot points is computed. It can then be post multiplied by the power of the tri-diagonal matrix \bold{G}_s that is proportional to the variance matrix of the random spline effects. If the power is set to 0.5 then the random spline effects based on the resulting Z matrix will be independent with variance \sigma_s^2.

Usage

Zncsspline(knot.points, Gpower = 0, print = FALSE)

Arguments

knot.points

A numeric giving the values of the knot points to be used in fitting the spline. These must be orderd in increasing order.

Gpower

A numeric giving the power of the tri-diagonal matrix \bold{G}_s from which the variance matrix of the random spline effects is caluclated. that the initial design matrix is to be the value of the variance component for the random spline effects. The smoothing parameter is then the inverse of the ratio of this component to the residual variance.

print

A logical indicating whether to print the \bold{\Delta} and \bold{G}_s matrices.

Value

A matrix containing the design matrix.

Author(s)

Chris Brien

References

Verbyla, A. P., Cullis, B. R., Kenward, M. G., and Welham, S. J. (1999). The analysis of designed experiments and longitudinal data by using smoothing splines (with discussion). Journal of the Royal Statistical Society, Series C (Applied Statistics), 48, 269-311.

See Also

mat.ncssvar.

Examples

Z <- Zncsspline(knot.points = 1:10, Gpower = 0.5)

dae documentation built on June 22, 2024, 9:07 a.m.