Generates \(b_1(p), b_2(p), \ldots\) such that, for 0 < p < 1,
$$\theta_1*b_1(p) + \theta_2*b_2(p) + \ldots$$
is a piecewise linear function with slopes
\((\theta_1, \theta_2, \ldots)\).
Usage
plf(p, knots)
Value
A matrix with one row for each element of p, and length(knots) + 1 columns.
The knots are returned as attr(, "knots").
Any linear combination of the basis matrix is a piecewise linear function where
each coefficient represents the slope in the corresponding sub-interval (see ‘Examples’).
Arguments
p
a numeric vector of values between 0 and 1.
knots
a set of internal knots between 0 and 1.
It can be NULL for no internal knots.
This function permits computing a piecewise linear function on the unit interval.
A different slope holds between each pair of knots, and the function
is continuous at the knots.