psNormal_Deriv
provides the derivative
P-spline fit along x
.
psNormal_Deriv(
x,
y,
xl = min(x),
xr = max(x),
nseg = 10,
bdeg = 3,
pord = 2,
lambda = 1,
wts = rep(1, length(y)),
xgrid = x
)
a vector of length(nsegs + bdeg)
of estimated P-spline coefficients.
The B-spline matrix of dimensions m
by length(coef)
.
a vector of length(y)
of smooth estimated means (at the x
locations).
a vector of length(xgrid)
of (future) predictions.
a vector of length(nsegs + bdeg - 1)
of differenced (derivative) estimated P-spline coefficients.
The first derivative B-spline matrix of dimensions m
by lengh(d_coef)
.
a vector of length(y)
of partial derivative (along x
)
of the smooth estimated means (at the x
locations).
a vector of length lenght(xgrid)
of partial derivative (future) predictions.
the number for the min along x
(default is min(x
)).
the number for the max along x
(default is max(x
)).
the number of evenly spaced segments between xl
and xr
.
the number of the degree of the basis, usually 1, 2, or 3 (default).
the number of the order of the difference penalty, usually 1, 2 (default), or 3.
the positive tuning parameter (default 1).
the vector for the continuous regressor of length(y)
and the abcissae of fit.
the response vector, usually continuous data.
the number for the min along x
(default is min(x
)) .
the number for the max along x
(default is max(x
)).
the number of evenly spaced segments between xl
and xr
.
the number of the degree of the basis, usually 1, 2, or 3 (defalult).
the number of the order of the difference penalty, usually 1, 2 (defalult), or 3.
the positive tuning parameter (default 1).
the vector of weights, default is 1; 0/1 allowed.
a scalar or a vector that gives the x
locations for prediction, useful for plotting.
If a scalar (default 100) is used then a uniform grid of this size along (xl
, xr
).
Paul Eilers and Brian Marx
This is also a
support function needed for sim_psr
and sim_vcpsr
.
SISR (Eilers, Li, Marx, 2009).
Marx, B. D. (2015). Varying-coefficient single-index signal regression. Chemometrics and Intelligent Laboratory Systems, 143, 111–121.
Eilers, P.H.C., B. Li, B.D. Marx (2009). Multivariate calibration with single-index signal regression, Chemometrics and Intellegent Laboratory Systems, 96(2), 196-202.
Eilers, P.H.C. and Marx, B.D. (2021). Practical Smoothing, The Joys of P-splines. Cambridge University Press.
sim_psr sim_vcpsr