For a fitted CRS mean-regression object, crshat() returns the linear
operator mapping the training response to fitted values at newdata. The
default output="matrix" returns a dense matrix with class
c("crshat", "matrix"). The output="apply" route applies the same
operator to y and is preferable when many right-hand sides are needed.
The helper preserves the fitted object's fixed spline/kernel structure,
including basis family, degree, segments, pruning state, categorical-kernel
bandwidths, weights, and the package's weighted least-squares rank policy. It
does not run bandwidth or degree selection.
For deriv > 0, crshat() returns the derivative operator
\(H^{(s)}\) such that \(H^{(s)} y\) matches the corresponding CRS
gradient prediction at newdata. This is the CRS analogue of
npreghat's derivative-selector behavior in np. Derivative operators
are available for fixed-structure mean CRS fits across additive, tensor, and
GLP bases, including categorical-kernel fits. If the requested derivative
order exceeds the fitted spline degree for that predictor, the returned
operator is zero.
Quantile CRS objects remain intentionally unsupported because quantile
estimation is not linear in the response.