As in mgcv(gam)
, shape preserving smooth terms are specified in a scam
formula using s
terms. All the shape constrained smooth terms are constructed using the B-splines basis proposed by Eilers and Marx (1996) with
a discrete penalty on the basis coefficients.
The univariate single penalty built in shape constrained smooth classes are summarized as follows
Monotone increasing P-splines bs="mpi"
. To achieve monotone increasing smooths these reparametrize the coefficients
so that they form an increasing sequence.
For details see
smooth.construct.mpi.smooth.spec
.
Monotone decreasing P-splines bs="mpd"
. To achieve monotone decreasing smooths these reparametrize the coefficients
so that they form a decreasing sequence. A first order difference penalty applied to the basis coefficients starting with the
second is used for the monotone increasing and decreasing cases.
Convex P-splines bs="cx"
. These reparametrize the coefficients so that the second order differences of the basis coefficients are greater than zero. For details see
smooth.construct.cx.smooth.spec
.
Concave P-splines bs="cv"
. These reparametrize the coefficients so that the second order differences of the basis coefficients are less than zero. For details see
smooth.construct.cv.smooth.spec
.
Monotone increasing and convex P-splines bs="micx"
. These reparametrize the coefficients
so that the first and the second order differences of the basis coefficients are greater than zero.
For details see
smooth.construct.micx.smooth.spec
.
Monotone increasing and concave P-splines bs="micv"
. These reparametrize the coefficients
so that the first order differences of the basis coefficients are greater than zero while the second order difference
are less than zero.
Monotone decreasing and convex P-splines bs="mdcx"
. These reparametrize the coefficients
so that the first order differences of the basis coefficients are less than zero while the second order difference
are greater.
For details see smooth.construct.mdcx.smooth.spec
.
Monotone decreasing and concave P-splines bs="mdcv"
. These reparametrize the coefficients
so that the first and the second order differences of the basis coefficients are less than zero.
For all four types of the mixed constrained smoothing a first order difference penalty applied to the basis coefficients starting with the third one is used.
Using the concept of the tensor product spline bases bivariate smooths under monotonicity constraint where monotonicity may be assumed on only one of the covariates (single monotonicity) or both of them (double monotonicity) are added as the smooth terms of the SCAM. Bivariate B-spline is constructed by expressing the coefficients of one of the marginal univariate B-spline bases as the B-spline of the other covariate. Double or single monotonicity is achieved by the corresponding re-parametrization of the bivariate basis coefficients to satisfy the sufficient conditions formulated in terms of the first order differences of the coefficients. The following explains the built in bivariate monotonic smooth classes.
Double monotone increasing P-splines bs="tedmi"
.
See smooth.construct.tedmi.smooth.spec
for details.
Double monotone decreasing P-splines bs="tedmd"
.
Single monotone increasing P-splines along the first covariate direction bs="tesmi1"
.
Single monotone increasing P-splines along the second covariate direction bs="tesmi2"
.
Single monotone decreasing P-splines along the first covariate direction bs="tesmd1"
.
Single monotone decreasing P-splines along the second covariate direction bs="tesmd2"
.
Double penalties for the monotonic tensor product smooths are obtained from the penalties of the marginal smooths.
Pya, N. and Wood, S.N. (2015) Shape constrained additive models. Statistics and Computing, 25(3), 543-559
Pya, N. (2010) Additive models with shape constraints. PhD thesis. University of Bath. Department of Mathematical Sciences
Eilers, P.H.C. and B.D. Marx (1996) Flexible Smoothing with B-splines and Penalties. Statistical Science, 11(2):89-121
Wood S.N. (2006a) Generalized Additive Models: An Introduction with R. Chapman and Hall/CRC Press.
Wood, S.N. (2006b) Low rank scale invariant tensor product smooths for generalized additive mixed models. Biometrics 62(4):1025-1036
s
, smooth.construct.mpi.smooth.spec
,
smooth.construct.mpd.smooth.spec
,
smooth.construct.cx.smooth.spec
,
smooth.construct.cv.smooth.spec
,
smooth.construct.micx.smooth.spec
,
smooth.construct.micv.smooth.spec
,
smooth.construct.mdcx.smooth.spec
,
smooth.construct.mdcv.smooth.spec
,
smooth.construct.tedmi.smooth.spec
,
smooth.construct.tedmd.smooth.spec
,
smooth.construct.tesmi1.smooth.spec
,
smooth.construct.tesmi2.smooth.spec
,
smooth.construct.tesmd1.smooth.spec
,
smooth.construct.tesmd2.smooth.spec
# NOT RUN {
## see examples for scam
# }
Run the code above in your browser using DataLab