apollo_prepareProb {apollo}R Documentation

Checks likelihood

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_inputs, functionality)

Arguments

P

List of vectors, matrices or 3-dim arrays. Likelihood of the model components.

apollo_inputs

List grouping most common inputs. Created by function apollo_validateInputs.

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

Details

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

Value

The returned object depends on the value of argument functionality as follows.


[Package apollo version 0.1.1 Index]