get_mmm_derivatives: Determine the subject level derivatives.

get_mmm_derivativesR Documentation

Determine the subject level derivatives.

Description

Run mixed models without iterating and return subject level derivatives

Usage

get_mmm_derivatives(
  stacked_data,
  id,
  fixed,
  random,
  pairs,
  model_families,
  start_values,
  nAGQ = 11
)

Arguments

stacked_data

A list of data.frames returned by the stack_data() function

id

The name of the column with subject ids in stacked_data

fixed

A formula (as character string) for the fixed part of the mixed model. Passed to as.formula().

random

A formula (as character string) for the random part of the mixed model. Passed to as.formula().

pairs

A character matrix with pairs returned by the make_pairs function.

model_families

A list with the model families returned by the test_input_datatypes() function.

start_values

A list (length == length(stacked_data)) with start values returned by the get_start_values() function.

nAGQ

The number of knots to use on the Adapative Gaussian Quadrature (passed to GLMMadaptive::mixed_model()).

Details

This function uses the start values determined in by the function get_start_values() to determine the subject level contributions to the derivatives. In turn these are used to average the parameters and standard errors for the full multivariate mixed model.

Value

A list of length nrow(pairs) each with two elements:

  • df_hessiansa list with data.frames storing the subject level Hessians

  • df_gradientsa list with data.frames storing the subject level gradients


JanvandenBrand/jmmm documentation built on May 30, 2022, 9:37 a.m.