smooth.construct.unc_pcre.smooth.spec {MJMbamlss}R Documentation

mgcv-style constructor for PC-basis functional random effects (no constraint)

Description

Sets up design matrix for functional random effects based on the PC scores of the covariance operator of the random effect process. Note that there is no constraint on the smoother. See smooth.construct.re.smooth.spec for more details on mgcv-style smoother specification and smooth.construct.pcre.smooth.spec for the corresponding refund implementation.

Usage

## S3 method for class 'unc_pcre.smooth.spec'
smooth.construct(object, data, knots, ...)

Arguments

object

a smooth specification object, see smooth.construct

data

see smooth.construct.

knots

see smooth.construct.

...

see smooth.construct.

Details

This is an internal function as the corresponding smooth object and its predict method is primarily used within the bamlss call.

Value

An object of class "random.effect". See smooth.construct for the elements that this object will contain.

Author(s)

Alexander Volkmann; adapted from 'pcre' constructor by F. Scheipl (adapted from 're' constructor by S.N. Wood).

Examples

data(pbc_subset)
mfpca <- preproc_MFPCA(pbc_subset, uni_mean = paste0(
  "logy ~ 1 + sex + drug + s(obstime, k = 5, bs = 'ps') + ",
  "s(age, k = 5, bs = 'ps')"),
  pve_uni = 0.99, nbasis = 5, weights = TRUE, save_uniFPCA = TRUE)
pbc_subset <- attach_wfpc(mfpca, pbc_subset, n = 2)
mfpca_list <- list(
  list(functions = funData::extractObs(mfpca$functions, 1),
       values = mfpca$values[1]),
  list(functions = funData::extractObs(mfpca$functions, 2),
       values = mfpca$values[2]))
sm <- smoothCon(s(id, fpc.1, bs = "unc_pcre",
      xt = list("mfpc" = mfpca_list[[1]], scale = "FALSE")), pbc_subset)

[Package MJMbamlss version 0.1.0 Index]