apollo_mdcev: Calculates MDCEV likelihoods.

Description Usage Arguments Value

View source: R/apollo_mdcev.R

Description

Calculates the likelihood of a Multiple Discrete Continuous Extreme Value (MDCEV) model.

Usage

1
apollo_mdcev(mdcev_settings, functionality)

Arguments

mdcev_settings

List of settings for the MDCEV model. It must include the following.

  • V: Named list. Utilities of the alternatives. Names of elements must match those in argument 'alternatives'.

  • alternatives: Character vector. Names of alternatives, elements must match the names in list 'V'.

  • alpha: Named list. Alpha parameters for each alternative, including for any outside good. As many elements as alternatives.

  • gamma: Named list. Gamma parameters for each alternative, excluding any outside good. As many elements as inside good alternatives.

  • sigma: Numeric scalar. Scale parameter of the model extreme value type I error.

  • cost: Named list of numeric vectors. Price of each alternative. One element per alternative, each one as long as the number of observations or a scalar. Names must match those in alternatives.

  • avail: Named list. Availabilities of alternatives, one element per alternative. Names of elements must match those in argument 'alternatives'. Value for each element can be 1 (scalar if always available) or a vector with values 0 or 1 for each observation.

  • continuousChoice: Named list of numeric vectors. Amount of consumption of each alternative. One element per alternative, as long as the number of observations or a scalar. Names must match those in alternatives.

  • budget: Numeric vector. Budget for each observation.

  • minConsumption: Named list of scalars or numeric vectors. Minimum consumption of the alternatives, if consumed. As many elements as alternatives. Names must match those in alternatives.

  • outside: Character. Optional name of the outside good.

  • rows: Logical vector. Consideration of rows in the likelihood calculation, FALSE to exclude. Length equal to the number of observations (nObs). Default is "all", equivalent to rep(TRUE, nObs).

  • componentName: Character. Name given to model component.

  • nRep: Numeric scalar. Number of simulations of the whole dataset used for forecasting. The forecast is the average of these simulations. Default is 100.

  • rawPrediction: Logical scalar. TRUE for prediction to be returned at the draw level (a 3-dim array). FALSE for prediction to be returned averaged across draws. Default is FALSE.

functionality

Character. Can take different values depending on desired output.

  • "estimate" Used for model estimation.

  • "prediction" Used for model predictions.

  • "validate" Used for validating input.

  • "zero_LL" Used for calculating null likelihood.

  • "conditionals" Used for calculating conditionals.

  • "output" Used for preparing output after model estimation.

  • "raw" Used for debugging.

Value

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


byu-transpolab/apollo documentation built on Dec. 19, 2021, 12:48 p.m.