tramME: General function to define and fit 'tramME' models

View source: R/models.R

tramMER Documentation

General function to define and fit tramME models

Description

General function to define and fit tramME models

Usage

tramME(
  formula,
  data,
  subset,
  weights,
  offset,
  na.action,
  tram = NULL,
  call = NULL,
  ctm = NULL,
  smooth = NULL,
  negative = NULL,
  silent = TRUE,
  resid = FALSE,
  do_update = FALSE,
  estinit = TRUE,
  initpar = NULL,
  fixed = NULL,
  nofit = FALSE,
  control = optim_control(),
  ...
)

Arguments

formula

an object of class "formula": a symbolic description of the model structure to be fitted. The details of model specification are given under tram and in the package vignette.

data

an optional data frame, list or environment (or object coercible by as.data.frame to a data frame) containing the variables in the model. If not found in data, the variables are taken from environment(formula).

subset

an optional vector specifying a subset of observations to be used in the fitting process.

weights

an optional vector of weights to be used in the fitting process. Should be NULL or a numeric vector. If present, the weighted log-likelihood is maximised.

offset

this can be used to specify an _a priori_ known component to be included in the linear predictor during fitting. This should be NULL or a numeric vector of length equal to the number of cases.

na.action

a function which indicates what should happen when the data contain NAs. The default is set to na.omit.

tram

Parameter vector for the tram model type.

call

The original function call (to be passed from the wrapper).

ctm

A model object of the ctm class that descibes the fixed-effects part of the tramME model.

smooth

A tramME_smooth object that describes the smooth additive elements of the tramME model.

negative

Logical; if TRUE, the model is parameterized with negative coefficinets for the elements of the linear predictor.

silent

Logical. Make TMB functionality silent.

resid

Logical. If TRUE, the score residuals are also calculated. This comes with some performance cost.

do_update

Logical. If TRUE, the model is set up so that the weights and the offsets are updateable. This comes with some performance cost.

estinit

logical, estimate a vector of initial values for the fixed effects parameters from a (fixed effects only) mlt model

initpar

named list of initial parameter values, if NULL, it is ignored

fixed

a named vector of fixed regression coefficients; the names need to correspond to column names of the design matrix

nofit

logical, if TRUE, creates the model object, but does not run the optimization

control

list with controls for optimization

...

additional arguments to tram.

Details

The specific model functions (LmME, BoxCoxME, ColrME, etc.) are wrappers around this function.

Warning

Typically, the tramME function shouldn't be called directly; it is only exported to allow the advanced users to define their tramME models in a more flexible way from their basic building blocks.


tramME documentation built on July 9, 2023, 7:10 p.m.