Learn R Programming

hero (version 0.6)

precompute: Precompute objects

Description

This function is an internal function to compute objects needed for fast implementation of the sandwich smoother. It is meant to be an internal function, so use this at your own risk.

Usage

precompute(B, P, m)

Value

A list of needed objects

Arguments

B

A matrix of basis functions

P

A penalty matrix

m

Difference order of P-spline

Examples

Run this code
object = bspline(nbasis = 10)
# sequence to evaluate
evalarg = seq(0, 1, len = 11)
# penalty matrix
D = diffpen(object)
P = Matrix::crossprod(D)
B = predict(object, evalarg)
stuff = precompute(B, P, m = 2)

Run the code above in your browser using DataLab