# Tools for Choice Model Estimation and Application

## Documentation for package ‘apollo’ version 0.3.9

- DESCRIPTION file
- User guides, package vignettes and other documentation

## Help Pages

A P S misc

## -- A --

apollo_addCovariance | Adds covariance matrix to Apollo model
apollo_attach | Attaches predefined variables.
apollo_avgInterDraws | Averages across inter-individual draws.
apollo_avgIntraDraws | Averages across intra-individual draws.
apollo_basTest | Ben-Akiva & Swait test
apollo_bootstrap | Bootstrap a model
apollo_checkArguments | Checks definitions of Apollo functions
apollo_choiceAnalysis | Reports market share for subsamples
apollo_classAlloc | Calculates class allocation probabilities for a Latent Class model
apollo_cnl | Calculates Cross-Nested Logit probabilities
apollo_combineModels | Combines separate model components.
apollo_combineResults | Write model results to file
apollo_compareInputs | Compares the content of apollo_inputs to its counterparts in the global environment
apollo_conditionals | Calculates conditionals
apollo_deltaMethod | Delta method for Apollo models
apollo_detach | Detaches parameters and the database.
apollo_dft | Calculate DFT probabilities
apollo_diagnostics | Print diagnostics for model inputs Prints diagnostic summaries for a model component, including choice summaries, availability summaries, and selected parameter or structure diagnostics depending on the model type.
apollo_drugChoiceData | Simulated dataset of medication choice.
apollo_dVdB | Calculates gradients of utility functions
apollo_dVdBOld | Calculates gradients of utility functions
apollo_el | Calculates Exploded Logit probabilities
apollo_emdc | MDC model with exogenous budget
apollo_emdc1 | MDC model with exogenous budget
apollo_emdc2 | Extended MDC
apollo_estimate | Estimates model
apollo_estimateHB | Estimates model using Bayesian estimation
apollo_expandLoop | Expands loops in a function or expression
apollo_firstRow | Keeps only the first row for each individual
apollo_fitsTest | Compares log-likelihood of model across categories
apollo_fmnl | Calculates Fractional Multinomial Logit probabilities
apollo_fnl | Calculates Fractional Nested Logit probabilities
apollo_initialise | Prepares environment
apollo_insertComponentName | Adds componentName2 to model calls
apollo_insertFunc | Modifies function to make it compatible with analytic gradients
apollo_insertOLList | Replaces 'tau=c(...)' by 'tau=list(...)' in calls to 'apollo_ol'
apollo_insertRows | Inserts rows
apollo_insertRRMQuotes | Introduces quotes into rrm_settings
apollo_insertScaling | Scales variables inside a function
apollo_keepRows | Keeps only some rows
apollo_lc | Calculates the likelihood of a latent class model
apollo_lcConditionals | Calculates conditionals for latent class models.
apollo_lcEM | Uses EM for latent class model
apollo_lcEM_new | Uses EM for latent class model
apollo_lcUnconditionals | Returns unconditionals for a latent class model
apollo_llCalc | Calculates log-likelihood of all model components
apollo_loadModel | Loads model from file
apollo_longToWide | Converts data from long to wide format.
apollo_lrTest | Likelihood ratio test
apollo_makeCluster | Creates cluster for estimation.
apollo_makeDraws | Creates draws for models with mixing
apollo_makeGrad | Creates gradient function.
apollo_makeHessian | Creates hessian function.
apollo_makeLogLike | Creates log-likelihood function.
apollo_mdcev | Calculates MDCEV likelihoods
apollo_mdcev2 | Calculates MDCEV likelihoods
apollo_mdcnev | Calculates MDCNEV likelihoods
apollo_mixConditionals | Calculates conditionals for continuous mixture models
apollo_mixEM | Uses EM for models with continuous random coefficients
apollo_mixUnconditionals | Returns draws for continuously distributed random parameters in mixture model
apollo_mlhs | Generate random draws using MLHS algorithm
apollo_mnl | Calculates Multinomial Logit probabilities
apollo_modeChoiceData | Simulated dataset of mode choice.
apollo_modelOutput | Prints estimation results to console
apollo_modifyUserDefFunc | Checks and modifies Apollo user-defined functions
apollo_nl | Calculates Nested Logit probabilities
apollo_normalDensity | Calculates density for a Normal distribution
apollo_ol | Calculates Ordered Logit probabilities
apollo_op | Calculates Ordered Probit probabilities
apollo_outOfSample | Cross-validation of fit (LL)
apollo_ownModel | Calculates own model probabilities
apollo_panelProd | Calculates product across observations from same individual.
apollo_prediction | Predicts using an estimated model
apollo_preEstimate | Conducts all the pre-estimation steps for a model
apollo_prepareProb | Checks likelihood function
apollo_preprocess | Pre-process input for multiple models return
apollo_print | Prints message to terminal
apollo_readBeta | Reads parameters from file
apollo_rrm | Calculates Random Regret Minimisation model probabilities
apollo_saveOutput | Saves estimation results to files.
apollo_searchStart | Searches for better starting values.
apollo_setRows | Sets specified rows to a given value
apollo_setWorkDir | Automatically sets working directory to active file directory
apollo_sharesTest | Compares predicted and observed shares
apollo_sink | Starts or stops writing output to a text file.
apollo_speedTest | Measures evaluation time of a model
apollo_swissRouteChoiceData | Swiss route choice dataset.
apollo_timeUseData | Time use dataset.
apollo_tobit | Calculates density for a Tobit model (censored Normal)
apollo_unconditionals | Returns unconditionals for models with random heterogeneity
apollo_validate | Pre-process input for common models return
apollo_validateControl | Validates apollo_control
apollo_validateData | Validates data
apollo_validateHBControl | Validates the 'apollo_HB' list of parameters
apollo_validateInputs | Prepares input for 'apollo_estimate'
apollo_varcov | Calculates variance-covariance matrix of an Apollo model
apollo_varList | Lists variable names and definitions used inside a function
apollo_weighting | Applies weights
apollo_writeF12 | Writes an F12 file
apollo_writeTheta | Writes the vector [beta,ll] to a file called 'modelname_iterations.csv'
aux_validateRows | Validates and expands rows if necessary.

## -- P --

print.apollo | Prints brief summary of Apollo model

## -- S --

summary.apollo | Prints summary of Apollo model

## -- misc --

.onAttach | Prints package startup message