Skip to contents

This helper does some simple post-processing of the TMB object and optimization results, including setting names, inverting matrices etc.

Usage

h_mmrm_tmb_fit(tmb_object, tmb_opt, data, weights, formula_parts, tmb_data)

Arguments

tmb_object

(list)
created with TMB::MakeADFun().

tmb_opt

(list)
optimization result.

data

(data.frame)
input data containing the variables used in formula.

weights

(vector)
weights to be used in the fitting process.

formula_parts

(mmrm_tmb_formula_parts)
produced by h_mmrm_tmb_formula_parts().

tmb_data

(mmrm_tmb_data)
produced by h_mmrm_tmb_data().

Value

List of class mmrm_tmb with:

  • cov: estimated covariance matrix, or named list of estimated group specific covariance matrices.

  • beta_est: vector of coefficient estimates.

  • beta_vcov: Variance-covariance matrix for coefficient estimates.

  • theta_est: vector of variance parameter estimates.

  • theta_vcov: variance-covariance matrix for variance parameter estimates.

  • neg_log_lik: obtained negative log-likelihood.

  • formula_parts: input.

  • data: input.

  • weights: input.

  • reml: input as a flag.

  • opt_details: list with optimization details including convergence code.

  • tmb_object: original TMB object created with TMB::MakeADFun().

  • tmb_data: input.