gmfamm_predict {gmfamm}R Documentation

Prediction of Generalized Multivariate Functional Additive Mixed model

Description

Note: FPC basis has to be evaluated for newdata before the predict function.

Usage

gmfamm_predict(
  object,
  newdata,
  model = NULL,
  term = NULL,
  match.names = TRUE,
  intercept = TRUE,
  type = c("link", "parameter"),
  compress = TRUE,
  FUN = function(x) {
     mean(x, na.rm = TRUE)
 },
  trans = NULL,
  what = c("samples", "parameters"),
  nsamps = NULL,
  verbose = FALSE,
  drop = TRUE,
  cores = NULL,
  chunks = 1,
  ...
)

Arguments

object

bamlss-model object to be predicted.

newdata

Dataset for which to create predictions. Not needed for conditional survival probabilities.

model

Character or integer, specifies the model for which predictions should be computed.

term

Character or integer, specifies the model terms for which predictions are required. Note that, e.g., term = c("s(x1)", "x2") will compute the combined prediction s(x1) + x2.

match.names

Should partial string matching be used to select the terms for prediction. Note that, e.g., term = "x1" will select all terms including "x1" if match.names = TRUE.

intercept

Should the intercept be included?

type

Character string indicating which type of predictions to compute. link returns the predictors of the corresponding model., "parameter" returns the estimates for all pedictors, "probabilities" returns the survival probabilities conditional on the survival up to the last longitudinal measurement, and "cumhaz" return the cumulative hazard up to the survival time or for a time window after the last longitudinal measurement. If type is set to "loglik", the log-likelihood of the joint model is returned. Note that types "probabilities" and "cumhaz" are not yet implemented.

compress

TRUE if the

FUN

A function that should be applied on the samples of predictors or parameters, depending on argument type.

trans

A transformer function or named list of transformer functions that computes transformed predictions. If trans is a list, the list names must match the names of the parameters of the bamlss.family.

what

Predictions can be computed from samples or estimated parameters of optimizer functions. If no samples are available the default is to use estimated parameters.

nsamps

If the fitted bamlss object contains samples of parameters, computing predictions may take quite some time. Therefore, to get a first feeling it can be useful to compute predictions only based on nsamps samples, i.e., nsamps specifies the number of samples which are extracted on equidistant intervals.

verbose

Print information during runtime of the algorithm.

drop

If predictions for only one model are returned, the list structure is dropped.

cores

Specifies the number of cores that should be used for prediction. Note that this functionality is based on the parallel package.

chunks

Should computations be split into chunks? Prediction is then processed sequentially.

...

Currently not used.

Details

Functionality of some arguments are restricted.


[Package gmfamm version 0.1.0 Index]