compute_marginal_means_and_variances: Compute marginal means and variances

Description Usage Arguments

View source: R/05-posthoc-quantities.R

Description

Given optimization results with log posteriors computed, compute the marginal means and variances. These are the final outputs of the whole estimation procedure.

Linear constraints are corrected for at this point. Marginal variances for linear combinations of latent variables are also available.

Usage

1
2
3
4
5
6
7
compute_marginal_means_and_variances(
  model_results,
  model_data,
  i = NULL,
  constrA = NULL,
  lincomb = NULL
)

Arguments

model_results

Output of optimization; can be before or after you call add_log_posterior_values().

model_data

ccmodeldata object output by model_setup()

i

Either a 1) vector giving the indices of the latent variables for which you want marginal means and variances or 2) an object of class ccindex output by get_indices() which prescribes which terms you want means/variances for.

constrA

Either a sparse matrix whose columns contain linear constraints under which you would like to compute means/variances, or NULL. If NULL, any linear constraints will be pulled from model_data.

lincomb

Either a sparse matrix whose columns contain linear combinations of the latent variables whose means/variances you would like to compute, or an object of class cclincomb output by make_model_lincombs(). If NULL, will be computed automatically. Set lincomb = FALSE in order to prevent this.


awstringer1/casecrossover documentation built on March 11, 2021, 4:41 a.m.