Learn R Programming

⚠️There's a newer version (0.3.5) of this package.Take me there.

apollo (version 0.2.6)

Tools for Choice Model Estimation and Application

Description

The Choice Modelling Centre (CMC) at the University of Leeds has developed flexible code for the estimation and application of choice models in R. Users are able to write their own model functions or use a mix of already available ones. Random heterogeneity, both continuous and discrete and at the level of individuals and choices, can be incorporated for all models. There is support for both standalone models and hybrid model structures. Both classical and Bayesian estimation is available, and multiple discrete continuous models are covered in addition to discrete choice. Multi-threading processing is supported for estimation and a large number of pre and post-estimation routines, including for computing posterior (individual-level) distributions are available. For examples, a manual, and a support forum, visit . For more information on choice models see Train, K. (2009) and Hess, S. & Daly, A.J. (2014) for an overview of the field.

Copy Link

Version

Install

install.packages('apollo')

Monthly Downloads

2,151

Version

0.2.6

License

GPL-2

Maintainer

David Palma

Last Published

November 8th, 2021

Functions in apollo (0.2.6)

apollo_checkArguments

Checks definitions Apollo functions
apollo_attach

Attaches predefined variables.
apollo_avgIntraDraws

Averages across intra-individual draws.
apollo_classAlloc

Calculates Multinomial Logit probabilities
apollo_avgInterDraws

Averages across inter-individual draws.
apollo_addCovariance

Adds covariance matrix to Apollo model
apollo_choiceAnalysis

Reports market share for subsamples
apollo_basTest

Ben-Akiva & Swait test
apollo_cnl

Calculates probabilities of a Cross-nested Logit
apollo_bootstrap

Bootstrap a model
apollo_compareInputs

Compares the content of apollo_inputs to that in the global environment
apollo_dVdB

Calculates gradients of utility functions
apollo_conditionals

Calculates conditionals
apollo_combineModels

Combines separate model components.
apollo_detach

Detaches parameters and the database.
apollo_insertRows

Inserts rows
apollo_initialise

Prepares environment
apollo_fmnl

Calculates Fractional Multinomial Logit probabilities
apollo_combineResults

Write model results to file
apollo_dft

Calculate DFT probabilities
apollo_estimateHB

Estimates model
apollo_keepRows

Keeps only some rows
apollo_diagnostics

Pre-process input for multiple models return
apollo_lc

Calculates the likelihood of a latent class model
apollo_insertFunc

Modifies function to make it compatible with analytic gradients
apollo_insertComponentName

Adds componentName2 to model calls
apollo_expandLoop

Expands loops in a function or expression
apollo_makeGrad

Creates gradient function.
apollo_lrTest

Likelihood ratio test
apollo_loadModel

Loads model from file
apollo_drugChoiceData

Simulated dataset of medication choice.
apollo_el

Calculates Exploded Logit probabilities
apollo_nl

Calculates probabilities of a Nested Logit
apollo_normalDensity

Calculates density from a Normal distribution
apollo_makeCluster

Creates cluster for estimation.
apollo_makeDraws

Creates draws for models with mixing
apollo_modeChoiceData

Simulated dataset of mode choice.
apollo_mixEM

Uses EM for models with continuous random coefficients
apollo_swissRouteChoiceData

Dataset of route choice.
apollo_mdcnev

Calculates MDCNEV likelihoods with an outside good.
apollo_insertScaling

Scales variables inside a function
apollo_speedTest

Measures evaluation time of a model
apollo_validate

Pre-process input for multiple models return
apollo_modelOutput

Prints estimation results to console
apollo_setRows

Sets specified rows to a given value
apollo_searchStart

Searches for better starting values.
apollo_readBeta

Reads parameters from file
apollo_estimate

Estimates model
apollo_prediction

Predicts using an estimated model
apollo_makeLogLike

Creates log-likelihood function.
apollo_varcov

Calculates varcov matrix of an Apollo model
apollo_weighting

Applies weights
apollo_validateInputs

Prepares input for apollo_estimate
apollo_saveOutput

Saves estimation results to files.
apollo_varList

Lists variables names and definitions used in a model
apollo_llCalc

Calculates log-likelihood of all model components
apollo_lcUnconditionals

Returns draws for random parameters in a latent class model model
apollo_deltaMethod

Delta method
apollo_firstRow

Keeps only the first row for each individual
apollo_mlhs

Generate random draws using MLHS algorithm
apollo_preprocess

Pre-process input for multiple models return
apollo_prepareProb

Checks likelihood function
apollo_mnl

Calculates Multinomial Logit probabilities
apollo_lcConditionals

Calculates conditionals of a latent class model.
apollo_fitsTest

Compares log-likelihood of model across categories
apollo_lcEM

Uses EM for latent class model
apollo_mdcev

Calculates MDCEV likelihoods.
.onAttach

Prints package startup message
apollo_validateControl

Validates apollo_control
apollo_print

Prints message to terminal
apollo_sink

Writes or stops writing output to a text file
apollo_panelProd

Calculates product across observations from same individual.
apollo_validateHBControl

Validates the apollo_HB list of parameters
apollo_validateData

Validates data
apollo_sharesTest

Compares predicted and observed shares
apollo_outOfSample

Cross-validation of fit (LL)
apollo_writeF12

Writes an F12 file with the results of a model estimation.
apollo_mdcev2

Calculates MDCEV likelihoods.
apollo_writeTheta

Writes the vector [beta,ll] to a file called modelname_iterations.csv
apollo_ol

Calculates the probability of an Ordered Logit model
apollo_op

Calculates the probability of an ordered probit model
apollo_unconditionals

Returns draws for random parameters in a latent class model model
apollo_timeUseData

Dataset of time use.