ps2D_PartialDeriv
provides the partial derivative
P-spline surface along x
, with aniosotripic penalization of
tensor product B-splines.
ps2D_PartialDeriv(
Data,
Pars = rbind(c(min(Data[, 1]), max(Data[, 1]), 10, 3, 1, 2), c(min(Data[, 2]),
max(Data[, 2]), 10, 3, 1, 2)),
XYpred = cbind(Data[, 1], Data[, 2])
)
a vector of length (Pars[1, 3] + Pars[1, 4]) * (Pars[1, 3] + Pars[1, 4]).
of (unfolded) estimated P-spline coefficients.
the tensor product B-spline matrix of dimensions m
by length(coef)
.
a vector of length(y)
of smooth estimated means (at the x, y
locations).
a vector of length nrow(XYpred)
of (future) predictions.
a vector of length (Pars[1, 3] + Pars[1,4] - 1) * (Pars[1,3]+Pars[1,4]).
of (unfolded) partial derivative estimated P-spline coefficients.
the tensor product B-spline matrix of dimensions m
by lengh(d_coef)
, associated with
the partial derivative of the tensor basis.
a vector of length(y)
of partial derivative (along x
)
of the smooth estimated means (at the x, y
locations).
a vector of length nrow(XYpred)
of partial derivative (future) predictions.
a matrix of 2 rows, where each the first (second) row
sets the P-spline paramters for x (y)
: min max nseg bdeg lambda pord
. See the argument above.
root leave-one-out CV or root average PRESS.
a matrix with two columns (x, y)
that give the coordinates
of (future) prediction; the default is the data locations.
a matrix of 3 columns x, y, z
of equal length;
the response is z
.
a matrix of 2 rows, where the first and second row
sets the P-spline paramters for x
and y
, respectively.
Each row consists of: min max nseg bdeg lambda pord
.
The min
and max
set the ranges, nseg
(default 10)
is the number of evenly spaced segments between min
and max
,
bdeg
is the degree of the basis (default 3 for cubic),
lambda
is the (positive) tuning parameter for the penalty (default 1),
pord
is the number for the order of the difference penalty (default 2).
a matrix with two columns (x, y)
that give the coordinates
of (future) prediction; the default is the data locations.
Brian Marx
This is support function for sim_vcpsr
.
Marx, B. D. (2015). Varying-coefficient single-index signal regression. Chemometrics and Intelligent Laboratory Systems, 143, 111–121.
Eilers, P.H.C. and Marx, B.D. (2021). Practical Smoothing, The Joys of P-splines. Cambridge University Press.