Transform Smooth Constructs to Random Effects
The transformer function takes a bamlss.frame
object and transforms all
smooth.construct
s into a random effects representation. Note that this
is only possible for smooth terms with a single smoothing variance. The function
is based on function smooth2random
.
randomize(x)
x |
Object returned from function |
A transformed bamlss.frame
. To each smooth.construct
model term
an element named "Xf"
, the fixed effects design matrix, and an element "rand$Xr"
,
the random effects design matrix, is added. In addition, for re-transforming parameters elements
"trans.U"
and "trans.D"
are supplied. See also function
smooth2random
.
Fahrmeir L, Kneib T, Lang S, Marx B (2013). Regression - Models, Methods and Applications. Springer-Verlag, Berlin. ISBN 978-3-642-34332-2.
Wood S.N. (2006). Generalized Additive Models: An Introduction with R. Chapman and Hall/CRC.
## Simulate data. d <- GAMart() ## Create a "bamlss.frame". bf <- bamlss.frame(num ~ s(x1) + s(x2) + s(x3) + s(lon,lat), data = d) ## Structure of the "s(x1)" smooth.construct. str(bf$x$mu$smooth.construct[["s(x1)"]]) ## Transform. bf <- randomize(bf) ## New structure adding fixed ## and random effect matrices. str(bf$x$mu$smooth.construct[["s(x1)"]])
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.