View source: R/05-posthoc-quantities.R
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.
1 2 3 4 5 6 7 | compute_marginal_means_and_variances(
model_results,
model_data,
i = NULL,
constrA = NULL,
lincomb = NULL
)
|
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. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.