powered by
Compute a truncated power function.
tpower(x, knot, p)
a vector with the truncated power function.
a vector on which the basis is calculated.
a scalar giving the truncation point.
a scalar power for the basis, e.g. p = 3 for cubic TPF.
p = 3
Paul Eilers
Eilers, P.H.C. and Marx, B.D. (2021). Practical Smoothing, The Joys of P-splines. Cambridge University Press.
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')
Run the code above in your browser using DataLab