Learn R Programming

apollo (version 0.0.1)

apollo_panelProd: Calculates product of panel observations.

Description

Multiplies likelihood of observations from the same individual, or adds the log of them.

Usage

apollo_panelProd(P, apollo_control, functionality, work_in_logs, indivID)

Arguments

P

List of probabilities. It must contain one element called "model" containing the full likelihood of the model.

apollo_control

List. Options controlling the running of the code. See ?apollo_validatecontrol for details.

functionality

Character. Can take different values depending on desired output.

"estimate"

For model estimation, returns probabilities of chosen alternatives.

"prediction"

For model predictions, returns probabilities of all alternatives.

"validate"

Validates input.

"zero_LL"

Return probabilities with all parameters at zero.

"conditionals"

For conditionals, returns probabilities of chosen alternatives.

"output"

Checks that the model is well defined.

"raw"

For debugging, returns probabilities of all alternatives

work_in_logs

Boolean. TRUE for higher numeric stability at the expense of computational time. Useful for panel models only. Default is FALSE.

indivID

Numeric vector. Vector with individual's ID. As long as the number of observations.

Value

Probabilities at the individual level.

Details

This function should be called inside apollo_probabilities only if the data has a panel structure. It should be called after apollo_avgIntraDraws if intra-individual draws are used.