Learn R Programming

hero (version 0.6)

predict.hero_bspline: Predict method for hero_bspline object

Description

Predicted values based on object created by bspline.

Usage

# S3 method for hero_bspline
predict(object, newx, nderiv = 0L, sparse = TRUE, ...)

Value

An \(n \times k\) matrix (or

Matrix-class object if

sparse = TRUE), where \(n\) is the number of values in newx and \(k\) is the number of basis functions in object. Each row gives the predicted values of the basis functions for the appropriate value of newx.

Arguments

object

A hero_bspline object created by bspline

newx

A numeric vector of values at which to evaluate the B-spline functions or derivatives.

nderiv

An integer value specifying the derivative order of the B-splines. The default is 0.

sparse

A logical value indicating if the result should be a sparse version of the Matrix-class.

...

Not currently implemented.

See Also

bspline

Examples

Run this code
b = bspline(nbasis = 10)
p = predict(b, newx = seq(0, 1, len = 101))

Run the code above in your browser using DataLab