apollo_emdc function

MDC model with exogenous budget

MDC model with exogenous budget

Calculates the likelihood function of the MDC model with exogenous budget. Can also predict and validate inputs.

apollo_emdc(emdc_settings, functionality = "estimate")

Arguments

  • emdc_settings: List of settings for the model. It includes the following.

    • ‘avail’ : Named list of numeric vectors. Availability of each product. Can also be called "A".
    • ‘budget’ : Optional numeric vector. Budget. Must be bigger that the expenditure on all inside goods. Can also be called "B".
    • ‘cost’ : Named list of numeric vectors. Price of each product.
    • ‘delta’ : Lower triangular numeric matrix, or list of lists. Complementarity/substitution parameter.
    • ‘continuousChoice’ : Named list of numeric vectors. Amount consumed of each inside good. Outside good must not be included. Can also be called "X".
    • ‘gamma’ : Named list of numeric vectors. Satiation parameter of each product.
    • ‘nRep’ : Scalar positive integer. Number of repetitions used when prediction
    • ‘sigma’ : Numeric vector or scalar. Standard deviation of the error term. Default is one.
    • ‘timeLimit’ : Positive scalar. Maximum amount of seconds the optimiser can spend calculating a prediction before setting it to NA.
    • ‘tol’ : Positive scalar. Tolerance of the prediction algorithm.
    • ‘utilities’ : Named list of numeric vectors (or matrices or arrays). Base utility of each product. Can also be called "V".
    • ‘utilityOutside’ : Numeric vector (or matrix or array). Shadow price of the budget. Must be normalised to 0 for at least one individual. Default is 0 for every observation. Can also be called "V0".
  • functionality: Character. Either "validate", "zero_LL", "estimate", "conditionals", "raw", "output" or "prediction"

Returns

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"

Details

This model extends the traditional multiple discrete-continuous (MDC) framework by (i) making the marginal utility of the outside good deterministic, and (ii) including complementarity and substitution in the model formulation. See the following working paper for more details:

Palma, D. & Hess, S. (2022) Extending the Multiple Discrete Continuous (MDC) modelling framework to consider complementarity, substitution, and an unobserved budget. Transportation Reserarch 161B, 13 - 35. https://doi.org/10.1016/j.trb.2022.04.005

  • Maintainer: Stephane Hess
  • License: GPL-2
  • Last published: 2025-03-12