Learn R Programming

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

apollo (version 0.3.2)

Tools for Choice Model Estimation and Application

Description

Choice models are a widely used technique across numerous scientific disciplines. The Apollo package is a very flexible tool 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,880

Version

0.3.2

License

GPL-2

Maintainer

Last Published

April 15th, 2024

Functions in apollo (0.3.2)

apollo_compareInputs

Compares the content of apollo_inputs to their counterparts in the global environment
apollo_dVdB

Calculates gradients of utility functions
apollo_dVdB2

Calculates gradients of utility functions
apollo_deltaMethod

Delta method for Apollo models
apollo_detach

Detaches parameters and the database.
apollo_conditionals

Calculates conditionals
apollo_combineResults

Write model results to file
apollo_combineModels

Combines separate model components.
apollo_dft

Calculate DFT probabilities
apollo_diagnostics

Pre-process input for common models return
apollo_estimate

Estimates model
apollo_drugChoiceData

Simulated dataset of medication choice.
apollo_emdc2

Extended MDC
apollo_emdc

MDC model with exogenous budget
apollo_el

Calculates Exploded Logit probabilities
apollo_emdc1

MDC model with exogenous budget
apollo_estimateHB

Estimates model using Bayesian estimation
apollo_firstRow

Keeps only the first row for each individual
apollo_expandLoop

Expands loops in a function or expression
apollo_fitsTest

Compares log-likelihood of model across categories
apollo_insertRRMQuotes

Introduces quotes into rrm_settings
apollo_insertOLList

Replaces tau=c(...) by tau=list(...) in calls to apollo_ol
apollo_insertFunc

Modifies function to make it compatible with analytic gradients
apollo_insertComponentName

Adds componentName2 to model calls
apollo_fmnl

Calculates Fractional Multinomial Logit probabilities
apollo_initialise

Prepares environment
apollo_lcUnconditionals

Returns unconditionals for a latent class model model
apollo_lcConditionals

Calculates conditionals for latent class models.
apollo_lcEM

Uses EM for latent class model
apollo_makeGrad

Creates gradient function.
apollo_lc

Calculates the likelihood of a latent class model
apollo_makeDraws

Creates draws for models with mixing
apollo_keepRows

Keeps only some rows
apollo_loadModel

Loads model from file
apollo_insertRows

Inserts rows
apollo_insertScaling

Scales variables inside a function
apollo_longToWide

Converts data from long to wide format.
apollo_lrTest

Likelihood ratio test
apollo_mdcev

Calculates MDCEV likelihoods
apollo_makeCluster

Creates cluster for estimation.
apollo_makeLogLike

Creates log-likelihood function.
apollo_mixConditionals

Calculates conditionals for continuous mixture models
apollo_mixEM

Uses EM for models with continuous random coefficients
apollo_mlhs

Generate random draws using MLHS algorithm
apollo_mnl

Calculates Multinomial Logit probabilities
apollo_modelOutput

Prints estimation results to console
apollo_modifyUserDefFunc

Checks and modifies Apollo user-defined functions
apollo_mixUnconditionals

Returns draws for continuously distributed random parameters in mixture model
apollo_nl

Calculates Nested Logit probabilities
apollo_normalDensity

Calculates density for a Normal distribution
apollo_mdcnev

Calculates MDCNEV likelihoods
apollo_llCalc

Calculates log-likelihood of all model components
apollo_mdcev2

Calculates MDCEV likelihoods
apollo_print

Prints message to terminal
apollo_readBeta

Reads parameters from file
apollo_setRows

Sets specified rows to a given value
apollo_searchStart

Searches for better starting values.
apollo_panelProd

Calculates product across observations from same individual.
apollo_prediction

Predicts using an estimated model
apollo_modeChoiceData

Simulated dataset of mode choice.
apollo_validate

Pre-process input for common models return
apollo_ownModel

Calculates own model probabilities
apollo_outOfSample

Cross-validation of fit (LL)
apollo_sink

Starts or stops writing output to a text file.
apollo_rrm

Calculates Random Regret Minimisation model probabilities
apollo_sharesTest

Compares predicted and observed shares
apollo_speedTest

Measures evaluation time of a model
apollo_ol

Calculates Ordered Logit probabilities
apollo_timeUseData

Dataset of time use.
apollo_op

Calculates Ordered Probit probabilities
apollo_unconditionals

Returns unconditionals for models with random heterogeneity
aux_validateRows

Validates and expands rows if necessary.
apollo_swissRouteChoiceData

Dataset of route choice.
.onAttach

Prints package startup message
apollo_validateControl

Validates apollo_control
apollo_preprocess

Pre-process input for multiple models return
apollo_prepareProb

Checks likelihood function
print.apollo

Prints brief summary of Apollo model
summary.apollo

Prints summary of Apollo model
apollo_validateHBControl

Validates the apollo_HB list of parameters
apollo_validateData

Validates data
apollo_saveOutput

Saves estimation results to files.
apollo_varList

Lists variable names and definitions used inside a function
apollo_writeTheta

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

Prepares input for apollo_estimate
apollo_writeF12

Writes an F12 file
apollo_varcov

Calculates variance-covariance matrix of an Apollo model
apollo_weighting

Applies weights
apollo_addCovariance

Adds covariance matrix to Apollo model
apollo_avgIntraDraws

Averages across intra-individual draws.
apollo_cnl

Calculates Cross-Nested Logit probabilities
apollo_bootstrap

Bootstrap a model
apollo_checkArguments

Checks definitions of Apollo functions
apollo_avgInterDraws

Averages across inter-individual draws.
apollo_basTest

Ben-Akiva & Swait test
apollo_attach

Attaches predefined variables.
apollo_classAlloc

Calculates class allocation probabilities for a Latent Class model
apollo_choiceAnalysis

Reports market share for subsamples