
Last chance! 50% off unlimited learning
Sale ends in
The generic function is only a copy of smooth.construct
adding
a …
argument. For objects of class "bamlss.frame"
and "bamlss"
the
method extracts all smooth model terms, see function bamlss.frame
for details
on the setup of BAMLSS.
## Function as in package mgcv
## but with additional dots argument.
smooth.construct(object, data, knots, ...)## For 'bamlss.frame's.
# S3 method for bamlss.frame
smooth.construct(object, data = NULL, knots = NULL,
model = NULL, drop = TRUE, ...)
# S3 method for bamlss.formula
smooth.construct(object, data = NULL, knots = NULL,
model = NULL, drop = TRUE, ...)
# S3 method for bamlss.terms
smooth.construct(object, data = NULL, knots = NULL,
model = NULL, drop = TRUE, ...)
Either a smooth specification object, or object of class "bamlss"
,
"bamlss.frame"
, "bamlss.formula"
or "bamlss.terms"
. For smooth
specification objects, see function smooth.construct
.
A data frame or list, see also see function smooth.construct
.
See function smooth.construct
.
Character, specifies for which model parameter the smooth constructs should be created.
If there is only one model parameter the returned named list is simplified.
Arguments passed to the smooth term constructor functions.
For smooth specification objects see function see smooth.construct
. For
objects of class "bamlss.frame"
or "bamlss"
the list of smooth constructs,
see function bamlss.frame
for more details.
# NOT RUN {
## Generate some data.
d <- GAMart()
## Create a "bamlss.frame".
bf <- bamlss.frame(num ~ s(x1) + s(x2), data = d)
## Extract the smooth construct.
sc <- smooth.construct(bf)
str(sc)
## Also possible with formulas.
f <- bamlss.formula(list(
num ~ s(x1) + te(lon,lat),
sigma ~ s(x2)
), family = "gaussian")
sc <- smooth.construct(f, data = d)
str(sc)
# }
Run the code above in your browser using DataLab