Returns unconditionals for random parameters in model, both for continuous mixtures and latent class.
apollo_unconditionals(
model,
apollo_probabilities,
apollo_inputs,
obsLevel = NULL
)Depends on whether the model uses continuous mixtures or latent class.
If the model contains a continuous mixture, it returns a list with one object per
random coefficient. When using inter-individual draws only, each element will
usually be a matrix with one row per individual and one column per draw. When
using intra-individual draws, each element can be returned at the observation
level as a three-dimensional array, with observations in the first dimension,
inter-individual draws in the second dimension, and intra-individual draws in
the third dimension. If obsLevel=FALSE, outputs are reduced to the
individual level where applicable.
If the model contains latent classes, it returns a list with as many elements as random coefficients in the model, plus one additional element containing the class allocation probabilities.
If the model contains both continuous mixing and latent classes, a list with the two elements described above will be returned.
Model object. Estimated model object as returned by function apollo_estimate.
Function. Returns probabilities of the model to be estimated. Must receive three arguments:
apollo_beta: Named numeric vector. Names and values of model parameters.
apollo_inputs: List containing options of the model. See apollo_validateInputs.
functionality: Character. Can be either "components", "conditionals", "estimate" (default), "gradient", "hessian", "output", "prediction", "preprocess", "raw", "report", "shares_LL", "validate" or "zero_LL".
List grouping most common inputs. Created by function apollo_validateInputs.
Logical. If TRUE, unconditionals are returned at the observation level rather than person level. This setting only applies to continuous mixture models and is set to TRUE by default only in the presence of intra-individual draws. Otherwise, the default is FALSE.
This function is only meant for use with models using continuous distributions or latent classes, or both at the same time.