Calculates probabilities of a Nested Logit
Calculates probabilities of a Nested Logit model.
apollo_nl(nl_settings, functionality)
nl_settings |
List of inputs of the NL model. It shoud contain the following.
|
functionality |
Character. Can take different values depending on desired output.
|
In this implementation of the Nested Logit model, each nest must have a lambda parameter associated to it.
For the model to be consistent with utility maximisation, the estimated value of the Lambda parameter of all nests
should be between 0 and 1. Lambda parameters are inversely proportional to the correlation between the error terms of
alternatives in a nest. If lambda=1, then there is no relevant correlation between the unobserved
utility of alternatives in that nest.
The tree must contain an upper nest called "root"
. The lambda parameter of the root is automatically
set to 1 if not specified in nlNests
. And while setting it to another value is possible, it is not
recommended.
The returned object depends on the value of argument functionality
as follows.
"estimate"
: vector/matrix/array. Returns the probabilities for the chosen alternative for each observation.
"prediction"
: List of vectors/matrices/arrays. Returns a list with the probabilities for all alternatives, with an extra element for the probability of the chosen alternative.
"validate"
: Same as "estimate"
, but it also runs a set of tests to validate the function inputs.
"zero_LL"
: vector/matrix/array. Returns the probability of the chosen alternative when all parameters are zero.
"conditionals"
: Same as "estimate"
"output"
: Same as "estimate"
but also writes summary of input data to internal Apollo log.
"raw"
: Same as "prediction"
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.