Search arXiv⌕ Search

arXiv subjects

Lorenzo Muñoz

Publications and source records attributed to Lorenzo Muñoz.

2 recordsLinked to original sources

Variational autoencoders for anomaly detection in choice modelling datasets

Choice data often contain anomalous observations, which may arise from errors in the data, such as misreported or wrongly computed variables, or from unusual behaviour. Both can distort parameter estimates and derived outputs such as values of time and elasticities, although unusual observations may also reflect heterogeneity between individuals. While routine checks are applied in practice (e.g. dominant alternatives and ranges of trade-offs), a systematic, multivariate check that does not require the type of anomaly to be defined in advance is still missing. A variational autoencoder (VAE) learns the data-generating process by compressing each observation into a low-dimensional latent representation and reconstructing it, so that observations that are reconstructed poorly receive high anomaly scores. We introduce VAEs for anomaly detection in choice modelling datasets, accounting for the panel structure of the data through mixed-effects neural networks, and decompose the anomaly score into variable-specific reconstruction probabilities and a KL term, which show which variables make an observation anomalous. In a synthetic case study, the VAE with mixed effects detects 48% of the induced anomalies, compared to 30% without mixed effects, 20% for univariate checks, and 29% for Mahalanobis distance (with an anomaly threshold of 0.95), including anomalies that are not extreme in any variable. We then apply the framework to a stated preference (SP) and a revealed preference (RP) dataset. Excluding the 1-10% most anomalous observations changes values of time by up to 10% (SP) and 54% (RP), and elasticities by up to 11% (SP) and 55% (RP). The approach gives choice modellers a diagnostic tool to identify the observations and variables that drive their estimates, so that they can decide whether these reflect errors in the data, heterogeneity to be modelled, or a specification to revisit.

econ.EM↗

Using machine learning metrics to provide deeper insights into the performance of choice models

Machine learning (ML) techniques are increasingly drawing interest in the choice modelling (CM) field. The focus has primarily been on comparing the performance of these contrasting approaches or on improving behavioural insights for ML techniques, rather than translating ideas from one field into the other. In the present paper, we specifically focus on knowledge transfer from ML into CM in the context of model performance evaluation. In CM, model performance is typically evaluated using log-likelihood and related indicators, which are aggregate fit metrics that focus on overall fit. Conversely, in ML, the focus is on alternative-level misclassifications and correct classifications, which provide a more nuanced view of the results. To bridge these approaches, we explore the use of a probabilistic version of the confusion matrix, which reports the average probability of the model predicting each alternative, conditional on which alternative was observed to be chosen, across all choice tasks. This enables the computation of probabilistic ML metrics for both classic choice models and ML algorithms. We analyse model performance jointly in terms of overall fit and alternative-level predictions. Our findings demonstrate that models with similar log-likelihood can exhibit substantially different confusion matrices, revealing different probability patterns that aggregate metrics cannot capture. This framework identifies where models systematically `confuse' alternatives, highlighting trade-offs between alternatives, and potentially guiding model specification. Furthermore, evaluating these matrices and metrics out-of-sample reveals alternative-level prediction shifts that significantly impact forecasting performance.

econ.EM↗