Package: klue 0.10.0

Oliver Frings

klue: Hybrid Machine Learning and Random-Utility Workflow for Latent Class Multinomial Logit Model Specification

Implements the three-step workflow of Frings (2026, working paper) for specifying latent class multinomial logit (LCMNL) models. The maximum-likelihood multi-start is initialised from six clusterings of respondents' revealed-preference signatures (k-means, Gaussian mixture, hierarchical clustering with Ward, complete and average linkage, and partitioning around medoids). LCMNL models are estimated across a user-specified range of class counts, and a mixed multinomial logit (MMNL) benchmark, estimated with 'apollo', is reported alongside BIC, AIC, ICL and a classification-entropy diagnostic. For large samples the clustering starts are computed on a capped respondent subsample, and all starts are screened at a loose optimiser tolerance before the best is refined. Accepts long- or wide-format discrete-choice data with optional availability columns.

Authors:Oliver Frings [aut, cre]

klue_0.10.0.tar.gz
klue_0.10.0.zip(r-4.7-any)klue_0.10.0.zip(r-4.6-any)klue_0.10.0.zip(r-4.5-any)
klue_0.10.0.tgz(r-4.6-any)klue_0.10.0.tgz(r-4.5-any)
klue_0.10.0.tar.gz(r-4.7-any)klue_0.10.0.tar.gz(r-4.6-any)
klue_0.10.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
klue/json (API)

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

Bug tracker:https://github.com/o-frings/klue/issues

On CRAN:

Conda:

2.54 score 34 exports 2 dependencies

Last updated from:a41c20aa9d (on main). Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develOK143
source / vignettesOK371
linux-releaseOK171
macos-releaseOK164
macos-oldrelOK124
windows-develOK159
windows-releaseOK147
windows-oldrelOK120
wasm-releaseOK131

Exports:cleanup_apolloestimate_lcmnlestimate_lcmnl_covestimate_lcmnl_emget_all_startsget_mnl_perturbation_startsget_random_partition_startsklueklue_databaseklue_database_longklue_database_wideklue_demoklue_derrorklue_designklue_dgpklue_draw_betasklue_fiellerklue_lcmnlklue_lincomklue_mean_fnklue_mmnlklue_mmnl_corrklue_mmnl_defaultsklue_nlcomklue_parklue_predictklue_refitklue_simulateklue_simulate_choicesklue_startsklue_tostklue_waldklue_wtpklue_wtp_fn

Dependencies:clustermclust

Readme and manuals

Help Manual

Help pageTopics
Remove Apollo's global objectscleanup_apollo
Direct-MLE LCMNL (MNL when C = 1)estimate_lcmnl
Concomitant LCMNL: covariate-driven class membershipestimate_lcmnl_cov
EM estimator for the same LCMNL likelihoodestimate_lcmnl_em
All clustering-based starting valuesget_all_starts
Starting values by perturbing the pooled MNLget_mnl_perturbation_starts
Starting values from random partitionsget_random_partition_starts
Run the full LCMNL specification workflowklue
Build the canonical database (format dispatcher)klue_database
Build the canonical database from long-format dataklue_database_long
Build the canonical database from wide-format dataklue_database_wide
Zero-setup demonstration on Apollo's Swiss route-choice dataklue_demo
D-error of a choice designklue_derror
Blocked D-efficient design from a population-mean priorklue_design
Data-generating-process configurationklue_dgp
Draw respondent coefficients from a fitted modelklue_draw_betas
Fieller confidence interval for a ratio of linear combinationsklue_fieller
Multi-start LCMNL: best of the six clustering initialisationsklue_lcmnl
Linear combination of coefficients from a klue fitklue_lincom
Population mean of a coefficient as a function of the parametersklue_mean_fn
MMNL benchmark (independent or correlated normals)klue_mmnl klue_mmnl_corr
MMNL default settingsklue_mmnl_defaults
Delta-method inference on a function of a klue fit's parametersklue_nlcom
Parameter name of a labelled coefficient in a klue fitklue_par
Expected choice probabilities from a fitted modelklue_predict
Re-estimate a fitted MNL or latent class modelklue_refit
Simulate panel choice data from the Frings (2026) DGPklue_simulate
Simulate choices for a canonical database from given coefficientsklue_simulate_choices
Clustering-based starting values for one methodklue_starts
Two-one-sided-tests (TOST) equivalence test for a contrastklue_tost
Joint Wald test that a set of coefficients equals a valueklue_wald
Delta-method willingness-to-pay (ratio of linear combinations)klue_wtp
Willingness to pay as a function of the parametersklue_wtp_fn