Package: apollo 0.3.4

Stephane Hess

apollo: Tools for Choice Model Estimation and Application

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 <http://www.ApolloChoiceModelling.com>. For more information on choice models see Train, K. (2009) <isbn:978-0-521-74738-7> and Hess, S. & Daly, A.J. (2014) <isbn:978-1-781-00314-5> for an overview of the field.

Authors:Stephane Hess [aut, cre], David Palma [aut], Thomas Hancock [ctb]

apollo_0.3.4.tar.gz
apollo_0.3.4.tar.gz(r-4.5-noble)apollo_0.3.4.tar.gz(r-4.4-noble)
apollo_0.3.4.tgz(r-4.4-emscripten)apollo_0.3.4.tgz(r-4.3-emscripten)
apollo.pdf |apollo.html
apollo/json (API)

# Install 'apollo' in R:
install.packages('apollo', repos = c('https://cran.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Uses libs:
  • openblas– Optimized BLAS
  • c++– GNU Standard C++ Library v3
  • openmp– GCC OpenMP (GOMP) support library
Datasets:

This package does not link to any Github/Gitlab/R-forge repository. No issue tracker or development information is available.

openblascppopenmp

4.62 score 1 stars 167 scripts 2.7k downloads 3 mentions 94 exports 43 dependencies

Last updated 2 months agofrom:7dea2d22d3. Checks:OK: 2. Indexed: no.

TargetResultDate
Doc / VignettesOKDec 01 2024
R-4.5-linux-x86_64OKDec 01 2024

Exports:apollo_addCovarianceapollo_attachapollo_avgInterDrawsapollo_avgIntraDrawsapollo_basTestapollo_bootstrapapollo_checkArgumentsapollo_choiceAnalysisapollo_classAllocapollo_cnlapollo_combineModelsapollo_combineResultsapollo_compareInputsapollo_conditionalsapollo_deltaMethodapollo_detachapollo_dftapollo_diagnosticsapollo_dVdBapollo_dVdBOldapollo_elapollo_emdcapollo_emdc1apollo_emdc2apollo_estimateapollo_estimateHBapollo_expandLoopapollo_firstRowapollo_fitsTestapollo_fmnlapollo_fnlapollo_initialiseapollo_insertComponentNameapollo_insertFuncapollo_insertOLListapollo_insertRowsapollo_insertRRMQuotesapollo_insertScalingapollo_keepRowsapollo_lcapollo_lcConditionalsapollo_lcEMapollo_lcUnconditionalsapollo_llCalcapollo_loadModelapollo_longToWideapollo_lrTestapollo_makeClusterapollo_makeDrawsapollo_makeGradapollo_makeHessianapollo_makeLogLikeapollo_mdcevapollo_mdcev2apollo_mdcnevapollo_mixConditionalsapollo_mixEMapollo_mixUnconditionalsapollo_mlhsapollo_mnlapollo_modelOutputapollo_modifyUserDefFuncapollo_nlapollo_normalDensityapollo_olapollo_opapollo_outOfSampleapollo_ownModelapollo_panelProdapollo_predictionapollo_prepareProbapollo_preprocessapollo_printapollo_readBetaapollo_rrmapollo_saveOutputapollo_searchStartapollo_setRowsapollo_sharesTestapollo_sinkapollo_speedTestapollo_tobitapollo_unconditionalsapollo_validateapollo_validateControlapollo_validateDataapollo_validateHBControlapollo_validateInputsapollo_varcovapollo_varListapollo_weightingapollo_writeF12apollo_writeThetaaux_validateRows

Dependencies:bgwclicodaDerivdigestfansigenericsgluelatticelifecyclemagrittrMASSMatrixMatrixModelsmatrixStatsmaxLikmcmcMCMCpackmiscToolsmnormtmvtnormnumDerivpillarpkgconfigquantregrandtoolboxRcppRcppArmadilloRcppEigenrlangrngWELLRSGHBRsolnpsandwichSparseMstringistringrsurvivaltibbletruncnormutf8vctrszoo

Model file examples

Rendered fromapollofirstexample.Rmdusingknitr::rmarkdownon Dec 01 2024.

Last update: 2021-07-31
Started: 2019-03-13

Readme and manuals

Help Manual

Help pageTopics
Prints package startup message.onAttach
Adds covariance matrix to Apollo modelapollo_addCovariance
Attaches predefined variables.apollo_attach
Averages across inter-individual draws.apollo_avgInterDraws
Averages across intra-individual draws.apollo_avgIntraDraws
Ben-Akiva & Swait testapollo_basTest
Bootstrap a modelapollo_bootstrap
Checks definitions of Apollo functionsapollo_checkArguments
Reports market share for subsamplesapollo_choiceAnalysis
Calculates class allocation probabilities for a Latent Class modelapollo_classAlloc
Calculates Cross-Nested Logit probabilitiesapollo_cnl
Combines separate model components.apollo_combineModels
Write model results to fileapollo_combineResults
Compares the content of apollo_inputs to their counterparts in the global environmentapollo_compareInputs
Calculates conditionalsapollo_conditionals
Delta method for Apollo modelsapollo_deltaMethod
Detaches parameters and the database.apollo_detach
Calculate DFT probabilitiesapollo_dft
Pre-process input for common models returnapollo_diagnostics
Simulated dataset of medication choice.apollo_drugChoiceData
Calculates gradients of utility functionsapollo_dVdB
Calculates gradients of utility functionsapollo_dVdBOld
Calculates Exploded Logit probabilitiesapollo_el
MDC model with exogenous budgetapollo_emdc
MDC model with exogenous budgetapollo_emdc1
Extended MDCapollo_emdc2
Estimates modelapollo_estimate
Estimates model using Bayesian estimationapollo_estimateHB
Expands loops in a function or expressionapollo_expandLoop
Keeps only the first row for each individualapollo_firstRow
Compares log-likelihood of model across categoriesapollo_fitsTest
Calculates Fractional Multinomial Logit probabilitiesapollo_fmnl
Calculates Fractional Nested Logit probabilitiesapollo_fnl
Prepares environmentapollo_initialise
Adds componentName2 to model callsapollo_insertComponentName
Modifies function to make it compatible with analytic gradientsapollo_insertFunc
Replaces 'tau=c(...)' by 'tau=list(...)' in calls to 'apollo_ol'apollo_insertOLList
Inserts rowsapollo_insertRows
Introduces quotes into rrm_settingsapollo_insertRRMQuotes
Scales variables inside a functionapollo_insertScaling
Keeps only some rowsapollo_keepRows
Calculates the likelihood of a latent class modelapollo_lc
Calculates conditionals for latent class models.apollo_lcConditionals
Uses EM for latent class modelapollo_lcEM
Returns unconditionals for a latent class model modelapollo_lcUnconditionals
Calculates log-likelihood of all model componentsapollo_llCalc
Loads model from fileapollo_loadModel
Converts data from long to wide format.apollo_longToWide
Likelihood ratio testapollo_lrTest
Creates cluster for estimation.apollo_makeCluster
Creates draws for models with mixingapollo_makeDraws
Creates gradient function.apollo_makeGrad
Creates hessian function.apollo_makeHessian
Creates log-likelihood function.apollo_makeLogLike
Calculates MDCEV likelihoodsapollo_mdcev
Calculates MDCEV likelihoodsapollo_mdcev2
Calculates MDCNEV likelihoodsapollo_mdcnev
Calculates conditionals for continuous mixture modelsapollo_mixConditionals
Uses EM for models with continuous random coefficientsapollo_mixEM
Returns draws for continuously distributed random parameters in mixture modelapollo_mixUnconditionals
Generate random draws using MLHS algorithmapollo_mlhs
Calculates Multinomial Logit probabilitiesapollo_mnl
Simulated dataset of mode choice.apollo_modeChoiceData
Prints estimation results to consoleapollo_modelOutput
Checks and modifies Apollo user-defined functionsapollo_modifyUserDefFunc
Calculates Nested Logit probabilitiesapollo_nl
Calculates density for a Normal distributionapollo_normalDensity
Calculates Ordered Logit probabilitiesapollo_ol
Calculates Ordered Probit probabilitiesapollo_op
Cross-validation of fit (LL)apollo_outOfSample
Calculates own model probabilitiesapollo_ownModel
Calculates product across observations from same individual.apollo_panelProd
Predicts using an estimated modelapollo_prediction
Checks likelihood functionapollo_prepareProb
Pre-process input for multiple models returnapollo_preprocess
Prints message to terminalapollo_print
Reads parameters from fileapollo_readBeta
Calculates Random Regret Minimisation model probabilitiesapollo_rrm
Saves estimation results to files.apollo_saveOutput
Searches for better starting values.apollo_searchStart
Sets specified rows to a given valueapollo_setRows
Compares predicted and observed sharesapollo_sharesTest
Starts or stops writing output to a text file.apollo_sink
Measures evaluation time of a modelapollo_speedTest
Dataset of route choice.apollo_swissRouteChoiceData
Dataset of time use.apollo_timeUseData
Calculates density for a Tobit model (censored Normal)apollo_tobit
Returns unconditionals for models with random heterogeneityapollo_unconditionals
Pre-process input for common models returnapollo_validate
Validates apollo_controlapollo_validateControl
Validates dataapollo_validateData
Validates the 'apollo_HB' list of parametersapollo_validateHBControl
Prepares input for 'apollo_estimate'apollo_validateInputs
Calculates variance-covariance matrix of an Apollo modelapollo_varcov
Lists variable names and definitions used inside a functionapollo_varList
Applies weightsapollo_weighting
Writes an F12 fileapollo_writeF12
Writes the vector [beta,ll] to a file called 'modelname_iterations.csv'apollo_writeTheta
Validates and expands rows if necessary.aux_validateRows
Prints brief summary of Apollo modelprint.apollo
Prints summary of Apollo modelsummary.apollo