Package: choicer 0.1.0

Fernando Cordeiro

choicer: Discrete Choice Models for Economic Applications

Fast estimation of discrete-choice models for applied economics. Likelihoods, analytical gradients and Hessians are implemented in C++ with 'OpenMP' parallelism, scaling efficiently to specifications with many alternative-specific constants. Post-estimation routines return predicted shares, own- and cross-price elasticities, and diversion ratios. Supports multinomial logit ('MNL'), mixed logit ('MXL'), and nested logit ('NL').

Authors:Fernando Cordeiro [aut, cre, cph]

choicer_0.1.0.tar.gz
choicer_0.1.0.tar.gz(r-4.7-arm64)choicer_0.1.0.tar.gz(r-4.7-x86_64)choicer_0.1.0.tar.gz(r-4.6-arm64)choicer_0.1.0.tar.gz(r-4.6-x86_64)
choicer_0.1.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html
card.svg |card.png
choicer/json (API)
NEWS

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

Bug tracker:https://github.com/fpcordeiro/choicer/issues

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

On CRAN:

Conda:

openblascppopenmp

1.70 score 8 scripts 36 exports 6 dependencies

Last updated from:7105dd7b4b. Checks:6 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64OK154
linux-devel-x86_64OK153
source / vignettesOK211
linux-release-arm64OK158
linux-release-x86_64OK173
wasm-releaseOK125

Exports:blpblp_contractionbuild_var_matdiversion_ratioselasticitiesget_halton_normalsjacobian_vech_Sigmamc_asymptoticsmnl_diversion_ratios_parallelmnl_elasticities_parallelmnl_loglik_gradient_parallelmnl_loglik_hessian_parallelmnl_predictmnl_predict_sharesmonte_carlomxl_bhhh_parallelmxl_blp_contractionmxl_diversion_ratios_parallelmxl_elasticities_parallelmxl_hessian_parallelmxl_loglik_gradient_parallelmxl_predictmxl_predict_sharesnew_choicer_simnl_loglik_gradient_parallelnl_loglik_numeric_hessianprepare_mnl_dataprepare_mxl_dataprepare_nl_datarecovery_tablerun_mnlogitrun_mxlogitrun_nestlogitsimulate_mnl_datasimulate_mxl_datasimulate_nl_data

Dependencies:data.tablenloptrrandtoolboxRcppRcppArmadillorngWELL

Readme and manuals

Help Manual

Help pageTopics
BLP contraction mappingblp
BLP95 contraction mapping to find delta given target sharesblp_contraction
BLP contraction mapping for multinomial logit modelblp.choicer_mnl
BLP contraction mapping for mixed logit modelblp.choicer_mxl
Reconstruct variance matrix L from L_paramsbuild_var_mat
Extract coefficients from a choicer_fit objectcoef.choicer_fit
Compute aggregate diversion ratiosdiversion_ratios
Diversion ratios for multinomial logit modeldiversion_ratios.choicer_mnl
Diversion ratios for mixed logit modeldiversion_ratios.choicer_mxl
Compute aggregate elasticitieselasticities
Elasticities for multinomial logit modelelasticities.choicer_mnl
Elasticities for mixed logit modelelasticities.choicer_mxl
Halton draws for mixed logitget_halton_normals
Utility to compute analytical Jacobian of random coefficient matrix transformed by vech (dVech(Sigma) / dTheta)jacobian_vech_Sigma
Extract log-likelihood from a choicer_fit objectlogLik.choicer_fit
Asymptotic diagnostics for a Monte Carlo studymc_asymptotics
Compute MNL diversion ratios (parallelized over individuals)mnl_diversion_ratios_parallel
Compute aggregate elasticities for MNL modelmnl_elasticities_parallel
Log-likelihood and gradient for multinomial logit modelmnl_loglik_gradient_parallel
Hessian matrix for multinomial logit modelmnl_loglik_hessian_parallel
Prediction of choice probabilities and utilities based on fitted modelmnl_predict
Prediction of market shares based on fitted modelmnl_predict_shares
Monte Carlo parameter recoverymonte_carlo
BHHH (outer product of gradients) information matrix for Mixed Logitmxl_bhhh_parallel
BLP contraction mapping for mixed logitmxl_blp_contraction
Diversion ratios for Mixed Logit (simulated, derivative-based)mxl_diversion_ratios_parallel
Compute aggregate elasticities for mixed logit modelmxl_elasticities_parallel
Analytical Hessian of the log-likelihood v2mxl_hessian_parallel
Log-likelihood and gradient for Mixed Logitmxl_loglik_gradient_parallel
Per-observation simulated choice probabilities for Mixed Logitmxl_predict
Predicted aggregate market shares for Mixed Logitmxl_predict_shares
Construct a 'choicer_sim' objectnew_choicer_sim
Log-likelihood and gradient for Nested Logit modelnl_loglik_gradient_parallel
Numerical Hessian of the log-likelihood via finite differencesnl_loglik_numeric_hessian
Extract number of observations from a choicer_fit objectnobs.choicer_fit
Predict from a multinomial logit modelpredict.choicer_mnl
Predict from a mixed logit modelpredict.choicer_mxl
Prepare inputs for 'mnl_loglik_gradient_parallel()'prepare_mnl_data
Prepare inputs for 'mxl_loglik_gradient_parallel()'prepare_mxl_data
Prepare inputs for nested logit estimationprepare_nl_data
Print a choicer_fit objectprint.choicer_fit
Print summary for multinomial logit modelprint.summary.choicer_mnl
Print summary for mixed logit modelprint.summary.choicer_mxl
Print summary for nested logit modelprint.summary.choicer_nl
Parameter recovery tablerecovery_table recovery_table.choicer_fit recovery_table.choicer_mc
Runs multinomial logit estimationrun_mnlogit
Runs mixed logit estimationrun_mxlogit
Runs nested logit estimationrun_nestlogit
Simulate multinomial logit datasimulate_mnl_data
Simulate mixed logit datasimulate_mxl_data
Simulate nested logit datasimulate_nl_data
Summary for multinomial logit modelsummary.choicer_mnl
Summary for mixed logit modelsummary.choicer_mxl
Summary for nested logit modelsummary.choicer_nl
Extract variance-covariance matrix from a choicer_fit objectvcov.choicer_fit