tpower: Compute a truncated power function.

View source: R/tpower.R

tpowerR Documentation

Compute a truncated power function.

Description

Compute a truncated power function.

Usage

tpower(x, knot, p)

Arguments

x

a vector on which the basis is calculated.

knot

a scalar giving the truncation point.

p

a scalar power for the basis, e.g. p = 3 for cubic TPF.

Value

a vector with the truncated power function.

Author(s)

Paul Eilers

References

Eilers, P.H.C. and Marx, B.D. (2021). Practical Smoothing, The Joys of P-splines. Cambridge University Press.

Examples

library(JOPS)
# Basis  on grid
x = seq(0, 4, length = 500)
knots = 0:3
Y = outer(x, knots, tpower, 1)
matplot(x, Y, type ='l', lwd = 2, xlab = 'x', ylab = '',
main ='Linear TPF basis')


JOPS documentation built on Sept. 8, 2023, 5:42 p.m.

Related to tpower in JOPS...