builders: Build the Variable Names or Data Objects for Estimation

buildersR Documentation

Build the Variable Names or Data Objects for Estimation

Description

These are a set of internal utility functions. They are not intended for general use.

Usage

.namesL(block, number)

.buildL(data, block, number, dpar)

.namesSD(ranef, block, dpar)

.buildSD(data, ranef, block, dpar)

.namesZ(block, number, dpar)

.buildZ(data, block, number, dpar)

Arguments

block

Which random effect block to use. An integer.

number

The number of elements in that random effect block. An integer.

data

A data object. For example the result of make_standata() for .buildZ(), which is a list, or a dataset of the posterior draws such as from as_draws_df() for .buildL() and .buildSD().

dpar

Which dpar to use. Does not apply to the L matrix.

ranef

A data set with information about the model object random effects. Only used for .namesSD and .buildSD.

Details

  • .namesLGenerate names of an L matrix from brms. Create the variable names for the Cholesky decomposition of the random effects correlation matrix in brms. Note that brms returns the lower triangular matrix and we want the upper triangular matrix, so the names are transposed. The results can then be passed to the tab2mat function to convert the row vector into a matrix.

  • .buildLReturns the L matrix object. Rows are posterior draws.

  • .namesSDCreate the names of random effect standard deviation estimates.

  • .buildSDReturn matrix of random effect standard deviation estimates. Rows are posterior draws.

  • .namesZCreate the names of random effects data for predictions.

  • .buildZReturn matrix of data for random effect predictions.

Value

A character vector for all .names functions or a matrix for all .build functions.


brmsmargins documentation built on May 20, 2022, 1:07 a.m.