Checks that likelihoods, i.e. probabilities in the case of choice models, are in the appropiate format to be returned.
apollo_prepareProb(P, apollo_inputs, functionality)
List of vectors, matrices or 3-dim arrays. Likelihood of the model components.
List grouping most common inputs. Created by function apollo_validateInputs.
Character. Can take different values depending on desired output of apollo_probabilities
.
For model estimation, returns probabilities of chosen alternatives.
For model predictions, returns probabilities of all alternatives.
Validates input.
Return probabilities with all parameters at zero.
For conditionals, returns probabilities of chosen alternatives.
Checks that the model is well defined.
For debugging, returns probabilities of all alternatives
The returned object depends on the value of argument functionality
as follows.
"estimate"
: Returns only the "model"
component of argument P
.
"prediction"
: Returns argument P
without any changes.
"validate"
: Returns argument P
without any changes.
"zero_LL"
: Returns argument P
without any changes to its content, but gives names the unnamed elements.
"conditionals"
: Returns only the "model"
component of argument P
.
"output"
: Returns argument P
without any changes to its content, but gives names the unnamed elements.
"raw"
: Returns argument P
without any changes.
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.