Learn R Programming

apollo (version 0.3.9)

apollo_mixConditionals: Calculates conditionals for continuous mixture models

Description

Calculates posterior expected values (conditionals) of continuously distributed random coefficients, as well as their standard deviations.

Usage

apollo_mixConditionals(model, apollo_probabilities, apollo_inputs)

Value

A list of data frames, one per random component. Each data frame has one row per individual and columns for the individual ID, posterior mean and posterior standard deviation. If there is only one random component, the corresponding data frame is returned directly.

Arguments

model

Model object. Estimated model object as returned by function apollo_estimate.

apollo_probabilities

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".

apollo_inputs

List grouping most common inputs. Created by function apollo_validateInputs.

Details

This functions is only meant for use with continuous distributions.