MortSmooth_bbase: Construct B-spline basis

View source: R/MortalitySmooth_fun.R

MortSmooth_bbaseR Documentation

Construct B-spline basis

Description

This is an internal function of package MortalitySmooth which creates equally-spaced B-splines basis over an abscissa of data.

Usage

MortSmooth_bbase(x, xl, xr, ndx, deg)

Arguments

x

vector for the abscissa of data;

xl

left boundary;

xr

right boundary;

ndx

number of internal knots minus one or number of internal intervals;

deg

degree of the splines.

Details

The function reproduce an algorithm presented by Eilers and Marx (2010) using differences of truncated power functions (see MortSmooth_tpower). The final matrix has a single B-spline for each of the [ndx + deg] columns. The number of rows is equal to the length of x.

The function differs from bs in the package splines since it automatically constructed B-splines with identical shape. This would allow a simple interpretation of coefficients and application of simple differencing.

Value

A matrix containing equally-spaced B-splines of degree deg along x for each column.

Author(s)

Carlo G Camarda


mpascariu/ungroup documentation built on Jan. 31, 2024, 1:59 a.m.