Learn R Programming

icmstate (version 0.2.0)

bbase_D: Compute a B-spline basis

Description

Copied from icpack/bases.R, modified diff() function for speed.

Usage

bbase_D(x, xl = min(x), xr = max(x), nseg = 10, bdeg = 3)

Value

A matrix containing the basis

Arguments

x

The vector of values for which the basis is to be evaluated

xl

The left boundary of the domain

xr

The right boundary of the domain

nseg

The number of inter-knot segments on the domain

bdeg

The degree of the B-splines (2 means quadratic, 3 means cubic, and so on)

Examples

Run this code
x = runif(100)
B = bbase_D(x, 0, 1, 20, 3)

Run the code above in your browser using DataLab