Learn R Programming

apollo (version 0.0.1)

apollo_prepareProb: Checks that likelihoods are ready to be returned

Description

Checks that likelihoods (i.e. probabilities in the case of choice models) are in the appropiate format to be returned.

Usage

apollo_prepareProb(P, apollo_control, functionality)

Arguments

P

List. Each element contains the probabilities of a component of the model. Should contain one element called "model".

apollo_control

List. Estimation settings. See apollo_estimate.

functionality

Character. Can take different values depending on desired output of apollo_probabilities.

"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

Value

The likelihood (i.e. probability in the case of choice models) of the model in the appropriate form for the given functionality.

Details

This function should be called inside apollo_probabilities, near the end of it, just before return(P) and apollo_detach(). This function only performs checks on the shape of P, but does not change its values in any way.