WorksEconomics, Econometrics and Finance
Variational autoencoders for anomaly detection in choice modelling datasets
Abstract
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.
Introduction
In choice modelling (CM), the main aim is to understand and predict behaviour ([5, 64]). Both depend on the quality of the data, and choice data often contains anomalous observations that differ from the rest of the sample, which may arise either from errors in the data or from unusual behaviour ([29, 66]). These anomalies can cause substantial changes in model estimates and mislead applications such as market simulations and demand forecasts ([45] (Ku et al. 2017)). Identifying them can therefore help to correct errors in the data, but could also uncover heterogeneity, thus highlighting ways the model specification could be improved.
Several definitions of anomalies coexist in the literature. Hawkins [26] defines anomalies as observations that deviate so much from the other observations as to arouse suspicions that they were generated by a different mechanism. Chandola et al. [15] define them as patterns in data that do not conform to a well-defined notion of normal behaviour. More recently, Ruff et al. [52] define anomalies as an observation that significantly deviates from the expected behaviour in a system, often appearing unusual, inconsistent, or unexpected.
In the context of trip data, anomalies have also been presented as inconsistencies between observed and externally derived variables. Indeed, significant discrepancies may arise between recorded observations and values obtained from external APIs ([4]). Errors are also common in the level-of-service attributes produced by the network models used to forecast transport demand, arising, among other sources, from omissions in coded networks and schedules, the loss of geographical detail caused by zone centroids and connectors, and errors attributed to simplified delay functions ([6]).
In CM, anomalies (often referred to as outliers) tend to have a behavioural interpretation. Hultkrantz & Mortazavi [33] define anomalies as patterns in choice behaviour that are inconsistent with economic theory, i.e., with the assumption that individuals choose the alternative that maximises their utility. Furthermore, Hess et al. [29] identify three main categories in choice behaviour: non-trading behaviour, where individuals always choose the same alternative; lexicographic behaviour, where choices follow a strict ordering of the variables; and inconsistent behaviour, where choices do not follow a predictable pattern. Each type is detected with a different method ([44]), such as frequency counts of the chosen alternatives for non-trading behaviour, choice frequencies by variable level or more flexible parameter distributions for lexicographic behaviour ([14]), and ray diagrams for inconsistent behaviour [54]. Data anomalies, in turn, are usually addressed through data cleaning, for instance by removing observations whose recorded values differ greatly from those obtained from external APIs [4].
However, each of the diagnostics above targets a single, predefined type of anomaly. Some checks do consider combinations of variables, such as checks for dominated alternatives, for the range of trade-offs implied by an SP design, or for the consistency between recorded values and those obtained from external APIs [4], but each requires the analyst to decide beforehand which criterion to check. Simpler alternatives, such as flagging unusually long or expensive trips by examining the tails of each variable’s distribution, or even cleaning the data manually, look at one variable at a time. What is missing is a systematic, multivariate check that does not require the type of anomaly to be defined in advance. CM datasets consist of observations with rich multivariate distributions, so anomalies frequently emerge from multi-variable relationships rather than isolated extremes. Furthermore, correlations between variables are complex in CM datasets. For instance, a short trip with a high cost may not be anomalous on either variable separately, but anomalous when both are considered jointly. Accounting for the joint distribution of the data is therefore a central challenge.
In machine learning (ML), the task of finding anomalous observations is known as anomaly detection (AD) [15] (An & Cho 2015), and has been applied in domains such as fraud detection [1], cybersecurity [56] and healthcare [57]. Among the many AD methods, which we review in subsection 2.1, we use reconstruction-based methods. They learn a lower-dimensional representation of the data and use the difference between the original and the reconstructed observations as an anomaly score (An & Cho, 2015), thereby quantifying departures from the learned joint structure of the data [52]. They can therefore flag both extreme values and unusual combinations of variables, without the type of anomaly being defined in advance. The representation is typically learned with autoencoders, and in particular with variational autoencoders (VAEs), which learn a probabilistic latent representation and reconstruct the data through a generative network [48].
In CM, ML methods have mostly been used to predict choices [68, 69], to add flexibility to choice models [59, 25], or to uncover preference heterogeneity [58]. Less attention has been given to generative models, which learn the joint distribution of the data rather than the choice conditional on the explanatory variables (Ng & Jordan, 2002). In CM, generative models, most of them VAEs, have been used to synthesise populations [8], to generate choice sets [72, 23], and to learn latent representations of travel behaviour [70]. As they learn the data-generating process, generative models can also identify observations that do not fit it, which makes AD one of their main applications [60].
However, VAEs have not yet been used for AD in CM datasets, and the way these datasets are typically collected raises an issue for standard VAEs, which assume that observations are independent [9]. Many CM datasets have a panel structure, with several observations for the same individual, and just as this structure needs to be accounted for when estimating a choice model, it also needs to be accounted for when detecting anomalies. An observation that is unusual for the sample may make sense in the context of a specific individual, and vice versa. Moreover, for AD to be useful to the analyst, it is not enough to know which observations are anomalous, but also which of their variables make them so, as this is what allows the analyst to decide whether a flagged observation reflects an error in the data, heterogeneity to be modelled, or a specification to revisit. It is thus helpful to also identify variable-specific anomaly scores.
This paper proposes a reconstruction-based AD framework for CM data built on VAEs, and makes two main contributions. First, we bring reconstruction-based AD to CM, providing a data-driven approach for identifying atypical observations and unusual combinations of variables, without requiring predefined definitions of anomalous observations. To the best of our knowledge, such approaches have not previously been applied to choice data. Second, we extend the VAE architecture to accommodate panel data through individual-specific random effects, analogous to those used in panel mixed logit models. This allows the framework to account for correlations between observations from the same individual and to capture individual-specific patterns in the data. We first validate the framework on synthetic data, where the true utility specification is known, and anomalies can be deliberately induced, and then apply it to a stated preferences (SP) and a revealed preferences (RP) dataset. The two datasets differ in how anomalies arise: in the SP data, the attributes are set by the experimental design around a reported trip, so anomalies are expected to come from unrealistic attribute combinations and from choices that are inconsistent with them, whereas in the RP data, the attributes of the alternatives are measured for the chosen alternative, and estimated through APIs for the non-chosen alternatives, so anomalies are expected to come from errors in data collection and processing.
This paper is organised as follows: § 2 introduces the theoretical framework, with a detailed explanation of the use of VAEs for AD; § 3 presents the synthetic case study, whereas § 4 presents the real-world applications; and § 5 concludes, and presents the limitations of the study and the avenues for future research. We also report the validation checks in Appendix § 7, and the utility specifications and complementary results in Appendix § 8.
Theoretical framework
In this section, we introduce the VAE framework used to reconstruct choice data and to detect anomalous observations. In subsection 2.1 we review the main families of AD methods and explain why we use a reconstruction-based approach.
In subsection 2.2 we describe the model architecture, i.e., how observations are encoded into a low-dimensional latent representation and later reconstructed through a generative decoder, together with the training objective and the associated loss function. In subsection 2.3 we extend the framework to panel data through individual-specific random effects. In subsection 2.4 we present the anomaly score we use to flag anomalies. Finally, in subsection 2.5 we present the criteria used to assess convergence and to validate the model, checking that it captures both the marginal distributions and the dependence structure of the data.
Anomaly detection methods
In the ML literature, AD techniques can be categorised according to whether the data include labels indicating which observations are anomalous. Supervised approaches rely on labelled data identifying normal and anomalous observations, semi-supervised approaches use limited labelled information, while unsupervised approaches identify anomalies by learning patterns from unlabelled data [32]. Given that anomalous observations are not known in advance in CM datasets, and that we aim to identify unusual patterns without imposing predefined definitions of anomalous behaviour, we focus on unsupervised AD.
Within this unsupervised field, methods can be grouped into broad, not mutually exclusive, categories, depending on how they identify observations that deviate from the patterns in the data. Statistical methods, such as copula-based AD (Li et al., 2020) or AD based on empirical cumulative distributions (Li et al., 2023), assume a distribution or a probability model for the data, and then identify anomalies with respect to the model using a discordancy test [24]. The null hypothesis is that all observations come from the same distribution, and the alternative is that some observations come from a different distribution. Observations for which the null hypothesis is rejected are flagged as anomalies. These methods are well founded when the assumed distribution is appropriate, but the distribution has to be specified in advance, which is difficult for data with many variables of different types.
Distance-based methods [37, 31] flag observations that lie far, under a given metric (e.g., Euclidean or Manhattan distance), from most of the other observations in the dataset, assuming that anomalies are isolated from the majority of the data. They make no distributional assumptions, but are sensitive to parameter choices, making results unstable [16], and distances become less discriminative as the number of variables grows. They also require a metric that combines variables measured in different units and of different types, such as travel times, costs and trip purposes. Moreover, as variables are typically standardised, these methods assume equal importance across variables, which is rarely the case in practice.
Density-based methods [11], such as the local outlier factor [2], compare the local density around an observation with that around its neighbours, so that observations in regions of low density relative to their neighbours are flagged. Related approaches based on -nearest neighbours have been used to detect errors, noise and anomalous behaviour in road networks, including congestion, incidents, low volumes and abrupt driving behaviour [18]. As they also rely on distances between observations, they share the limitations of distance-based methods in high dimensions. Ensemble methods combine several, complementary methods to improve robustness and reduce the bias of individual methods. For instance, Cao & Akoglu [13] combine deep sequence learning with density-based algorithms to detect anomalies in route trajectory data.
Reconstruction-based methods instead learn a lower-dimensional representation of the data and use the difference between the original and the reconstructed observations as an anomaly score (An & Cho, 2015), thereby quantifying departures from the learned joint structure of the data [52]. Unlike statistical methods, they do not require the distribution of the data to be specified in advance, and unlike distance-based and density-based methods, they do not rely on a metric in the original space of the variables. Examples of their use for AD include spacecraft data [55], robot-assisted technologies [50], IT systems (Su et al., 2019) and video surveillance [62].
The lower-dimensional representation is typically learned with autoencoders [48]. Unlike linear dimension-reduction techniques, such as principal component analysis, autoencoders learn non-linear latent representations that capture complex dependencies between variables. Among reconstruction-based approaches, VAEs have gained particular prominence, as they learn compact probabilistic latent representations of high-dimensional data and reconstruct the inputs through deep generative networks [48]. We describe the VAE used in this paper in subsection 2.2.
We compare the VAE with two simpler methods that are frequently used in CM. The first is a univariate check, where each variable is evaluated separately. In practice, observations above a certain threshold are frequently removed, such as unusually long or expensive trips, or walking trips with a very long distance. These thresholds are either set by the analyst, based on what is considered plausible for each variable, or derived from the distribution of each variable in the sample, e.g. by flagging values above a given percentile.
The second method is the Mahalanobis distance, which evaluates all continuous variables jointly, as given by:
where is the vector of continuous variables of observation of individual , and and are their sample mean and covariance matrix, respectively. Unlike the univariate check, the Mahalanobis distance accounts for the correlations between variables, so it can flag observations whose values are each plausible on their own but whose combination is unusual. Neither method accounts for the panel structure of the data, so an observation is assessed against the whole sample rather than against the other observations of the same individual.
VAE architecture
Let the dataset contain individuals, where individual has observations, resulting in observations in total. In each observation, individual chooses one alternative from a set of alternatives, indexed by . The vector of variables for observation of individual is given by , whose variables may include the attributes of each alternative , individual characteristics, contextual variables, and the choice. Each variable is either continuous () or categorical (). Continuous variables are standardised to zero mean and unit variance, and a categorical variable with categories is one-hot encoded through the indicators , , which equal one if category is observed and zero otherwise. When some alternatives are not available for an observation, as is common in RP data, their variables are coded in the dataset as zero, and the availability of each alternative is included in as a binary categorical variable. The VAE can therefore distinguish zeros due to unavailability from observed values, and learn how availability relates to the other variables. The observations for individual are collected in , and the dataset is therefore .
VAEs [36] are generative models that combine deep learning with probabilistic graphical models to learn complex data distributions, while explicitly inferring structured latent representations from the observed data. A VAE consists of two components: an encoder that compresses each observation into a low-dimensional latent representation , and a decoder that reconstructs the input from this representation, producing the reconstruction . The encoder and the decoder are parametrised by and , respectively.
By learning a lower-dimensional probabilistic representation, each observation is mapped to a distribution over the latent space by a mean and a standard deviation. VAEs are well suited for AD [76], and this dimensionality reduction lets the modeller focus on the informative structure of the data while filtering out noise (An & Cho, 2015).
Data used in CM involve specific challenges. First, continuous and categorical variables are often mixed, so a single likelihood cannot be used for all variables. Second, continuous variables such as travel time and cost are often skewed and heavy-tailed, so that long but legitimate trips lie far from the centre of the distribution and may receive high anomaly scores. Third, the variables of unavailable alternatives are often coded as zero, which can produce large likelihood terms that distort the anomaly scores. VAEs have nonetheless shown strong performance in learning latent spaces that support the generation of diverse and realistic tabular samples [48]. We address these challenges by log-transforming skewed variables, and by including availabilities in modelling, so that the VAE can learn the structure of these observations.
In a CM context, VAEs offer at least three advantages relative to existing diagnostic tools (reviewed in subsection 2.1). First, they can detect a broad range of irregularities, such as extreme or implausible variable values, misreported variables, or combinations of variables that are individually plausible but jointly atypical, without requiring a prior definition of anomaly. Second, they can capture non-linear and multivariate patterns that are difficult to detect with traditional methods, such as univariate checks and Mahalanobis distance. Third, they scale to large, high-dimensional datasets, such as GPS-based travel data.
We use a bottleneck architecture, in which the latent dimensionality is lower than the dimensionality of the encoded input vector [30]. is a hyperparameter that controls the fundamental trade-off in reconstruction-based AD: it must be large enough for the model to capture the main dependencies in the data, but small enough such that the model does not overfit the data by reconstructing every observation well. If exceeds the intrinsic dimensionality of the data, the model can reconstruct anomalies as well as normal observations, and can no longer distinguish between them.
The encoder and the decoder have symmetric architectures, with the decoder mirroring the encoder in the number and size of its hidden layers. We use a fully connected neural network (NN) architecture, with multiple layers of artificial neurons. NNs are highly flexible, non-linear approximations, and are the most common choice for parametrising both the encoder and the decoder [8]. Each neuron computes the weighted sum of its inputs, followed by a non-linear activation function. Thus, the output of hidden layer of an NN is computed as , where is the input of the network, and are the weight matrix and the bias vector of layer , and is a non-linear activation function1. We define the collection of all weights and biases as and for the encoder () and the decoder (), respectively.
The VAE is trained by minimising the loss function (see Equation (2) below) using mini-batch gradient descent. At each step, the gradient of the loss with respect to every weight and bias in the encoder and decoder is estimated on a mini-batch of observations through backpropagation, which is the algorithm used to compute these gradients. The error between the observed and reconstructed data is thus propagated backwards through the network, from the output of the decoder to the input of the encoder, and the chain rule gives how much each weight and bias contributed to that error [53]. All parameters are then adjusted by a small step, controlled by the learning rate, in a direction that is expected to reduce the loss. This is repeated over multiple epochs2 through the training data until the loss on a validation set stops improving (i.e., early stopping).
Following the specification of Borysov et al. [8], continuous and categorical variables are treated differently within the reconstruction term. The loss combines this reconstruction term with a regularisation term that keeps the latent distribution close to the prior , a standard multivariate normal distribution, where is the identity matrix. This formulation balances data fidelity and latent-space regularisation within a single optimisation problem [19].
where the expectation is taken over the latent space given by the encoder. The first term of Equation (2) depends on the type of variable . For a continuous variable, we use the Gaussian log-likelihood, given by:
where and are the mean and standard deviation of variable predicted by the decoder. For a categorical variable with categories, we use the cross-entropy under one-hot encoding:
where is the probability of category c predicted by the decoder through a Softmax function. Since equals one only for the observed category, only the log-probability of the observed category contributes. The second term of Equation (2) is the Kullback–Leibler (KL) divergence [39] between the encoder distribution and the prior, which has the closed form
where and are the mean and standard deviation of latent dimension produced by the encoder. This term penalises deviations from the prior and regularises the latent space, so that the model cannot simply memorise individual observations. This way, observations that lie far from the learned structure of the data are given high anomaly scores.
With , Equation (2) is the negative evidence lower bound (ELBO) of the log-likelihood of the data. The log-likelihood itself, , cannot be maximised directly, as the integral has no closed form when depends on through the decoder. The encoder instead approximates the posterior of , and the log-likelihood equals the ELBO plus the KL divergence between and the true posterior . As this divergence is non-negative, minimising Equation (2) maximises a lower bound on the log-likelihood, which is tight when the encoder approximates the posterior well [36, 7].
To prevent posterior collapse, in which the KL term drives latent dimensions to the prior and the decoder ignores them, is increased linearly from zero to one over the first epochs of training [10]. In all case studies, the remaining hyperparameters are selected through a random search, while ensuring that we recover the distributions and correlations present in the data (further explained in subsection 2.5).
During training, the encoder maps each observation to two vectors of size , and (Equation (6)), which define the multivariate normal distribution . The latent variable is drawn from this distribution with the reparameterisation trick (Equation (7)), which writes the latent variable as the mean plus a scaled noise term, where denotes element-wise multiplication. This makes the sampling step differentiable and enables gradient-based optimisation:
The expectation in Equation (2) has no closed form, since depends on through the decoder. At each training step, it is estimated with one draw of per observation. The decoder maps the latent variable back into the original feature space and returns the parameters of the reconstruction distribution, i.e. and for continuous variables and the category probabilities for categorical variables:
where is the decoder NN. Although variables are reconstructed independently given , they share the same latent space, so the decoder captures dependencies among variables through . The VAE can therefore identify anomalies that arise from cross-variable interactions, which are difficult to detect with marginal methods. Note that the VAE estimates the parameters and , not the reconstructed variables . Figure 1 illustrates the VAE architecture.

Figure 1. VAE structure for AD.
Mixed-effects VAE for panel data
Standard VAEs typically assume that observations are independently and identically distributed (i.i.d.), and therefore ignore correlations between observations [9]. However, many CM datasets have a panel structure, in which multiple observations are observed for the same individual, which are correlated rather than independent [43].3 The i.i.d. assumption therefore does not hold, and this matters for AD: an observation that appears anomalous when compared with the rest of the dataset can be reasonable in the context of that individual’s other observations, and an observation that appears typical in the sample can be atypical for that individual.
To address this limitation, we use mixed-effects neural networks [71]. These models are designed for grouped data and combine a fixed component, which captures relationships common to all groups, with a random component, which captures group-specific deviations. This is analogous to the panel specification of the mixed logit model, in which random parameters are constant across the choices of the same individual to account for inter-individual heterogeneity [27].
In a standard VAE, the encoder and the decoder play the role of the fixed effects, since both are shared across all individuals and observations . We extend the decoder in Equation (8) with an individual-specific random-effects latent variable of dimension , drawn from a population-level distribution
where is a full covariance matrix, estimated jointly with and rather than fixed in advance [71] (analogous to the covariance matrix in a mixed logit). is selected through hyperparameter search.
Each individual’s random effect is described by a normal distribution , whose mean and standard deviation, , are estimated directly for each individual , rather than computed by the encoder. During training, is drawn from this distribution with the same reparameterisation trick as (Equation (7)). The random effects enter only the decoder: is still inferred from alone, and the two latent variables are concatenated into a single vector of dimension , which is the input of the decoder:
Because is shared by all observations of individual , that individual’s observations are conditionally independent given but dependent once is integrated out, as in panel mixed logit models. This relaxes the i.i.d. assumption. The loss function changes accordingly: the reconstruction term now conditions on , , and a second KL term, weighted by , keeps each individual’s random effect close to the population distribution:
where is given by Equation (3) and Equation (4), for continuous and categorical variables, respectively.
With , Equation (11) is the negative ELBO of the log-likelihood of the panel,
so minimising it approximately maximises the likelihood with respect to and , as in a mixed logit, with the integrals replaced by expectations over and . The expectation is estimated with one draw of and per observation at each training step. In each mini-batch, the KL term of is divided equally among the observations of individual , so that it is counted once per individual in each epoch.
Since and its population distribution are both Gaussian, the added KL term has a closed form:
Anomaly scores
For our anomaly scores, we use reconstruction probabilities (An & Cho, 2015), which differ from traditional reconstruction errors in that they not only consider the difference between the observed and reconstructed values but also account for the variability of the reconstruction by considering the variance parameters of the reconstruction distribution [34]. Essentially, a point-based metric, such as mean squared error, would only use by computing the differences between the means. Conversely, reconstruction probabilities use both and , so that a given residual counts less for a variable that the decoder reconstructs with high uncertainty.
The reconstruction probability of variable in observation of individual is averaged over draws of the latent variables, and , and expressed as a negative log-probability:
where each term is given by Equation (3) or Equation (4). Higher values indicate variables that the VAE reconstructs worse.
The anomaly score of observation of individual is the sum of the reconstruction probabilities of its variables and the KL term of its latent representation:
where the KL term is given by Equation (5). The first part measures how poorly the variables of the observation are reconstructed, and the second how far its latent representation is from the prior, so that an observation whose variables are reconstructed well can still be anomalous if it can only be encoded in an atypical region of the latent space.
The anomaly score of individual adds the KL term of their random effect to the average anomaly score of their observations:
where the KL term is given by Equation (12), and measures how far the random effect of the individual is from the population distribution. The anomaly scores of the observations are averaged, so that individuals with different numbers of observations can be compared.
High anomaly scores indicate that the observation deviates substantially from the patterns captured by the VAE, and are therefore interpreted as anomalies. An important clarification is that a high anomaly score suggests that the joint configuration of variables of the observation is atypical relative to the rest of the dataset, rather than reflecting an extreme value in a single variable. Such anomalies may arise from data quality issues, such as misreported variables or coding errors, but they may also reflect genuinely unusual choice situations characterised by rare or extreme variable combinations.
Model convergence and validation
Ensuring the reliability of a generative model requires both verifying convergence during training and validating the quality of the generated data. Convergence can be checked by inspecting the evolution of the loss function over training epochs, disaggregating it into its different components. The loss function is composed of the reconstruction term and the KL terms (Equation (11)). We also need to verify that neither component dominates the loss function: if the KL term approaches zero, the latent variables carry no information and the decoder ignores them, whereas if the reconstruction loss dominates, the latent space is barely regularised and the model behaves like a standard autoencoder.
However, convergence is not the only criterion that has to be met. We also need to check that the distributions of the variables generated by the VAE match those of the original data ([8]). For the categorical variables, we use the Total Variation (TV) distance ([20]), and the Jensen-Shannon Divergence (JSD) ([46]). TV measures the maximum discrepancy in probability mass between two distributions and ranges from 0 to 1, with values close to 0 indicating strong similarity. JSD is a symmetric and smoothed version of the KL divergence that quantifies the similarity in information content between two distributions, also bounded between 0 and 1, with lower values indicating better agreement. For continuous variables, we instead compute the Wasserstein (W) distance ([49]) and the Kolmogorov—Smirnov (KS) statistic ((Lopes, 2025)). The Wasserstein distance measures the minimal effort required to transform one distribution into another, making it sensitive to differences in both the shape and the location of the distributions. Lower W values indicate that the reconstructed and original distributions are close in a geometric sense. The KS statistic is the maximum difference between the empirical cumulative distribution functions of the real and reconstructed variables. It ranges from 0 to 1, and small values indicate that the two samples come from similar underlying distributions. Together, these metrics assess whether the VAE reproduces the univariate distributions of the input variables, confirming whether the model has adequately learned to reconstruct each variable from the latent representation ([74]).
Nevertheless, this is not sufficient, as a generative model can match each variable separately and still fail to reproduce the dependence structure ([8]). We also need to check that correlations between variables match those in the original data. For example, a model could match the distributions of age and income perfectly and still generate a negative association between them, even if the real data show a positive one. For categorical variables, we can compute Cramér’s V ([17]), which is a statistical measure of association between two categorical variables, ranging from 0 to 1, where 0 indicates no relationship, and 1 indicates perfect association. For continuous variables, there is no gold standard, but we can use Pearson’s correlation index ([63, 35] (H. Zhang et al. 2023)). We therefore compute two matrices, one with Cramér’s V between every pair of categorical variables and one with Pearson’s correlation between every pair of continuous variables, separately for the real and the synthetic data, and compare each pair of matrices. The synthetic data reproduce the dependence structure well if the matrices look alike, if variables that are strongly related in the real data remain strongly related in the synthetic data, and if the mean absolute difference between corresponding entries is small ((J. Zhang et al., 2023)).
Synthetic case study
We first introduce a synthetic case study where we generate panel choice data with a fully specified data-generating process, so that we know the distributions and correlations of the generated variables, and the utility functions for each individual’s choices. As the CM literature lacks a standardised definition for what constitutes an anomaly (or outlier), we induce anomalies of known types, described below, and test whether our approach flags them. We also compare our approach with the two simpler methods described in subsection 2.1, univariate checks and the Mahalanobis distance.
We generate data for 1,000 individuals, with 10 trips each. Each trip has three alternatives, car, bus and rail, which are always available, and each alternative is described by its travel time and travel cost. Each trip also has a recorded trip type with three levels, A, B and C, (which could represent, e.g. trip purposes), and which make up 50%, 30% and 20% of the trips, respectively.
To make this more consistent with real-world scenarios, travel times and costs depend on the length of each trip, which is not recorded and follows a log-normal distribution with a median of 5, 15 and 40 km for trip types A, B and C, respectively, and a standard deviation of 0.5 on the log scale. The travel time of each alternative is the sum of a fixed component (e.g., access time), and a variable component given the assumed speed of that alternative. Similarly, the travel cost is the sum of a fixed charge and a charge per kilometre. Speeds and charges per kilometre depend on the trip type, and are shown in Table 1. Moreover, the fixed time, the speed and the charge per kilometre of each alternative vary across individuals, but little across the trips of the same individual, so that individuals differ consistently from one another.
| Alternative | Median fixed time (min) | Speed (km/h) A | B | C | Fixed cost (£) | Cost per km (£) A | B | C |
| Car | 5 | 30 | 50 | 80 | 3.0 | 0.15 | 0.25 | 0.40 |
| Bus | 8 | 15 | 25 | 40 | 2.0 | 0.03 | 0.05 | 0.08 |
| Rail | 15 | 40 | 60 | 100 | 3.0 | 0.09 | 0.15 | 0.24 |
Table 1. Parameters used to generate the travel times and costs of the synthetic dataset, disaggregated by alternative and trip type. Fixed times follow a log-normal distribution with a standard deviation of 0.5 on the log scale between individuals and 0.1 within individuals. Speeds and charges per kilometre are multiplied by individual-specific log-normal factors with a median of 1 and a standard deviation of 0.25 on the log scale.
As a result, all travel times and costs are positive and right-skewed, with medians of 21, 39 and 30 minutes and £4.8, £2.4 and £4.1 for car, bus and rail, respectively. They are also strongly correlated (between 0.61 and 0.97), as they all depend on the trip length. However, these relationships are not linear: because of the fixed components, cost does not increase proportionally with time, and because speeds and charges differ by trip type, the data follow a different curve for each trip type, so that a combination of time and cost that is normal for one trip type may be unusual for another. Moreover, as the fixed time, speed, and cost rate are specific to each individual, individuals differ consistently from one another.
Choices are computed from the known utility functions of a panel mixed logit model with random heterogeneity in the travel time component:
where rail is the reference alternative, the alternative-specific constants are and , , and the time parameter follows a negative log-normal distribution across individuals, with and . It is important to clarify that and follow the standard notation for random parameters in choice models [28], and are not related to the parameters of the decoder in subsection 2.2. The true mean value of travel time (VoTT) is therefore £14.4 per hour, and car, bus and rail are chosen in 50%, 20% and 30% of the trips, respectively.
Because we know the data-generating process, observations that seem unusual under it would not be true anomalies. Hence, we induced anomalies of four types to understand if our approach is able to flag these observations, described below:
Underestimated travel times (250 trips), where the travel time of a non-chosen alternative is recomputed with a trip length two to three times shorter than the true one, while its cost is kept. The alternative is therefore recorded as faster than it was. Each value is plausible on its own, but they do not fit together given the other alternatives of the trip.
Trip type errors (250 trips), where the time and cost of a non-chosen alternative are generated with the speeds and charges of a different trip type. They are normal for the sample as a whole, but not given the trip type.
Individual inconsistent observations (250 trips), where for some individuals we add an 11th trip, which is a normal trip of another individual, as would happen if a record were linked to the wrong respondent.
Extreme values (250 trips), where the cost of an alternative is multiplied by ten.
Individual inconsistent observations are limited by the number of individuals, as we add at most one to each, and they are normal for the sample, but not at the individual level. Underestimated travel times and trip type errors are induced in a non-chosen alternative, so that the choice was made with the true values.
We aim to analyse whether excluding the flagged observations implies shifts in the parameter estimates, as the induced anomalies should bias the estimates, and a given method could potentially flag an anomaly a normal observation, and vice versa. Correctly identifying and removing the anomalies should reduce the bias, whereas removing normal observations should do the opposite.
To understand the results, we also examine which induced anomalies each method flags. The univariate check follows the thresholds commonly used in practice: it flags the trips in which the travel time or cost of any alternative is above a given percentile of that variable in the sample. For example, flagging 5% of the observations corresponds to the 99th percentile, i.e., to trips with a travel time above 80, 162 and 82 minutes, or a cost above £43.6, £12.7 and £31.9, for car, bus and rail, respectively. The Mahalanobis distance is computed on the same six variables, i.e., time and cost of the three alternatives, and flags observations that lie far from the centre of the sample, given the correlations between these variables. We expect all methods to detect extreme costs, as these involve a single value far in the tail of its distribution. In contrast, underestimated travel times and trip type errors have values that are plausible on their own, so we expect them to be harder to detect for conventional methods. As the VAE learns how the variables relate to each other and to the trip type, we expect it to detect them more often. Individual inconsistent observations are normal for the sample, so they can only be identified by comparing them with the other observations of the same individual. We therefore expect them to be detected mainly by the VAE with mixed effects, as the other methods assess each observation against the whole sample.
Travel times and costs are log-transformed and standardised, and the trip type and the choice are treated as categorical variables. We estimate two variants of the VAE, with and without mixed effects, each with its own hyperparameters, shown in Table 2. Across 5 seeds, the scores have an average Spearman correlation of 0.97; we report the results of the model trained with the first seed.
| Hyperparameter | Search space | V | V |
| Latent dimension () | 2, 3, 4, 6 | 4 | 3 |
| Random-effect dimension () | 2, 4, 8 | – | 8 |
| Hidden layers | 1, 2, 3, 4 | 2 | 3 |
| Hidden layer size | 4, 8, 16, 32, 64, 96, 128 | 128 | 32 |
| Learning rate | , , , , | ||
| Batch size | 8, 16, 32, 64, 128 | 128 | 32 |
| Weight decay | 0, , , | 0 |
Table 2. Hyperparameter search space and selected configuration for each VAE in the synthetic dataset, without (V) and with mixed effects (V).
Table 3 shows the share of induced anomalies of each type flagged by each method among the 1%, 5% and 10% of observations with the highest scores, and the number of normal observations flagged. As expected, most extreme values are detected by all methods. The Mahalanobis distance and both VAEs recover almost all of them with the top 5%, whereas the univariate check recovers 76% with the top 5% and 87% with the top 10%, as a cost multiplied by ten on a short trip can still be lower than the cost of a long trip. Larger differences arise for the other three types. The univariate check flags none of the underestimated travel times and trip type errors, even with the top 10%, and the Mahalanobis distance flags 11% and 3% of them with the top 5%, and 24% and 16% with the top 10%. In contrast, the VAE with mixed effects flags 17% of the underestimated travel times and 28% of the trip type errors with the top 5%, and 38% and 66% with the top 10%, although underestimated travel times remain the hardest type to detect. It is also the method that detects the most individual inconsistent observations, flagging 20%, 48% and 70% of them with the top 1%, 5% and 10%, compared with at most 11% for the other methods.
| Type of anomaly | Top 1% U | Top 1% M | Top 1% V | Top 1% V | Top 5% U | Top 5% M | Top 5% V | Top 5% V | Top 10% U | Top 10% M | Top 10% V | Top 10% V |
| Extreme values (250) | 39% | 39% | 35% | 15% | 76% | 100% | 99% | 100% | 87% | 100% | 100% | 100% |
| Underestimated travel times (250) | 0% | 0% | 0% | 2% | 0% | 11% | 6% | 17% | 0% | 24% | 15% | 38% |
| Trip type errors (250) | 0% | 0% | 2% | 3% | 0% | 3% | 14% | 28% | 0% | 16% | 28% | 66% |
| Individual inconsistent obs. (250) | 0% | 0% | 0% | 20% | 4% | 4% | 1% | 48% | 11% | 8% | 6% | 70% |
| All induced anomalies (1,000) | 10% | 10% | 9% | 10% | 20% | 29% | 30% | 48% | 24% | 37% | 37% | 68% |
| Normal observations flagged | 4 | 5 | 10 | 2 | 314 | 218 | 210 | 32 | 781 | 657 | 654 | 341 |
Table 3. Share of induced anomalies of each type flagged by the univariate check (U), the Mahalanobis distance (M), and the VAE without (V) and with (V) mixed effects among the 1%, 5% and 10% of observations with the highest scores. As there are 250 anomalies of each type and the top 1% contains 102 observations, at most 41% of a type can be flagged with the top 1%. The last row shows the number of normal observations flagged.
The mixed effects make the largest difference. Without them, the VAE flags only 6% of the underestimated travel times, 14% of the trip type errors and 1% of the individual inconsistent observations with . Indeed, for the latter, the added trip is a normal trip for the sample as a whole, so it can only be identified by comparing it with the individual’s other trips. The mixed effects also reduce the number of normal observations that are flagged, from 210 to 32 with the top 5%, the fewest of all methods at every share.
To examine why observations are flagged, Table 4 shows the fifteen observations with the highest scores of the VAE with mixed effects, with the travel time and cost of each alternative, and their percentiles among all normal observations in brackets. All fifteen are induced anomalies. The first ten are individual inconsistent observations, and only two of them are also flagged by another method with . Most of their values are common in the sample as a whole, but at least one of them lies far from the other trips of the same individual, and in eight of these ten this is the case for the rail time, which is the alternative with the longest fixed time, and therefore the one that differs most between individuals. For example, all values of trip 8326 lie between the 7th and 20th percentiles of the sample, but its rail time is far from those of the other trips of individual 812. The other three types follow closely, with an underestimated travel time, an extreme value and a trip type error at ranks 11, 13 and 14, respectively. Indeed, the VAE with mixed effects does not only detect inconsistencies within individuals: compared with the VAE without mixed effects, it also flags more underestimated travel times and trip type errors, and fewer normal observations (Table 3).
| Rank | Trip | Individual | Trip type | Car tt | Car tc | Bus tt | Bus tc | Rail tt | Rail tc | Choice | Score | Type | Also flagged by |
| 1 | 2022 | 197 | C | 64.0 (96.6) | 25.1 (93.7) | 127.1 (96.8) | 6.0 (92.6) | 89.7 (99.1) | 24.7 (98.4) | Car | 29.4 | II | – |
| 2 | 639 | 62 | A | 26.9 (68.1) | 3.9 (33.3) | 18.6 (7.8) | 2.2 (37.1) | 28.1 (45.7) | 3.4 (73.7) | Car | 24.1 | II | M |
| 3 | 4467 | 435 | C | 34.1 (80.5) | 28.0 (95.3) | 108.0 (94.7) | 7.8 (96.6) | 41.5 (77.4) | 14.1 (91.2) | Rail | 23.7 | II | – |
| 4 | 8326 | 812 | A | 11.8 (13.0) | 3.4 (7.6) | 23.1 (16.5) | 2.1 (8.3) | 15.6 (7.3) | 3.4 (20.1) | Car | 23.1 | II | – |
| 5 | 5415 | 528 | A | 17.9 (38.6) | 3.6 (19.8) | 28.4 (28.5) | 2.1 (23.9) | 38.3 (71.6) | 3.4 (22.9) | Car | 22.3 | II | – |
| 6 | 3688 | 359 | A | 14.2 (22.8) | 3.6 (17.4) | 13.2 (1.4) | 2.1 (19.7) | 15.6 (7.3) | 3.3 (12.3) | Car | 21.8 | II | – |
| 7 | 4883 | 476 | A | 18.6 (41.3) | 3.8 (27.4) | 25.5 (21.8) | 2.2 (31.9) | 54.6 (90.8) | 3.5 (25.2) | Car | 21.7 | II | – |
| 8 | 9276 | 905 | C | 92.9 (99.2) | 28.6 (95.5) | 165.9 (98.7) | 7.4 (96.0) | 72.5 (97.2) | 26.0 (98.6) | Bus | 20.8 | II | – |
| 9 | 7733 | 754 | C | 24.0 (61.2) | 13.1 (82.2) | 76.1 (86.2) | 3.7 (80.0) | 20.2 (19.7) | 11.0 (86.1) | Rail | 20.4 | II | V |
| 10 | 874 | 85 | B | 26.7 (67.8) | 5.3 (54.5) | 47.3 (63.3) | 2.7 (62.5) | 27.7 (44.5) | 4.2 (51.6) | Car | 20.3 | II | – |
| 11 | 1095 | 107 | B | 55.7 (94.6) | 11.0 (79.1) | 39.7 (51.5) | 3.7 (79.5) | 56.9 (92.2) | 7.4 (77.5) | Car | 19.7 | UT | M, V |
| 12 | 41 | 4 | A | 10.4 (8.1) | 3.3 (3.8) | 26.0 (22.8) | 2.1 (5.3) | 7.9 (0.1) | 3.3 (9.6) | Car | 19.3 | II | M |
| 13 | 8547 | 834 | C | 96.4 (99.3) | 475.6 (>99.9) | 138.6 (97.5) | 12.4 (99.6) | 73.8 (97.4) | 30.7 (99.2) | Rail | 19.3 | EV | U, M, V |
| 14 | 1182 | 116 | A | 11.8 (30.0) | 7.9 (70.3) | 29.2 (30.6) | 2.4 (52.6) | 29.8 (81.0) | 4.3 (54.3) | Bus | 19.1 | TE | V |
| 15 | 4650 | 453 | B | 38.7 (85.5) | 6.4 (62.4) | 70.5 (83.4) | 3.5 (77.6) | 71.9 (97.1) | 7.0 (76.1) | Car | 19.0 | II | – |
| 78 | 1829 | 179 | A | 109.8 (99.6) | 12.5 (81.4) | 236.1 (99.8) | 3.9 (81.0) | 98.4 (99.5) | 9.7 (83.5) | Rail | 13.8 | N | M, V |
| 100 | 8349 | 814 | C | 77.2 (98.4) | 38.0 (98.1) | 91.0 (91.2) | 6.6 (94.3) | 44.8 (82.0) | 14.5 (91.7) | Bus | 13.1 | N | V |
| 110 | 2332 | 228 | C | 358.2 (>99.9) | 96.2 (>99.9) | 486.7 (>99.9) | 23.9 (>99.9) | 175.0 (>99.9) | 59.0 (>99.9) | Rail | 13.0 | N | U, M, V |
| 162 | 8237 | 804 | B | 88.0 (99.0) | 28.9 (95.7) | 212.1 (99.6) | 8.8 (97.8) | 85.6 (98.9) | 20.2 (96.6) | Car | 11.8 | N | U, V |
| 166 | 1691 | 165 | C | 129.1 (99.8) | 45.0 (99.1) | 154.9 (98.2) | 14.6 (99.8) | 64.3 (95.2) | 36.4 (99.9) | Bus | 11.8 | N | M, V |
| 514 | 6501 | 634 | A | 20.0 (47.2) | 3.8 (28.5) | 29.8 (32.0) | 2.1 (20.1) | 27.1 (43.0) | 37.4 (99.7) | Car | 8.1 | EV | U, M, V |
| 515 | 6328 | 617 | C | 22.6 (56.5) | 10.0 (77.1) | 38.8 (49.7) | 3.0 (71.0) | 22.0 (25.7) | 5.9 (69.5) | Car | 8.1 | II | – |
| 516 | 4200 | 410 | B | 37.6 (84.3) | 7.5 (68.7) | 34.8 (42.3) | 3.2 (74.2) | 40.5 (78.5) | 5.3 (65.6) | Rail | 8.1 | TE | – |
| 517 | 8319 | 812 | B | 20.6 (49.4) | 6.1 (60.5) | 24.2 (19.1) | 3.3 (75.1) | 42.0 (78.1) | 4.7 (58.3) | Car | 8.0 | TE | – |
| 518 | 7119 | 695 | B | 22.2 (55.0) | 5.6 (57.6) | 33.9 (40.3) | 2.5 (55.4) | 15.7 (7.4) | 6.1 (71.4) | Car | 8.0 | TE | V |
Table 4. Fifteen observations with the highest anomaly scores of the VAE with mixed effects (top block), top five normal observations flagged as anomalies (middle block), and the five induced anomalies with the highest scores that were not flagged with (bottom block). Travel time (tt) in minutes and travel cost (tc) in £. Percentiles among all normal observations in brackets. Type: individual inconsistent observation (II), underestimated travel time (UT), extreme value (EV), trip type error (TE) and normal observation (N). Also flagged by: other methods flagging the observation with : univariate check (U), Mahalanobis distance (M) and VAE without mixed effects (V).
The first normal observation appears only at rank 78. As shown in Table 3, more normal observations are flagged as decreases, and the middle block of Table 4 shows the five with the highest scores. Two of them, trips 1829 and 2332, are very long trips, with travel times above the 99th percentile of the sample for all alternatives, and the other three have at least two values above the 95th percentile, and some values far from the other trips of the same individual. As their values lie in the tails of the distributions, all five are also flagged by the VAE without mixed effects, and three of them by each of the univariate check and the Mahalanobis distance. They are not errors but rare observations from the tails of the data-generating process, and more of them are flagged with lower values of . Finally, the bottom block shows the five induced anomalies with the highest scores among those not flagged with : three trip type errors, one individual inconsistent observation and one extreme value. Their scores are only slightly below the threshold, so all five are flagged with . The extreme value is flagged with by all three other methods, and one of the trip type errors by the VAE without mixed effects.
Table 4: Fifteen observations with the highest anomaly scores of the VAE with mixed effects (top block), top five normal observations flagged as anomalies (middle block), and the five induced anomalies with the highest scores that were not flagged with (bottom block). Travel time (tt) in minutes and travel cost (tc) in £. Percentiles among all normal observations in brackets. Type: individual inconsistent observation (II), underestimated travel time (UT), extreme value (EV), trip type error (TE) and normal observation (N). Also flagged by: other methods flagging the observation with : univariate check (U), Mahalanobis distance (M) and VAE without mixed effects (V).
Finally, we estimate a panel mixed logit model with the true specification on the full sample (including the induced anomalies), after excluding the 1%, 5% and 10% of observations with the highest scores of each method, and after excluding the same shares of observations at random.
Table 5 shows the estimates, their t-ratios based on robust standard errors, and their percentage difference from the true values. All parameters are highly significant in all cases. Excluding the top 1% of observations does not lead to major changes in the estimates for any method. With the top 5%, excluding observations at random or by the Mahalanobis distance leaves the estimates almost unchanged, and the univariate check moves the mean VoTT further from its true value (9.9% below). The VAE with mixed effects brings the mean VoTT closest to its true value (£13.44 per hour, 6.7% below). With the top 10%, the VAE with mixed effects brings all estimates close to their true values: is 0.7% smaller in magnitude, 2.2% larger in magnitude, and 0.9% smaller than their true values, and the mean VoTT is £13.57 per hour, 5.8% below its true value. The VAE without mixed effects also brings and close to their true values, but underestimates by 5.8%, so that the mean VoTT is £13.22 per hour, 8.2% below its true value. In contrast, excluding the observations at random leaves the estimates almost unchanged, with a mean VoTT 7.6% below its true value. The Mahalanobis distance brings and closer to their true values than random exclusion, but not , so that the mean VoTT is 10.5% below its true value. The univariate check brings and closer to their true values, but moves further from it, so that the mean VoTT is 13.6% below its true value. Hence, on the mean VoTT, the univariate check and the Mahalanobis distance perform worse than removing observations at random.
| Mean VoTT (£/h) | Induced removed | ||||||
| True values | 0.500 | −0.500 | −0.250 | −2.925 | 0.472 | 14.40 | – |
| Full sample | 0.519 (19.7) | −0.548 (−14.6) | −0.231 (−33.0) | −3.099 (−73.4) | 0.505 (13.2) | 13.30 (26.6) | 0 |
| +3.8% | +9.7% | −7.5% | +5.9% | +6.9% | −7.6% | ||
| Top 1% excluded | |||||||
| R | 0.519 (19.5) | −0.548 (−14.5) | −0.231 (−32.9) | −3.098 (−73.1) | 0.505 (13.2) | 13.32 (26.4) | 10 |
| +3.7% | +9.5% | −7.5% | +5.9% | +7.0% | −7.5% | ||
| U | 0.525 (19.9) | −0.550 (−14.5) | −0.232 (−32.8) | −3.103 (−73.0) | 0.506 (13.1) | 13.22 (26.4) | 98 |
| +5.0% | +10.1% | −7.3% | +6.1% | +7.1% | −8.2% | ||
| M | 0.524 (19.9) | −0.545 (−14.4) | −0.232 (−32.9) | −3.095 (−73.3) | 0.503 (13.2) | 13.31 (26.6) | 102 |
| +4.7% | +9.0% | −7.3% | +5.8% | +6.6% | −7.5% | ||
| V | 0.523 (19.8) | −0.555 (−14.6) | −0.233 (−33.0) | −3.096 (−73.0) | 0.498 (13.0) | 13.17 (26.6) | 92 |
| +4.6% | +10.9% | −6.7% | +5.9% | +5.5% | −8.5% | ||
| 0.516 (19.5) | −0.547 (−14.4) | −0.232 (−32.9) | −3.097 (−72.3) | 0.513 (13.4) | 13.34 (26.3) | 100 | |
| +3.2% | +9.5% | −7.3% | +5.9% | +8.5% | −7.4% | ||
| Top 5% excluded | |||||||
| R | 0.519 (19.1) | −0.548 (−14.2) | −0.231 (−32.3) | −3.097 (−72.1) | 0.502 (12.8) | 13.31 (26.0) | 49 |
| +3.7% | +9.6% | −7.6% | +5.9% | +6.3% | −7.6% | ||
| U | 0.529 (19.6) | −0.558 (−14.4) | −0.235 (−31.0) | −3.093 (−69.7) | 0.478 (11.1) | 12.97 (24.9) | 198 |
| +5.9% | +11.5% | −6.0% | +5.8% | +1.1% | −9.9% | ||
| M | 0.524 (19.6) | −0.544 (−13.9) | −0.230 (−31.2) | −3.099 (−71.2) | 0.494 (11.7) | 13.31 (24.8) | 294 |
| +4.9% | +8.7% | −8.1% | +5.9% | +4.5% | −7.6% | ||
| V | 0.523 (19.5) | −0.553 (−14.1) | −0.240 (−32.5) | −3.049 (−73.7) | 0.479 (12.1) | 13.29 (25.8) | 302 |
| +4.5% | +10.5% | −4.0% | +4.3% | +1.4% | −7.7% | ||
| 0.523 (19.5) | −0.539 (−13.7) | −0.237 (−32.2) | −3.062 (−71.8) | 0.501 (12.8) | 13.44 (26.0) | 480 | |
| +4.7% | +7.7% | −5.3% | +4.7% | +6.0% | −6.7% | ||
| Top 10% excluded | |||||||
| R | 0.519 (18.7) | −0.547 (−13.8) | −0.231 (−31.2) | −3.101 (−70.1) | 0.505 (12.3) | 13.31 (25.3) | 103 |
| +3.8% | +9.4% | −7.7% | +6.0% | +7.0% | −7.6% | ||
| U | 0.539 (19.0) | −0.576 (−14.1) | −0.241 (−26.9) | −3.115 (−64.9) | 0.484 (9.2) | 12.44 (20.8) | 244 |
| +7.9% | +15.2% | −3.7% | +6.5% | +2.4% | −13.6% | ||
| M | 0.532 (19.1) | −0.561 (−13.8) | −0.237 (−30.1) | −3.099 (−64.6) | 0.494 (10.9) | 12.88 (23.3) | 368 |
| +6.4% | +12.1% | −5.1% | +6.0% | +4.6% | −10.5% | ||
| V | 0.531 (19.1) | −0.561 (−13.9) | −0.252 (−31.4) | −2.990 (−70.6) | 0.445 (10.4) | 13.22 (24.9) | 371 |
| +6.3% | +12.2% | +0.8% | +2.2% | −5.8% | −8.2% | ||
| 0.516 (18.4) | −0.542 (−13.2) | −0.248 (−31.3) | −2.990 (−69.6) | 0.468 (10.6) | 13.57 (24.3) | 684 | |
| +3.3% | +8.4% | −0.7% | +2.2% | −0.9% | −5.8% |
Table 5. Estimates of the panel mixed logit model on the full sample and after excluding the 1%, 5% and 10% of observations with the highest scores of each method: random exclusion (R, mean of 20 repetitions), univariate check (U), Mahalanobis distance (M), and the VAE without (V) and with (VME) mixed effects. Robust t-ratios in brackets, using the delta method for the mean VoTT, and percentage difference in magnitude from the true value below each estimate. The last column shows the number of induced anomalies removed (out of 1,000).
Overall, excluding the observations flagged by the VAE with mixed effects brings the estimates closer to their true values than excluding those flagged by the simpler methods. This is because the VAE with mixed effects
detects far more individual inconsistent observations than the other methods, while also detecting trip type errors and underestimated travel times more often than the simpler methods, and it flags fewer normal observations of individuals who differ consistently from the rest of the sample. Without mixed effects, the VAE performs little better than the Mahalanobis distance. However, most underestimated travel times remain undetected, so removing the flagged observations corrects only part of the bias in the estimates.
Real world case studies
This section presents the results of our method applied to two datasets: an SP dataset—the Swiss route choice dataset (subsection 4.1)—and an RP dataset—the Decisions dataset (subsection 4.2). The two differ in how the data are produced. In the SP dataset, variable levels are set by an experimental design pivoted around each individual’s reference trip, and choices are hypothetical. In the RP dataset, choices are observed, and the variables of the alternatives, such as travel times and distances, are computed from external sources, e.g., routing APIs. Analysing both therefore allows us to examine which types of anomalies arise under each data collection process.
Swiss route dataset
We analyse the Swiss route dataset ([67]), available in Apollo ([28]). This dataset contains 388 individuals who participated in a stated choice survey regarding the introduction of a tilting train in Switzerland, yielding 3,492 observations. Each individual was first presented with a complete description of their reported trip, in order to verify this, and then faced nine observations between two route alternatives pivoted on their reported trip. The choices are well balanced: route 1 was chosen 1,743 times (49.9%), and route 2 was chosen 1,749 times (50.1%). Each alternative is characterised by travel time, cost, headway, and number of interchanges. We summarise the variables reconstructed by the VAE in Table 6.
| Variable | Type | Description (units) |
| tt1 | Continuous | Travel time (mins) for route 1. |
| tc1 | Continuous | Travel cost (CHF) for route 1. |
| hw1 | Continuous | Headway (mins) for route 1. |
| ch1 | Categorical | Number of interchanges for route 1. |
| tt2 | Continuous | Travel time (mins) for route 2. |
| tc2 | Continuous | Travel cost (CHF) for route 2. |
| hw2 | Continuous | Headway (mins) for route 2. |
| ch2 | Categorical | Number of interchanges for route 2. |
| hh_inc_abs | Continuous | Household income (CHF/year). |
| car_availability | Categorical | Car availability, 1 if yes, 0 otherwise. |
| purpose | Categorical | Trip purpose: commute, shopping, business or leisure. |
| choice | Categorical | 1 if choice is route 1, 2 if choice is route 2 |
Table 6.
Table 6: Variables reconstructed by the VAE for the Swiss route dataset. Continuous variables are log-transformed and standardised before training. Categorical variables are one-hot encoded.
The VAE architecture for the Swiss route dataset, alongside the search space for the hyperparameter tuning, is presented in Table 7.
| Hyperparameter | Search space | Selected |
| Latent dimension () | 8, 16, 24, 32, 48, 64 | 8 |
| Random-effect dimension () | 2, 4, 6, 8 | 4 |
| Hidden layers | 1, 2, 3, 4 | 1 |
| Hidden layer size | 32, 64, 96, 128, 160, 192 | 128 |
| Learning rate | , , , , | |
| Batch size | 32, 64, 128, 256, 512 | 128 |
| Weight decay | 0, , , , |
Table 7.
Table 7: Hyperparameter search space and selected configuration for the Swiss route dataset.
Figure 2 shows the distribution of the anomaly scores. Using the 95th percentile as threshold (), 175 of the 3,492 observations are flagged as anomalies, shown as red dots. With and , 35 and 349 observations are flagged, respectively, and these three thresholds are later used to assess the effect of the flagged observations in CM outputs. The distribution is unimodal and right-skewed: most observations have low scores within a narrow range, and a small number lie in a long upper tail. Most of the flagged observations are just above the threshold, while a few have much larger scores further into the tail.

Figure 2. Distribution of anomaly scores for the Swiss route dataset. Red dots indicate the 175 observations above the 95th percentile.
The magnitude of the anomaly scores depends on the number and type of variables reconstructed, as the score sums the contributions of all variables and the KL term. The contributions of continuous variables can also be negative, as they are the negative logarithm of a density, which can be larger than one when the variable is reconstructed precisely. The scores are therefore not comparable across datasets, and only their ranking within a dataset is meaningful. This is why the threshold is set as a percentile of the scores rather than as a fixed value, so that the same rule can be applied to any dataset.
An observation is not flagged because of a single value, but because the full set of its variables is unlikely given the rest of the sample. Since the VAE reconstructs the variables of both alternatives together with the socio-demographic variables, the same variable values can be typical for one observation and anomalous for another, depending on, for instance, the trip purpose, income or car availability of the individual. Observations with a high score therefore do not fit the profile of the individual or the trip, which may come from errors in how the data were generated or recorded, or from genuinely unusual trips. This makes the anomaly score a complement to the usual data cleaning checks applied before estimation, which look at each variable separately.
Table 8 presents the ten observations with the highest anomaly scores, with their variable-specific reconstruction probabilities in brackets and their KL terms. We identify two types of observations. Some have variables that do not fit together and are poorly reconstructed. In trip 1526 of individual 17525, which has the highest score, the routes take 25 and 23 minutes but cost only 1 and 2 CHF, and the cost of route 2 is the worst reconstructed variable in the whole sample. In trip 1486, the individual chose route 1, which takes 41 minutes longer and has one more interchange, for 4 CHF less, so the choice is poorly reconstructed. Most of the other observations are reconstructed well, but can only be encoded in an atypical region of the latent space, so that their KL terms are among the highest in the sample. These include very short trips that are expensive for their duration, such as trips 540 and 110, with 4 to 7 minutes for 8 to 12 CHF, and trips 2024 and 2020 of individual 19401, with 3 to 5 minutes for 6 to 9 CHF; very short and cheap trips, such as trips 1573 and 1568 of individual 17669, with 2 to 3 minutes for 1 to 2 CHF; and very long and expensive trips, such as trips 1188 and 1187 of individual 16117, with 101 to 153 minutes for 181 to 268 CHF. Across all flagged observations, the KL term is the largest part of the score, and the flagged observations are much shorter than the rest, with a median travel time of 15 minutes for route 1, compared with 37 minutes in the sample, and more often shopping trips (26%, compared with 8%). Among the variables, the headway of route 1 is the most unusual in 26% of them, followed by the choice (21%) and the headway of route 2 (19%).
| Trip | User | Route 1 | Route 1 | Route 1 | Route 1 | Route 2 | Route 2 | Route 2 | Route 2 | Income | Car avail. | Purpose | Choice | KL | Anomaly score |
| Time | Cost | Headway | Interch. | Time | Cost | Headway | Interch. | ||||||||
| 1526 | 17525 | 25 (−1.3) | 1 (0.1) | 15 (0.3) | 0 (0.6) | 23 (−0.3) | 2 (2.0) | 15 (0.9) | 0 (1.8) | 112,500 (0.1) | 1 (0.0) | Commute (0.1) | 1 (0.5) | 10.6 | 15.5 |
| 540 | 14458 | 6 (−1.2) | 8 (−1.0) | 30 (0.9) | 2 (1.2) | 4 (−0.7) | 11 (−0.3) | 15 (1.1) | 1 (0.6) | 50,000 (0.2) | 0 (0.0) | Shopping (0.0) | 1 (0.8) | 12.1 | 13.8 |
| 2024 | 19401 | 5 (−0.8) | 6 (−0.4) | 60 (0.3) | 1 (1.0) | 4 (−1.2) | 9 (0.5) | 15 (0.4) | 0 (0.6) | 90,000 (0.1) | 0 (0.0) | Shopping (0.0) | 2 (0.1) | 12.0 | 12.6 |
| 110 | 12409 | 7 (−0.6) | 9 (−1.6) | 60 (2.1) | 1 (1.0) | 6 (−1.2) | 12 (−1.3) | 60 (1.6) | 1 (0.6) | 70,000 (0.1) | 1 (0.0) | Leisure (0.0) | 1 (0.9) | 10.6 | 12.4 |
| 1573 | 17669 | 3 (−1.1) | 1 (−1.3) | 15 (1.0) | 2 (0.2) | 2 (−0.8) | 2 (−1.7) | 60 (1.5) | 0 (0.8) | 70,000 (0.1) | 0 (0.0) | Leisure (0.1) | 2 (0.7) | 12.8 | 12.3 |
| 1188 | 16117 | 145 (−1.4) | 206 (−1.2) | 30 (0.9) | 2 (0.3) | 101 (−1.0) | 268 (0.7) | 15 (0.4) | 1 (0.6) | 112,500 (0.1) | 0 (0.0) | Leisure (0.1) | 2 (0.1) | 12.7 | 12.3 |
| 2020 | 19401 | 5 (−1.2) | 7 (−1.5) | 30 (0.9) | 1 (0.7) | 3 (0.5) | 8 (−1.7) | 30 (0.8) | 0 (0.8) | 90,000 (0.1) | 0 (0.0) | Shopping (0.1) | 2 (0.4) | 12.1 | 12.0 |
| 1187 | 16117 | 153 (−1.4) | 181 (−0.1) | 60 (1.2) | 2 (0.3) | 115 (−1.4) | 199 (−1.4) | 30 (1.2) | 2 (1.1) | 112,500 (0.1) | 0 (0.0) | Leisure (0.0) | 2 (0.2) | 11.8 | 11.6 |
| 1486 | 17187 | 274 (−1.1) | 41 (−1.4) | 30 (1.6) | 1 (0.8) | 233 (−0.9) | 45 (−1.4) | 30 (0.7) | 0 (0.8) | 50,000 (0.1) | 0 (0.1) | Leisure (0.0) | 1 (2.2) | 10.0 | 11.6 |
| 1568 | 17669 | 2 (−1.0) | 2 (−1.7) | 60 (1.0) | 1 (1.9) | 3 (−1.1) | 1 (−1.3) | 60 (0.3) | 1 (0.9) | 70,000 (0.1) | 0 (0.0) | Leisure (0.1) | 2 (0.3) | 12.0 | 11.6 |
Table 8. Observations with the ten highest anomaly scores in the Swiss route dataset. Times are in minutes, costs in CHF, headways in minutes, and income in CHF/year. Variable-specific reconstruction probabilities in brackets; higher values indicate variables that the VAE reconstructs worse, and negative values are possible for continuous variables, whose density can exceed one. KL: Kullback–Leibler divergence between the distribution of the latent representation and its prior. The anomaly score is the sum of the variable-specific terms and the KL term. Values discussed in the text are in bold.
We also summarise the anomaly scores at the individual level in Table 9, which presents the ten individuals with the highest anomaly scores, with the components of their score, the share of their observations flagged with , and the characteristics of their reported trip, around which their observations were pivoted. Unlike the observation-level scores, no individual stands out: the scores of these ten individuals are between 14.1 and 14.9, compared with 10.7 on average. Most of the difference comes from the KL terms of their observations, i.e., their observations can only be encoded in atypical regions of the latent space, whereas their variables are reconstructed reasonably well. Individual 14167 is the exception: none of their observations is flagged, but their random effect is the furthest from the population distribution in the whole sample. For the others, between 22% and 89% of their observations are flagged, compared with 5% on average, and together the ten individuals account for 53 of the 175 flagged observations, whereas 80% of the individuals have no flagged observation at all.
| ID | Purpose | Distance | Time | Cost | Cost/km | Ticket | Rec. prob. | KL () | KL () | Total | Flagged (%) |
| 16117 | Leisure | 215 (96) | 161 (96) | 172 (100) | 0.80 (98) | HF | −1.6 | 11.4 | 5.1 | 14.9 | 67 |
| 12640 | Business | 39 (46) | 38 (48) | 52 (93) | 1.33 (100) | HF | −2.0 | 10.9 | 5.7 | 14.6 | 56 |
| 16184 | Business | 173 (92) | 112 (86) | 74 (98) | 0.43 (87) | HF | −0.7 | 9.0 | 6.2 | 14.5 | 22 |
| 16617 | Leisure | 391 (100) | 296 (100) | 66 (96) | 0.17 (25) | GA | −1.5 | 10.5 | 5.4 | 14.5 | 67 |
| 14167 | Business | 24 (32) | 19 (23) | 9 (46) | 0.38 (80) | HF | −1.7 | 8.0 | 8.2 | 14.4 | 0 |
| 20352 | Leisure | 29 (37) | 16 (18) | 21 (71) | 0.72 (97) | None | −1.3 | 11.1 | 4.7 | 14.4 | 89 |
| 14041 | Shopping | 6 (3) | 28 (36) | 1 (2) | 0.17 (19) | GA | −2.5 | 12.2 | 4.5 | 14.2 | 89 |
| 15704 | Business | 110 (78) | 108 (84) | 9 (46) | 0.08 (1) | GA | −2.5 | 10.0 | 6.6 | 14.2 | 22 |
| 16169 | Shopping | 7 (4) | 7 (3) | 6 (31) | 0.86 (99) | None | −0.7 | 10.1 | 4.7 | 14.1 | 89 |
| 12409 | Leisure | 10 (10) | 8 (5) | 9 (46) | 0.90 (99) | None | −1.1 | 10.9 | 4.3 | 14.1 | 89 |
Table 9. Ten individuals with the highest anomaly scores in the Swiss route dataset, the characteristics of the reported trip on which their observations were pivoted, and the components of their anomaly score: the average over their nine observations of the sum of the reconstruction probabilities and of the KL term of the latent representation, and the KL term of their random effect. The last column is the share of their observations flagged with . Distance in kilometres, time in minutes, cost in CHF. Percentiles across the 388 individuals in brackets. HF: half-fare card, GA: GA travel card.
Most of these individuals reported either very long trips or trips with unusual costs. Individuals 16117, 16184 and 16617 reported trips of 173 to 391 km, at or above the 92nd percentile. Individuals 16169 and 12409 reported short trips, of 7 and 10 km, that are expensive per kilometre (0.86 and 0.90 CHF/km, at the 99th percentile), and individual 12640 reported a cost of 52 CHF for a 39 km business trip (1.33 CHF/km). Individuals 14041 and 15704, on the other hand, own a GA travel card and reported very cheap trips, of 1 CHF for 6 km and 9 CHF for 110 km.
Individual-level anomalies are partly a consequence of the SP design. Each observation is pivoted around the individual’s reported trip, with variable levels set as deviations from it. This makes the observations more realistic, but it
also means that individuals with unusually long, expensive or infrequent trips face variable levels far from the rest of the sample in all of their observations. In addition, SP designs aim for orthogonal variables, no dominant alternatives and enough variation to identify the parameters, which can produce variable levels or combinations that may look extreme at the sample level.
To assess the impact of the flagged observations on CM outputs, we estimate an MNL model on the full sample and re-estimate it after excluding the observations with the highest anomaly scores, i.e., the top 1%, 5% and 10%. The utility of each route is linear in parameters, with generic parameters for travel time, travel cost, headway and number of interchanges. The utility of route 1 also includes alternative-specific constants (ASCs) for car availability and trip purpose, using the variables described in Table 6. From this, we derive the value of travel time (VoTT), the value of headway (VoH), the value of interchanges (VoI), and direct elasticities with respect to travel time, travel cost and headway. We also exclude the same shares of observations flagged by the univariate check and the Mahalanobis distance, computed on the travel times, costs and headways of both routes and on household income. As removing observations will naturally change the parameter estimates, regardless of which observations are removed, we also use a random benchmark. For each subset, we re-estimate the same model after excluding the same number of observations, i.e., 35, 175 and 349, respectively, but selected at random rather than by their anomaly score. We repeat this ten times, each with a different random subset, and report the mean across all runs.
Table 10 presents the results of the estimated models. Excluding the observations flagged by the VAE improves the model fit, with a log-likelihood per observation increasing from −0.475 to −0.470, −0.458 and −0.446 in the 99%, 95% and 90% subsets, whereas the univariate check improves it only to −0.469 in the 90% subset. Since the anomaly score includes the choice, part of this improvement comes from excluding choices that are poorly explained. The time and cost parameters increase in magnitude (Table 16), by 9%, 11% and 18%, and by 12%, 5% and 17%, respectively, and the headway and interchange parameters by up to 10% and 13% in the 90% subset. The time and cost parameters also become more precise despite the smaller sample, with robust t-ratios increasing from −8.96 to −9.97 and from −5.66 to −6.17, respectively, in the 90% subset. The ASCs of the trip purposes remain not significant, whereas the ASC for car availability remains significant.
| Full sample | 99% subset R | 99% subset U | 99% subset M | 99% subset V | 95% subset R | 95% subset U | 95% subset M | 95% subset V | 90% subset R | 90% subset U | 90% subset M | 90% subset V | |
| Values of time (CHF) | |||||||||||||
| Travel time (CHF/min) | 0.45 | 0.45 (−0%) | 0.45 (+1%) | 0.45 (+0%) | 0.44 (−2%) | 0.45 (+0%) | 0.45 (+4%) | 0.47 (+4%) | 0.44 (−3%) | 0.47 (+5%) | 0.45 (+0%) | 0.47 (+4%) | 0.45 (−0%) |
| Headway (CHF/min) | 0.28 | 0.28 (−1%) | 0.29 (+2%) | 0.28 (+0%) | 0.26 (−9%) | 0.28 (−0%) | 0.28 (+1%) | 0.26 (−9%) | 0.29 (+3%) | 0.28 (+0%) | 0.29 (+2%) | 0.26 (−7%) | 0.27 (−6%) |
| Interchanges (CHF/interchange) | 8.67 | 8.62 (−1%) | 8.87 (+2%) | 8.70 (+0%) | 7.85 (−10%) | 8.67 (+0%) | 8.72 (+1%) | 7.96 (−8%) | 8.77 (+1%) | 8.77 (+1%) | 8.74 (+1%) | 8.16 (−6%) | 8.37 (−3%) |
| Elasticities | |||||||||||||
| Travel time | −0.945 | −0.951 (+1%) | −0.932 (−1%) | −0.948 (+0%) | −1.016 (+7%) | −0.951 (+1%) | −0.953 (+1%) | −1.017 (+8%) | −1.004 (+6%) | −0.945 (−0%) | −0.966 (+2%) | −1.036 (+10%) | −1.052 (+11%) |
| Travel cost | −0.785 | −0.791 (+1%) | −0.771 (−2%) | −0.787 (+0%) | −0.864 (+10%) | −0.788 (+0%) | −0.766 (−3%) | −0.864 (+10%) | −0.788 (+0%) | −0.784 (−0%) | −0.781 (−1%) | −0.852 (+8%) | −0.839 (+7%) |
| Headway | −0.366 | −0.365 (−0%) | −0.367 (+0%) | −0.364 (−0%) | −0.367 (+0%) | −0.365 (−0%) | −0.368 (+1%) | −0.362 (−1%) | −0.377 (+3%) | −0.365 (−0%) | −0.376 (+3%) | −0.361 (−1%) | −0.372 (+2%) |
| Goodness of fit | |||||||||||||
| LL(final) per observation | −0.475 | −0.475 | −0.475 | −0.476 | −0.470 | −0.475 | −0.470 | −0.477 | −0.458 | −0.475 | −0.469 | −0.475 | −0.446 |
| 0.314 | 0.315 | 0.315 | 0.313 | 0.322 | 0.314 | 0.322 | 0.312 | 0.339 | 0.315 | 0.324 | 0.314 | 0.356 |
Table 10. Values of time, elasticities and goodness of fit of the MNL model for the Swiss route dataset, for the full sample, after excluding randomly selected observations (R, mean of ten runs), and after excluding the same number of observations with the highest scores of the univariate check (U), the Mahalanobis distance (M) and the VAE (V). Elasticities are computed with a 1% increase in the respective variable. Percentage changes relative to the full sample in brackets. Values discussed in the text are in bold. Parameter estimates are reported in Table 16.
| Full sample | 99% subset R | 99% subset U | 99% subset M | 99% subset V | 95% subset R | 95% subset U | 95% subset M | 95% subset V | 90% subset R | 90% subset U | 90% subset M | 90% subset V | |
| Estimates | |||||||||||||
| (travel time) | −0.060 (−8.96) | −0.061 (−9.00) | −0.059 (−8.86) | −0.060 (−8.94) | −0.065 (−10.95) | −0.060 (−9.00) | −0.063 (−8.82) | −0.063 (−9.68) | −0.066 (−10.30) | −0.060 (−8.65) | −0.064 (−8.60) | −0.064 (−9.57) | −0.071 (−9.97) |
| (travel cost) | −0.133 (−5.66) | −0.134 (−5.69) | −0.131 (−5.59) | −0.132 (−5.65) | −0.149 (−7.15) | −0.133 (−5.74) | −0.135 (−5.34) | −0.144 (−6.86) | −0.140 (−6.28) | −0.133 (−5.59) | −0.136 (−5.28) | −0.143 (−6.43) | −0.156 (−6.17) |
| (headway) | −0.038 (−16.18) | −0.038 (−16.10) | −0.038 (−16.08) | −0.037 (−15.99) | −0.038 (−16.08) | −0.037 (−15.88) | −0.038 (−16.02) | −0.037 (−15.56) | −0.041 (−16.40) | −0.037 (−15.63) | −0.039 (−15.49) | −0.037 (−15.47) | −0.041 (−16.14) |
| (interchanges) | −1.155 (−18.79) | −1.158 (−18.83) | −1.158 (−18.66) | −1.152 (−18.64) | −1.168 (−18.61) | −1.157 (−18.55) | −1.178 (−18.44) | −1.149 (−17.98) | −1.229 (−19.07) | −1.161 (−18.39) | −1.184 (−17.84) | −1.163 (−17.86) | −1.306 (−19.31) |
| ASC car available | −0.246 (−2.54) | −0.247 (−2.54) | −0.238 (−2.45) | −0.250 (−2.57) | −0.235 (−2.40) | −0.238 (−2.41) | −0.235 (−2.37) | −0.252 (−2.58) | −0.220 (−2.18) | −0.246 (−2.45) | −0.229 (−2.26) | −0.220 (−2.17) | −0.255 (−2.34) |
| ASC commute | 0.115 (1.38) | 0.113 (1.35) | 0.107 (1.28) | 0.114 (1.36) | 0.100 (1.20) | 0.113 (1.33) | 0.123 (1.44) | 0.116 (1.37) | 0.079 (0.95) | 0.121 (1.37) | 0.158 (1.81) | 0.097 (1.11) | 0.033 (0.38) |
| ASC shopping | 0.144 (0.99) | 0.142 (0.97) | 0.143 (0.98) | 0.157 (1.08) | 0.162 (1.04) | 0.135 (0.88) | 0.144 (0.97) | 0.224 (1.49) | 0.182 (1.25) | 0.136 (0.87) | 0.119 (0.79) | 0.187 (1.18) | 0.196 (1.35) |
| ASC business | −0.132 (−0.86) | −0.133 (−0.87) | −0.136 (−0.88) | −0.130 (−0.84) | −0.143 (−0.91) | −0.136 (−0.85) | −0.135 (−0.86) | −0.134 (−0.85) | −0.126 (−0.76) | −0.137 (−0.84) | −0.139 (−0.88) | −0.141 (−0.88) | −0.099 (−0.58) |
| ASC leisure | 0.084 (1.14) | 0.087 (1.17) | 0.073 (0.98) | 0.089 (1.21) | 0.076 (1.03) | 0.075 (0.99) | 0.083 (1.06) | 0.110 (1.49) | 0.041 (0.54) | 0.078 (1.01) | 0.053 (0.65) | 0.113 (1.44) | 0.057 (0.69) |
| Goodness of fit | |||||||||||||
| Observations | 3,492 | 3,457 | 3,457 | 3,457 | 3,457 | 3,317 | 3,317 | 3,317 | 3,317 | 3,143 | 3,143 | 3,143 | 3,143 |
| LL(0) | −2,420.47 | −2,396.21 | −2,396.21 | −2,396.21 | −2,396.21 | −2,299.17 | −2,299.17 | −2,299.17 | −2,299.17 | −2,178.56 | −2,178.56 | −2,178.56 | −2,178.56 |
| LL(final) | −1,659.94 | −1,640.86 | −1,642.27 | −1,646.95 | −1,625.75 | −1,567.63 | −1,559.87 | −1,582.88 | −1,519.45 | −1,492.25 | −1,473.31 | −1,494.08 | −1,403.01 |
| Adjusted | 0.310 | 0.311 | 0.311 | 0.309 | 0.318 | 0.310 | 0.318 | 0.308 | 0.335 | 0.311 | 0.320 | 0.310 | 0.325 |
| AIC | 3,337.88 | 3,299.75 | 3,302.54 | 3,311.90 | 3,296.50 | 3,170.25 | 3,173.78 | 3,183.66 | 3,058.89 | 3,005.97 | 2,991.11 | 3,060.54 | 2,842.01 |
| BIC | 3,393.30 | 3,355.05 | 3,358.87 | 3,367.23 | 3,324.84 | 3,225.71 | 3,229.60 | 3,238.62 | 3,111.85 | 3,050.97 | 3,019.11 | 3,060.54 | 2,878.49 |
Table 16. MNL estimates and goodness of fit for the Swiss route dataset, for the full sample, after excluding randomly selected observations (R, mean of ten runs), and after excluding the same number of observations with the highest scores of the univariate check (U), the Mahalanobis distance (M) and the VAE (V). Robust t-ratios in brackets.
As the time and cost parameters change in similar proportions, the values of time change much less than the parameters themselves. Excluding the top 1% reduces VoH and VoI by 9% and 10%, more than in any of the random subsets, while VoTT changes by −2%. When excluding the top 5% and 10%, the value of time change by between −6% and +5%. The elasticities, on the other hand, increase in magnitude: the travel time elasticity by 7%, 6% and 11%, more than in any of the random subsets, and the travel cost elasticity by 10% and 7% when excluding the top 1% and 10%. In comparison, the random subsets change values of time and elasticities by at most 1% on average. The flagged observations therefore mainly affect the scale of the time and cost parameters, and hence the elasticities used in demand forecasting, rather than the trade-offs between time and cost.
The univariate check and the Mahalanobis distance are computed directly on the travel times, costs, and headways, so excluding the observations they flag mainly changes the time and cost parameters, and hence VoTT. Both increase the time parameter by 5% to 7% in the 95% and 90% subsets, while the univariate check slightly changes the cost parameter. As a result, VoTT increases by 4% with the univariate check, whereas VoH and VoI present minor shifts. The Mahalanobis distance also increases the cost parameter, so VoTT changes by −3% and 0%, while VoH and VoI decrease by up to 9%. The values of time obtained after excluding observations with a univariate check or the Mahalanobis distance therefore depend largely on which travel times and costs are considered extreme and therefore rely on the analysts’ criterion. The VAE changes the time and cost parameters more than both methods, but in similar proportions, so its effect on the values of time is of a similar size.
It is also important to clarify that an observation is flagged because its variables are atypical, not necessarily because the choice is poorly explained by the model. Indeed, the anomaly scores and the observation-specific log-likelihood
in the estimated model are weakly correlated (Pearson’s correlation coefficient of ), as observations with the highest anomaly score tend to have a lower log-likelihood. However, 64% of the flagged observations still have a choice probability above 0.5. Since the model is estimated on the full sample (anomalies included) its parameters adjust to these observations, so an observation with atypical variables can still have a reasonably high choice probability. The anomaly score and the model fit therefore measure different things, and should be used together rather than one instead of the other.
For the Swiss route dataset, we present model validation in Appendix § 7. We also test our VAE models across 5 different seeds, where the scores have a Spearman correlation of 0.98, and we report the results of the model trained with the first seed. We next turn to an RP dataset, where observations are shaped by real constraints, such as infrastructure and mode availability, rather than by an experimental design, and where trip characteristics can be more extreme.
Decisions dataset
The Decisions dataset ([12]) is a large-scale survey collected by the Choice Modelling Centre at the University of Leeds. It combines an online background questionnaire with detailed information on individuals’ life histories, social networks, and travel behaviour recorded over a two-week period using a smartphone-based tracking application. The online survey gathered extensive socio-demographic information, travel and vehicle availability, long-term residential and employment histories, and indicators of social interactions, while the smartphone app recorded trips using GPS and prompted individuals to confirm travel modes, purposes, and costs. The variables to be reconstructed are therefore substantially richer and more complex than in the SP setting. This dataset has 12,004 observations for 415 individuals, and considers six alternatives: Car (48.1% of choices), Bus (14.4%), Rail (5.0%), Taxi (3.3%), Bicycle (3.3%), and Walking (26.0%). We summarise variables reconstructed by the VAE in Table 11. Note that in RP data, as some alternatives may not be available for some observations, we include availabilities in our modelling. By preserving the distribution and correlation structure of the data, the VAE learns which variables are not available: when an alternative is not available, its availability and all of its variables, such as travel time and cost, are zero. Thus, these are recovered by the VAE.
| Variable | Type | Description (units) |
| car_travel_time_min | Continuous | Car travel time (minutes). |
| total_car_cost | Continuous | Total cost for a car trip including fuel and operating costs (£). |
| bus_IVT_time_min | Continuous | In-vehicle travel time by bus (minutes). |
| OVT_bus_min | Continuous | Out-of-vehicle time for bus trips (minutes). |
| bus_cost_total_per_leg | Continuous | Cost for a bus trip including a distance-based price of a ticket and a discount for season ticket holders (£). |
| car_distance_km | Continuous | API car distance (kilometres). |
| bus_distance_km | Continuous | API bus distance (kilometres). |
| rail_IVT_time_min | Continuous | In-vehicle travel time by rail (minutes). |
| OVT_rail_min | Continuous | Out-of-vehicle time for rail trips (minutes). |
| rail_cost_total_per_leg | Continuous | Cost for a rail trip including a distance-based price of a ticket and a discount for season ticket holders (£). |
| rail_distance_km | Continuous | Travel distance by rail (kilometres). |
| taxi_travel_time_min | Continuous | Travel time by taxi (minutes). |
| taxi_cost | Continuous | Cost of a taxi trip based on average cost rates from local authorities across the region of Yorkshire and the Humber (£) |
| taxi_distance_km | Continuous | Travel distance by taxi (kilometres). |
| cycling_distance_km | Continuous | Travel distance by bicycle (kilometres). |
| walking_distance_km | Continuous | Travel distance on foot (kilometres). |
| female | Categorical | Gender dummy variable, 1 if female, 0 otherwise. |
| weekday | Categorical | Type of day dummy variable, 1 if weekday, 0 otherwise. |
| occ | Categorical | Occupation of the participant. Various categories. |
| hh_size | Categorical | Number of people living in the household, excluding the participant. |
| purpose_new_2_num | Categorical | Stated trip purpose. Various categories. |
| ampeak | Categorical | Hour of day dummy variable, 1 if morning peak hour, 0 otherwise. |
| pmpeak | Categorical | Hour of day dummy variable, 1 if afternoon peak hour, 0 otherwise. |
| income_cont | Categorical | Total annual income band of the participant’s household. |
| bus_transfers | Categorical | Number of required transfers on a bus trip. |
| rail_transfers | Categorical | Number of required transfers on a rail trip. |
| avail_car | Categorical | Availability of the car alternative, 1 if available, 0 otherwise |
| avail_bus | Categorical | Availability of the bus alternative, 1 if available, 0 otherwise |
| avail_rail | Categorical | Availability of the rail alternative, 1 if available, 0 otherwise |
| avail_taxi | Categorical | Availability of the taxi alternative, 1 if available, 0 otherwise |
| avail_cycling | Categorical | Availability of the cycling alternative, 1 if available, 0 otherwise |
| avail_walking | Categorical | Availability of the walking alternative, 1 if available, 0 otherwise |
| choice | Categorical | Chosen alternative: 1 car, 2 bus, 3 rail, 4 taxi, 5 cycling, 6 walking. |
Table 11. Variables reconstructed by the VAE for the Decisions dataset. Continuous variables are transformed as , as some times and costs are zero, and standardised before training. Categorical variables are one-hot encoded.
We train the VAE on the Decisions data using the configuration selected through the hyperparameter search, shown in Table 12.
| Hyperparameter | Search space | Selected |
| Latent dimension () | 4, 8, 16, 24, 32, 48, 64 | 16 |
| Random-effect dimension () | 2, 4, 8 | 2 |
| Hidden layers | 1, 2, 3, 4 | 2 |
| Hidden layer size | 16, 32, 64, 96, 128, 160, 192, 256 | 96 |
| Learning rate | , , , , | |
| Batch size | 32, 64, 128, 256, 512 | 32 |
| Weight decay | 0, , , , |
Table 12. Hyperparameter search space and selected configuration for the Decisions dataset.
Figure 3 shows the distribution of the anomaly scores for the Decisions dataset. Using the 95th percentile as the threshold (), 600 of the 12,004 observations are flagged as anomalies, while with and , 120 and 1,200 observations are flagged, respectively. As in the Swiss route case, most observations have low scores, but the scores span a much wider range, and the upper tail is substantially longer. Part of this difference comes from the larger sample size (12,004, compared to 3,492) and number of reconstructed variables, but most of it reflects how the data were collected. Unlike SP data, where variable levels are set by the experimental design within predefined ranges, the variables in RP data come from several sources, each of which can introduce errors. Trips are recorded by GPS, which can miss or misplace parts of a trip; modes, purposes and costs are confirmed by the individuals, who can make mistakes when entering them; and the variables of the non-chosen alternatives, such as travel times and distances, are typically obtained from APIs, which can return unrealistic values when no suitable route or service is found. Most observations have variable values within the usual range for their mode and trip length, and are reconstructed well by the VAE. The long tail, on the other hand, contains both unusual trips, such as very long or rare journeys, and observations affected by these errors.

Figure 3. Distribution of anomaly scores for the Decisions dataset. Red dots indicate the 600 observations above the 95th percentile.
We present the ten observations with the highest anomaly scores in Table 13, with their reconstruction probabilities in brackets and their KL terms. Most of them combine times, costs and distances that are not consistent with each other. Three of them, trips 55001, 52302 and 91689, have a bus IVT of 52.1 minutes with a bus fare of £2.1, whereas most such short bus legs cost £1.5 in the data. Trips 56079 and 65096 have car travel times of 18 and 14 minutes for car costs of only £0.8 and £0.6, and trip 57525 is a drop-off trip of 81 km by car, with a car cost of £8.8 and a taxi cost of £47.7. Trip 42616 is a shopping trip, where the API car distance is 13.3 km for a walking distance of only 0.4 km, so that the car distance, the car cost and the taxi cost (£10.5) are all poorly reconstructed. Trip 66481 has a rail OVT of only 4 minutes for a rail IVT of 38 minutes. In the other two observations, the choice itself is unusual: in trip 54982, the individual chose a bus trip of 61 minutes over a rail trip of 48 minutes at the same fare, and in trip 41060, the individual chose a taxi for a 6 km leisure trip, with the highest KL term among the ten.
| Trip | User | Purpose | Day | Car TT | Car Cost | Bus IVT | Bus OVT | Bus Transf. | Bus Cost | Rail IVT | Rail OVT | Rail Transf. | Rail Cost | Taxi Cost | Cycle Dist. | Walk Dist. | Choice | Largest other term | KL | Anomaly score |
| 57525 | 1872 | Drop-off (3.3) | Saturday (1.6) | 56 (2.3) | 8.8 (7.8) | 142 (3.1) | 31 (0.8) | 1 (0.6) | 5.7 (1.0) | – | – | – | – | 47.7 (8.0) | – | – | Car (0.0) | Car dist. (7.0) | 8.9 | 50.955001 |
| 55001 | 1779 | Home (1.1) | Wednesday (0.2) | – | – | 1 (1.5) | 4 (0.6) | 0 (0.0) | 2.1 (30.7) | – | – | – | – | 6.7 (4.4) | – | 0.5 (1.5) | Walking (0.0) | Income (0.7) | 3.3 | 45.152302 |
| 52302 | 1618 | Shopping (1.5) | Friday (0.3) | – | – | 1 (1.4) | 6 (0.3) | 0 (0.0) | 2.1 (31.1) | – | – | – | – | 5.9 (2.5) | – | 0.6 (0.7) | Walking (0.0) | PM peak (0.9) | 3.2 | 43.042616 |
| 42616 | 1511 | Shopping (0.6) | Saturday (0.6) | 13 (4.2) | 1.5 (7.3) | – | – | – | – | – | – | – | – | 10.5 (9.2) | – | 0.4 (2.1) | Car (0.0) | Car dist. (8.8) | 6.8 | 40.991689 |
| 51689 | 2167 | Home (1.3) | Saturday (1.6) | – | – | 1 (2.1) | 5 (0.6) | 0 (0.0) | 2.1 (23.8) | – | – | – | – | – | – | 0.7 (0.6) | Walking (0.0) | Bus dist. (1.8) | 3.1 | 35.556079 |
| 56079 | 1696 | Other (1.9) | Thursday (0.2) | 18 (15.0) | 0.8 (4.6) | 9 (0.2) | 7 (0.6) | 0 (0.0) | 1.5 (−1.5) | – | – | – | – | 6.3 (4.8) | 2.3 (−0.4) | 2.1 (0.2) | Car (0.1) | PM peak (3.1) | 5.5 | 34.166481 |
| 56481 | 1925 | Work (1.2) | Friday (0.2) | – | – | 31 (0.5) | 9 (0.8) | 0 (0.1) | 3.4 (0.6) | 38 (4.2) | 4 (11.7) | 1 (0.4) | 17.0 (1.7) | 12.0 (−0.1) | 14.4 (0.0) | – | Rail (0.4) | Rail dist. (5.4) | 3.9 | 31.154982 |
| 64982 | 1783 | Home (0.1) | Wednesday (0.0) | – | – | 61 (0.0) | 22 (0.9) | 1 (0.1) | 2.1 (1.0) | 48 (3.8) | 24 (0.7) | 0 (1.8) | 2.1 (1.2) | 33.7 (2.5) | – | – | Bus (4.4) | Rail dist. (7.2) | 4.7 | 30.741060 |
| 41060 | 1527 | Leisure (2.2) | Thursday (0.1) | 15 (0.4) | 3.4 (1.2) | 24 (0.0) | 11 (0.3) | 1 (0.0) | 4.6 (−0.9) | 9 (0.1) | 28 (0.1) | 0 (0.1) | 2.9 (5.5) | 7.0 (0.6) | – | – | Taxi (3.5) | Rail dist. (4.4) | 11.1 | 30.765096 |
| 65096 | 1737 | Leisure (1.1) | Thursday (0.3) | 14 (8.0) | 0.6 (5.1) | 7 (−0.1) | 10 (0.7) | 0 (0.0) | 1.5 (−1.7) | – | – | – | – | 6.4 (8.2) | 2.1 (−0.5) | 1.9 (0.0) | Car (0.0) | Car dist. (4.7) | 4.8 | 30.5 |
Table 13. Observations with the ten highest anomaly scores in the Decisions dataset. Times in minutes, costs in £, distances in kilometres; transf.: number of interchanges; –: alternative not available, so its variables are not reconstructed. Variable-specific reconstruction probabilities in brackets; for purpose and day, the terms of the trip purpose and of the weekday dummy. Largest other term: largest term among the variables not shown (API distances of car, bus and rail, gender, peak-hour dummies, household size and income). KL: Kullback–Leibler divergence between the distribution of the latent representation and its prior. The anomaly score is the sum of the terms of all variables and the KL term. Values discussed in the text are in bold.
The trips with very long public transport OVTs are also flagged, mainly through their KL terms, which are among the highest in the sample. Trips 94456, 58672, 59672, 61048 and 54414, with OVTs of between 167 and 424 minutes for both bus and rail, and trips 57990 and 84070, with rail OVTs of 716 and 370 minutes, are encoded to an atypical region of the latent space, so that their OVTs are reconstructed reasonably well given this representation. Trips 59672 and 61048 are the same work trip made by the same individual on a Sunday and a Monday, with almost identical OVTs on both days.
We also report the ten individuals with the highest anomaly scores in Table 14, with the components of their score, their socio-demographic characteristics and typical trips, and the share of their trips flagged with . Unlike in the Swiss route case, where all observations of an individual were built around the same reported trip, each individual in the Decisions dataset makes different trips, so a high score can be driven either by unusual trips or by unusual random effects. For these individuals, it is mostly the former. Their scores are between 18.3 and 20.1, compared with 12.7 on average, and all of them are among the 27 individuals with the highest average trip score. Between 5% and 47% of their trips are flagged, compared with 5% on average, and together they account for 60 of the 600 flagged trips, whereas 43% of the individuals have no flagged trip at all. Most of these individuals make long trips, as seven of them have a mean trip distance above 15 km, compared with a sample average of 8.2 km, and two of them, individuals 1783 and 2167, also made trips in Table 13.
| User | Trips | Age | Gender | Income | Main purpose | Main mode | Mean distance | Rec. prob. | KL () | KL () | Total | Flagged (%) |
| 1783 | 13 | 18–24 | M | 35,000 | Work (38%) | Walking (46%) | 25.5 | 9.7 | 4.1 | 6.3 | 20.1 | 38 |
| 1832 | 33 | 18–24 | F | 15,000 | Home (36%) | Bus (48%) | 22.0 | 8.8 | 5.2 | 5.7 | 19.8 | 42 |
| 1793 | 15 | 40–49 | F | 15,000 | Work (53%) | Taxi (60%) | 18.8 | 8.8 | 5.9 | 4.4 | 19.1 | 47 |
| 1487 | 11 | 40–49 | F | 45,000 | Leisure (55%) | Car (55%) | 18.1 | 8.3 | 5.8 | 5.0 | 19.1 | 36 |
| 2043 | 77 | 40–49 | F | 35,000 | Work (42%) | Car (94%) | 11.0 | 7.1 | 5.1 | 6.8 | 19.0 | 12 |
| 2168 | 28 | 18–24 | F | 5,000 | Exercise (25%) | Rail (46%) | 15.8 | 7.9 | 4.9 | 6.1 | 18.9 | 29 |
| 1668 | 15 | 40–49 | M | 62,500 | Work (47%) | Rail (53%) | 33.5 | 7.4 | 5.3 | 5.9 | 18.6 | 27 |
| 1638 | 19 | 30–39 | M | 25,000 | Work (32%) | Bus (47%) | 7.2 | 8.1 | 4.8 | 5.6 | 18.5 | 37 |
| 2167 | 15 | 18–24 | F | 5,000 | Home (40%) | Bus (53%) | 2.3 | 6.3 | 4.8 | 7.5 | 18.5 | 7 |
| 1637 | 19 | 30–39 | M | 45,000 | Other (37%) | Car (58%) | 20.0 | 6.4 | 5.6 | 6.4 | 18.3 | 5 |
Table 14. Ten individuals with the highest anomaly scores in the Decisions dataset, with their socio-demographic characteristics and typical trips, and the components of their anomaly score: the average over their trips of the sum of the reconstruction probabilities and of the KL term of the latent representation, and the KL term of their random effect. The last column is the share of their trips flagged with . Income in £/year, distance in kilometres.
We repeat the sensitivity analysis conducted for the Swiss route dataset. An MNL model is estimated on the full sample and after excluding the top 1%, 5% and 10% of observations by anomaly score, and the results are compared with the mean of ten models, each estimated after excluding the same number of randomly selected observations. We also exclude the same shares of observations flagged by the univariate check and the Mahalanobis distance. As in the Swiss route case, excluding observations with extreme times or costs changes the parameters of these variables by construction, so the random removal remains the benchmark to assess whether the flagged observations themselves influence the estimates. The utility specification is based on Tsoleridis et al. [65], and we present this in subsection B.2. We report values of in-vehicle time (VoIVT), out-of-vehicle time (VoOVT) and travel time (VoTT) by mode, as well as elasticities with respect to these variables and to travel cost. The results are shown in Table 15.
| Full sample | 99% subset R | 99% subset U | 99% subset M | 99% subset V | 95% subset R | 95% subset U | 95% subset M | 95% subset V | 90% subset R | 90% subset U | 90% subset M | 90% subset V | |
| Values of time (£/hour) | |||||||||||||
| Car travel time | 38.8 | 38.9 (+0%) | 37.1 (−4%) | 37.5 (−3%) | 37.5 (−3%) | 38.8 (+0%) | 38.7 (−0%) | 39.6 (+2%) | 35.4 (−9%) | 38.7 (−0%) | 34.9 (−10%) | 38.0 (−2%) | 28.9 (−26%) |
| Bus IVT | 14.2 | 14.3 (+0%) | 14.8 (+4%) | 14.1 (−1%) | 14.8 (+4%) | 14.3 (+0%) | 14.9 (+5%) | 15.9 (+12%) | 15.6 (+9%) | 14.3 (+0%) | 14.0 (−2%) | 14.9 (+5%) | 15.0 (+6%) |
| Bus OVT | 39.2 | 39.2 (−0%) | 50.5 (+29%) | 42.0 (+7%) | 49.8 (+27%) | 39.2 (−0%) | 47.2 (+20%) | 54.1 (+38%) | 46.8 (+19%) | 38.8 (−1%) | 42.9 (+9%) | 50.0 (+27%) | 44.5 (+14%) |
| Rail IVT | 14.3 | 14.4 (+0%) | 13.5 (−6%) | 14.1 (−2%) | 13.0 (−10%) | 14.6 (+2%) | 14.4 (+1%) | 16.2 (+13%) | 10.8 (−25%) | 14.6 (+2%) | 13.5 (−5%) | 14.2 (−1%) | 6.6 (−54%) |
| Rail OVT | 36.3 | 36.4 (+0%) | 36.0 (−1%) | 35.5 (−2%) | 32.4 (−11%) | 36.5 (+1%) | 35.3 (−3%) | 35.2 (−3%) | 30.5 (−16%) | 35.9 (−1%) | 32.6 (−10%) | 34.1 (−6%) | 29.3 (−19%) |
| Taxi travel time | 30.9 | 31.0 (+0%) | 31.7 (+3%) | 37.2 (+20%) | 31.4 (+1%) | 30.7 (−1%) | 31.4 (+2%) | 39.8 (+29%) | 44.3 (+43%) | 29.8 (−4%) | 31.4 (+1%) | 37.5 (+21%) | 41.5 (+34%) |
| Elasticities | |||||||||||||
| Car travel time | −0.143 | −0.143 (+0%) | −0.145 (+1%) | −0.141 (−1%) | −0.149 (+5%) | −0.143 (+0%) | −0.154 (+8%) | −0.143 (+0%) | −0.134 (−6%) | −0.143 (+0%) | −0.148 (+3%) | −0.137 (−4%) | −0.103 (−28%) |
| Car cost | −0.027 | −0.027 (−0%) | −0.029 (+6%) | −0.028 (+2%) | −0.030 (+9%) | −0.027 (+0%) | −0.028 (+4%) | −0.026 (−5%) | −0.029 (+5%) | −0.027 (+0%) | −0.029 (+9%) | −0.025 (−9%) | −0.027 (−1%) |
| Bus IVT | −0.400 | −0.400 (+0%) | −0.430 (+8%) | −0.408 (+2%) | −0.437 (+9%) | −0.403 (+1%) | −0.457 (+14%) | −0.438 (+9%) | −0.467 (+17%) | −0.401 (+0%) | −0.469 (+17%) | −0.419 (+5%) | −0.449 (+12%) |
| Bus OVT | −0.541 | −0.539 (−0%) | −0.704 (+30%) | −0.590 (+9%) | −0.707 (+31%) | −0.542 (+0%) | −0.702 (+30%) | −0.712 (+32%) | −0.704 (+30%) | −0.535 (−1%) | −0.712 (+32%) | −0.695 (+28%) | −0.710 (+31%) |
| Bus cost | −0.159 | −0.159 (−0%) | −0.168 (+5%) | −0.165 (+3%) | −0.171 (+7%) | −0.160 (+0%) | −0.178 (+12%) | −0.160 (+0%) | −0.182 (+14%) | −0.159 (−0%) | −0.198 (+24%) | −0.167 (+5%) | −0.194 (+21%) |
| Rail IVT | −0.308 | −0.307 (−0%) | −0.306 (−1%) | −0.306 (−1%) | −0.340 (+10%) | −0.308 (+0%) | −0.364 (+18%) | −0.340 (+10%) | −0.340 (+10%) | −0.316 (+3%) | −0.340 (+10%) | −0.340 (+10%) | −0.340 (+10%) |
| Rail OVT | −0.068 | −0.067 (−0%) | −0.068 (+1%) | −0.067 (−0%) | −0.080 (+18%) | −0.065 (−4%) | −0.065 (−4%) | −0.079 (+16%) | −0.067 (−1%) | −0.065 (−4%) | −0.066 (−3%) | −0.071 (+4%) | −0.066 (−3%) |
| Rail cost | −0.389 | −0.389 (−0%) | −0.377 (−3%) | −0.383 (−2%) | −0.372 (+5%) | −0.389 (+0%) | −0.378 (+3%) | −0.372 (+5%) | −0.355 (+9%) | −0.390 (+0%) | −0.376 (+3%) | −0.364 (+6%) | −0.383 (+2%) |
| Taxi travel time | −0.839 | −0.840 (+0%) | −0.941 (+12%) | −0.990 (+18%) | −0.978 (+17%) | −0.836 (−0%) | −0.926 (+10%) | −1.053 (+26%) | −1.027 (+22%) | −0.841 (+0%) | −0.985 (+17%) | −1.037 (+24%) | −1.286 (+53%) |
| Taxi cost | −0.915 | −0.914 (−0%) | −0.974 (+6%) | −0.909 (−1%) | −0.994 (+9%) | −0.920 (+1%) | −0.992 (+8%) | −0.906 (−1%) | −1.000 (+9%) | −0.920 (+1%) | −1.063 (+16%) | −0.946 (+3%) | −1.081 (+18%) |
| Goodness of fit | |||||||||||||
| 0.389 | 0.390 | 0.377 | 0.383 | 0.372 | 0.389 | 0.378 | 0.372 | 0.355 | 0.390 | 0.376 | 0.364 | 0.383 | |
| (final) per observation | 0.675 | 0.675 | 0.685 | 0.680 | 0.689 | 0.675 | 0.685 | 0.688 | 0.701 | 0.674 | 0.686 | 0.692 | 0.713 |
Table 15. Values of time, direct elasticities and goodness of fit of the MNL model for the Decisions dataset, for the full sample, after excluding randomly selected observations (R, mean of ten runs), and after excluding the same number of observations with the highest scores of the univariate check (U), the Mahalanobis distance (M) and the VAE (V). Elasticities are computed with a 1% increase in the respective variable. Percentage changes relative to the full sample in brackets. Values discussed in the text are in bold. Parameter estimates are reported in Table 17.
As in the Swiss route case, model fit improves when the flagged observations are excluded, with the log-likelihood per observation increasing from −0.389 to −0.372, −0.355 and −0.339 in the 99%, 95% and 90% subsets, and from 0.675 to 0.713, whereas the random subsets leave it unchanged. The largest change in the estimates is for bus OVT (Table 17). In the full sample, its parameter is −0.116 with a robust t-ratio of −3.33, whereas excluding only the top 1% of observations changes it to −0.171 (−12.45), and excluding the top 10% to −0.193 (−12.90). The very long OVTs therefore not only bias this parameter but also inflate its standard error. Most other parameters also increase in magnitude as more observations are excluded, by up to 96% for taxi travel time, 55% for bus IVT, 46% for cost and 31% for cycling distance when excluding the top 10%. The rail IVT parameter, on the other hand, decreases in magnitude, by 32%, and is no longer significant when excluding the top 10%.
| Full sample | 99% subset | 95% subset | 90% subset | |||||||||||||
| R | R | U | M | V | R | U | M | V | R | U | M | V | ||||
| Time, distance and cost parameters | ||||||||||||||||
| Car travel time | −0.115 (−7.81) | −0.115 (−7.83) | −0.123 (−8.72) | −0.119 (−7.58) | −0.129 (−9.16) | −0.116 (−7.71) | −0.133 (−9.10) | −0.129 (−8.65) | −0.136 (−8.25) | −0.115 (−7.65) | −0.133 (−8.86) | −0.135 (−8.28) | −0.125 (−6.20) | |||
| Bus IVT | −0.042 (−5.77) | −0.042 (−5.76) | −0.049 (−7.05) | −0.045 (−6.01) | −0.051 (−7.17) | −0.043 (−5.74) | −0.051 (−7.07) | −0.052 (−7.04) | −0.060 (−7.38) | −0.042 (−5.67) | −0.053 (−7.36) | −0.053 (−6.51) | −0.065 (−6.78) | |||
| Bus OVT | −0.116 (−3.33) | −0.116 (−3.30) | −0.167 (−12.57) | −0.133 (−3.87) | −0.171 (−12.45) | −0.117 (−3.25) | −0.162 (−12.00) | −0.176 (−13.07) | −0.180 (−12.40) | −0.115 (−3.19) | −0.164 (−11.77) | −0.177 (−13.00) | −0.193 (−12.90) | |||
| Rail IVT | −0.043 (−2.35) | −0.043 (−2.35) | −0.045 (−2.49) | −0.044 (−2.33) | −0.045 (−2.50) | −0.044 (−2.36) | −0.049 (−2.59) | −0.053 (−2.83) | −0.042 (−2.01) | −0.043 (−2.34) | −0.052 (−2.71) | −0.050 (−2.17) | −0.029 (−1.14) | |||
| Rail OVT | −0.108 (−7.05) | −0.108 (−7.04) | −0.119 (−7.73) | −0.112 (−7.04) | −0.111 (−7.38) | −0.109 (−7.02) | −0.121 (−7.33) | −0.115 (−7.15) | −0.117 (−7.05) | −0.107 (−6.81) | −0.125 (−7.32) | −0.121 (−7.25) | −0.127 (−6.56) | |||
| Taxi travel time | −0.092 (−2.84) | −0.092 (−2.83) | −0.105 (−3.04) | −0.117 (−3.68) | −0.108 (−3.09) | −0.091 (−2.80) | −0.108 (−2.86) | −0.130 (−4.09) | −0.171 (−5.26) | −0.089 (−2.74) | −0.120 (−3.58) | −0.133 (−4.29) | −0.180 (−5.20) | |||
| Cycling distance | −0.226 (−5.30) | −0.226 (−5.30) | −0.247 (−5.89) | −0.236 (−5.42) | −0.260 (−6.14) | −0.227 (−5.29) | −0.252 (−5.97) | −0.252 (−5.68) | −0.303 (−6.53) | −0.229 (−5.27) | −0.257 (−5.77) | −0.253 (−5.51) | −0.297 (−5.87) | |||
| Walking distance | −1.862 (−9.35) | −1.865 (−9.37) | −1.952 (−10.06) | −1.880 (−9.44) | −1.943 (−10.11) | −1.839 (−9.10) | −1.940 (−9.70) | −2.033 (−11.17) | −1.985 (−10.09) | −1.845 (−9.05) | −1.979 (−9.34) | −2.048 (−11.29) | −2.037 (−10.19) | |||
| Cost | −0.178 (−6.23) | −0.178 (−6.21) | −0.199 (−6.75) | −0.189 (−6.53) | −0.206 (−6.95) | −0.179 (−6.17) | −0.205 (−6.50) | −0.195 (−6.01) | −0.231 (−6.75) | −0.178 (−6.10) | −0.229 (−6.73) | −0.212 (−5.86) | −0.246 (−6.95) | |||
| Alternative-specific constants | ||||||||||||||||
| ASC | −2.723 (−6.37) | −2.714 (−6.26) | −2.595 (−6.27) | −2.287 (−6.63) | −2.272 (−6.90) | −2.741 (−6.85) | −2.341 (−6.85) | −2.595 (−6.27) | −2.272 (−6.90) | −2.732 (−6.92) | −2.362 (−6.92) | −2.399 (−7.10) | −2.100 (−5.58) | |||
| ASC | −0.347 (−1.68) | −0.354 (−1.66) | −0.360 (−1.69) | −0.456 (−1.03) | −0.523 (−1.96) | −0.354 (−1.21) | −0.261 (−1.05) | −0.439 (−1.03) | −0.672 (−2.45) | −0.460 (−1.09) | −0.428 (−1.10) | −0.493 (−1.06) | −0.672 (−2.45) | |||
| ASC | 0.676 (2.99) | 0.653 (2.87) | 0.672 (2.96) | 0.661 (2.80) | 0.523 (1.96) | 0.675 (2.89) | 0.628 (2.83) | 0.672 (2.96) | 0.523 (2.83) | 0.672 (2.96) | 0.628 (2.83) | 0.672 (2.96) | 0.676 (2.45) | |||
| ASC | 0.228 (0.62) | 0.283 (0.78) | 0.118 (0.30) | 0.106 (0.64) | 0.528 (2.04) | 0.283 (0.58) | 0.214 (0.66) | 0.118 (0.30) | 0.528 (2.04) | 0.164 (0.54) | 0.209 (0.61) | 0.166 (0.52) | 0.537 (2.03) | |||
| ASC | 0.198 (0.79) | 0.204 (0.82) | 0.439 (1.51) | 0.429 (1.44) | 0.560 (2.04) | 0.204 (0.82) | 0.528 (1.80) | 0.439 (1.51) | 0.560 (2.04) | 0.528 (1.80) | 0.439 (1.51) | 0.528 (1.80) | 0.560 (2.04) | |||
| ASC | −0.738 (−2.80) | −0.736 (−2.78) | −0.770 (−2.94) | −0.873 (−3.30) | −0.873 (−3.30) | −0.996 (−3.72) | −0.912 (−3.26) | −0.996 (−3.72) | −0.873 (−3.30) | −0.880 (−3.08) | −0.842 (−3.18) | −0.842 (−3.18) | −0.873 (−3.05) | |||
| Observations of fit | 12,084 | 11,404 | 11,884 | 10,804 | 10,804 | 11,404 | 11,884 | 10,804 | 10,804 | 10,804 | 10,804 | 10,804 | 10,804 | |||
| −14,347.77 | −13,659.11 | −13,696.90 | −12,968.62 | −12,618.54 | −13,659.11 | −13,696.90 | −12,968.62 | −12,618.54 | −12,868.54 | −12,? | −? | −? | ||||
| AIC | 9,984.54 | 9,917.72 | 9,929.79 | 9,? | 7,? | 7,? | 7,? | 7,? | 7,? | 7,? | 7,? | 7,? | 7,? | |||
| BIC | 9,803.11 | 9,? | 9,? | 8,? | 7,? | 7,? | 7,? | 7,? | 7,? | 7,? | 7,? | 7,? | 7,? |
Table 17. MNL estimates and goodness of fit for the Decisions dataset (Equation (17) and Equation (18)), for the full sample, after excluding the same number of observations with the highest scores of the univariate check (U), the Mahalanobis distance (M) and the VAE (V). Car is the reference alternative. In the 90% subset of the univariate check, the short-trip shift of rail is fixed at zero (–), as only one short trip with rail available remains. Robust t-ratios in brackets.
The random subsets, used as a baseline, also change values of time and elasticities by at most 4% on average. When the flagged observations are excluded, the changes are larger and differ across modes and variables. The value of bus OVT increases by 27%, 19% and 14% in the three subsets, as its parameter increases more than the cost parameter, and the value of taxi travel time by 43% and 34% when excluding the top 5% and 10%. When excluding the top 10%, the cost parameter increases more than the car travel time, rail IVT and rail OVT parameters, so the value of car travel time decreases by 26%, rail IVT by 54% and rail OVT by 19%. The elasticities follow a similar pattern. The bus OVT elasticity increases by 31%, 30% and 31% in the three subsets, the taxi travel time elasticity by up to 53%, and the bus and taxi cost elasticities by up to 21% and 18%, whereas the rail IVT and car travel time elasticities decrease by 55% and 28% when excluding the top 10%. The flagged observations therefore do not affect all parameters equally, but mainly those related to public transport times and fares, and to taxi travel time.
The univariate check and the Mahalanobis distance also flag the trips with very long OVTs, so excluding them increases the bus OVT parameter by 39% to 52% in the 95% and 90% subsets, compared with 55% and 66% for the VAE. As they act directly on the times, costs and distances, their effect on the values of time depends on which values they consider extreme. The univariate check mainly increases the value of bus OVT, by up to 29%, and changes the other values of time by at most 10%, whereas the Mahalanobis distance increases the values of bus OVT and taxi travel time by up to 38% and 29%, respectively. Unlike these two methods, the VAE also reduces the values of rail IVT and car travel time, by up to 54% and 26%.
Finally, for the Decisions dataset, we present model validation in Appendix § 7. We also test our VAE models across 5 different seeds, where the scores have a Spearman correlation of 0.95, and we report the results of the model trained with the first seed.
Conclusions and next steps
This paper introduces the use of VAEs for anomaly detection in CM datasets. We extend the VAE to panel data through individual-specific random effects, and propose an anomaly score based on variable-specific reconstruction probabilities and the KL term, which accounts for the correlations between variables and shows which variables make an observation anomalous. The synthetic case study shows that our approach flags not only observations in the tails of each variable’s distribution, but also observations whose variables are individually plausible but inconsistent when evaluated jointly. We benchmark the VAE against two traditional methods, a univariate check and the Mahalanobis
distance, while also considering random removals. When the anomalies are known, the VAE with mixed effects detects a larger share of them, 48% of the induced anomalies with the top 5%, compared with 20% and 29%, while flagging far fewer normal observations. With the top 10%, it also detects most of the trip type errors and individual inconsistent observations (66% and 70%), which are not extreme in any single variable, compared with at most 16% for the traditional methods, and it brings the value of travel time closest to its true value. The two real-world case studies, an SP and an RP dataset, show that the flagged observations have different origins depending on how the data were collected, and that they have a substantial effect on key CM outputs.
While it is widely recognised in the literature that observations with unusual choice behaviour can affect parameter estimates and forecasting applications, we show that this is also the case for observations with unusual variable configurations, which existing diagnostics only identify when the type of anomaly is defined in advance. Removing even a very small share of these observations leads to substantial changes in values of time and elasticities. In the Swiss route dataset, excluding only the 1% of observations with the highest scores reduces the values of headway and interchanges by 9% and 10%, and increases the travel time and cost elasticities by 7% and 10%, whereas excluding the top 10% increases the time and cost parameters by 18% and 17%. In the Decisions dataset, excluding the top 1% increases the value of bus OVT by 27% and the corresponding elasticity by 31%, as the very long OVTs in the data mainly affect this parameter, with changes of up to 54% in values of time and 55% in elasticities as more observations are excluded, the largest for rail IVT.
The appropriate treatment of anomalies depends heavily on the case study and on the nature of the anomalous observations, which may range from data errors to inconsistent responses. Thus, these results do not imply that the proposed approach should be used as a mechanical procedure for removing outliers. Instead, our findings illustrate how anomaly detection can serve as a diagnostic tool to flag atypical observations or individuals. The proposed framework offers an effective way to identify such cases in large, high-dimensional datasets, not only in transport applications, but also in other domains where complex behavioural or observational data are common, including healthcare, marketing, and finance.
Our results and our framework depend on the share of anomalous observations in the data. As the VAE learns the distribution of the data without knowing which observations are anomalous, it works best when anomalies are rare and differ from each other, so that they cannot be learned as part of the underlying data-generating process. If anomalies were, in contrast, a large share of the sample, the model would learn them and reconstruct them well, giving them low anomaly scores.
Moreover, some techniques for addressing class imbalance—i.e., when the choices for one or more alternatives are severely under-represented—suggest balancing the data. We advise caution in applying these techniques. In particular, if anomalous observations are present in the original data, such procedures may replicate or amplify noise, inconsistencies, or measurement errors, thereby decreasing model performance and reliability. Therefore, we recommend that practitioners first identify and critically assess anomalous observations prior to any rebalancing, so that any data augmentation is based on consistent and representative data.
Regarding next steps, a line of research suggests using the anomaly scores to help identify where the model needs to account for heterogeneity. If flagged observations or individuals share common characteristics, such as the short reported trips with high costs per kilometre in the Swiss route data, this suggests segments with different sensitivities, which could then be captured, for instance, through a latent class choice model ([29, 58]). This way, AD can serve as a diagnostic tool to motivate richer behavioural specifications rather than a purely data cleaning procedure. Furthermore, ongoing work is extending this framework with conditional VAEs, i.e., learning the distribution of variable configurations conditional on contextual variables or choices ([51]). Ultimately, generative ML can be used to produce synthetic data that reflect the underlying behavioural patterns learned from the training data ([8]).
This work is not exempt from limitations. Some of them relate to the VAE itself. As with other neural networks, its
results can be sensitive to the choice of hyperparameters (Ding et al., [21]), in particular the size of the latent space, which determines how well both normal and anomalous observations are reconstructed. We select them through a random search and check that the model reproduces the distributions and correlations in the data, but a different configuration could rank observations differently, especially those close to the threshold. Moreover, the decoder may learn to ignore the latent space (i.e., posterior collapse), which we avoid by checking that the KL terms do not approach zero.
Furthermore, variables with ordered levels, such as income bands, household size and the number of interchanges, are reconstructed as categorical, so the decoder treats their levels as unrelated categories, thus ignoring hierarchies. With few such variables and few levels per variable, as in our datasets, this has little effect on modelling and the scores themselves, but datasets with more ordinal variables, or with more levels per variable, would require likelihoods that respect their order, such as the ordered logit models commonly used in CM.
Finally, there are limits to what the anomaly score can detect. Although the choice is one of the reconstructed variables, it is only one among many, so the framework mainly detects atypical variable configurations rather than behavioural anomalies, and should be used alongside, not instead of, the usual behavioural diagnostics. The VAE also learns what is ‘normal’ from the data itself, so if the sample is not representative, for example due to strong selection bias, the flagged observations will reflect that. Given the lack of a standardised definition of anomaly in CM, the flagged observations cannot be checked against known anomalies in real-world settings, and the share of observations to inspect, set here through the threshold , remains a modelling decision. It is therefore up to the analyst to decide whether flagged observations are data errors or genuine but unusual trips.
Acknowledgments
The authors acknowledge the financial support by the European Research Council through the advanced grant 101020940-SYNERGY.
Model validation
We plot the evolution of the VAE loss components for the synthetic case study in Figure 4, for the Swiss route dataset in Figure 5, and for the Decisions dataset in Figure 6. These figures show that all the losses stabilise after a reasonable number of epochs, indicating convergence. Importantly, the KL divergence does not collapse to zero, and the reconstruction and KL terms contribute jointly to the objective. This confirms that the latent space is being actively used and that the model is not collapsing into a standard autoencoder that ignores the latent structure.

Figure 4. (a) By component (KL and reconstruction loss). (b) Training and validation loss. Loss functions for the synthetic dataset.

Figure 5. (a) By component (KL and reconstruction loss). (b) Training and validation loss. Loss functions for the Swiss route dataset.

Figure 6. (a) By component (KL and reconstruction loss). (b) Training and validation loss. Figure 6: Loss functions for the Decisions dataset.
We also compare the empirical distributions of the reconstructed variables with those of the original data. Figure 7 and Figure 9 show the histograms for the categorical variables, while Figure 8 and Figure 10 display the corresponding plots for the continuous variables. In all cases, the reconstructed data closely match the real distributions, both visually through the overlap of the histograms and quantitatively through the distributional indicators discussed in § 2. For categorical variables, TV and JSD remain close to zero, indicating that the VAE reproductions have minimal differences with the original data. For continuous variables, the W and KS are also small, showing that both the shape and the values of the reconstructed distributions align well with the empirical data. These results show that the VAE is able to reproduce the marginal structure of the data with a high degree of accuracy.

Figure 7. Histogram comparison of real and reconstructed categorical variables, Swiss route dataset.

Figure 8. Histogram comparison of real and reconstructed continuous variables, Swiss route dataset.

Figure 9. Histogram comparison of real and reconstructed categorical variables, Decisions dataset.

Figure 10. Histogram comparison of real and reconstructed continuous variables, Decisions dataset.
We also check for the dependence structure between reconstructed variables. For categorical variables, Figure 11 and Figure 13 present the corresponding matrices based on Cramér’s V, where the reconstructed data closely mirrors the dependence structure observed in the original datasets, with only minor deviations. For continuous variables,

Figure 11. Correlation matrices for categorical variables, Swiss route dataset.

Figure 13. Correlation matrices for categorical variables, Decisions dataset.
Figure 12 and Figure 14 report the Pearson correlation matrices for the original observations and their respective reconstructions, along with their element-wise absolute difference. The high degree of similarity between the two matrices indicates that the VAE successfully retains the monotonic associations between variables, for both datasets.

Figure 12. Correlation matrices for continuous variables, Swiss route dataset.

Figure 14. Correlation matrices for continuous variables, Decisions dataset.
Complementary results
Swissroute dataset
We present the parameter estimates and goodness of fit of the Swiss route dataset (subsection 4.1) in Table 16.
Decisions dataset
We estimate an MNL model in which individual chooses, for each observation , between up to six modes: car, bus, rail, taxi, cycling and walking. The utilities are
where is the travel time (minutes), and are the in-vehicle and out-of-vehicle times (minutes), with out-of-vehicle time including access, egress and waiting time, is the travel cost (£), and is the travel distance (km). The cost parameter is generic across modes, while the time and distance parameters are mode-specific.
The terms shift the ASC of each alternative according to the characteristics of the individual and the trip:
where and are dummy variables for male individuals and students, , and are dummy variables for weekend, business and commuting trips, and are dummy variables for trips in the morning and afternoon peaks, and is a dummy variable for short trips.
Table 17 reports the parameter estimates, alternative-specific constants and their shifts from the sensitivity analysis in subsection 4.2, together with goodness of fit.
References
- [1]Ahmed, M., Mahmood, A. N., & Islam, M. R. (2016). A survey of anomaly detection techniques in financial domain. Future Generation Computer Systems, 55, 278–288. Retrieved from https://www.sciencedirect.com/science/article/pii/S0167739X15000023 doi: https://doi.org/10.1016/j.future.2015.01.001
- [2]Alghushairy, O., Alsini, R., Soule, T., & Ma, X. (2020). A review of local outlier factor algorithms for outlier detection in big data streams. Big Data and Cognitive Computing, 5(1), 1.DOI
- [4]Bastarianto, F. F., Hancock, T. O., Ilahi, A., Manley, E., & Choudhury, C. F. (2025). ‘mind the gap’—the impact of discrepancies between google maps api and reported travel data in the global south. Case Studies on Transport Policy, 21, 101508.DOI
- [5]Ben-Akiva, M. E., & Lerman, S. R. (1985). Discrete choice analysis: theory and application to travel demand (Vol. 9). MIT press.
- [6]Bhatta, B. P., & Larsen, O. I. (2011). Errors in variables in multinomial choice modeling: A simulation study applied to a multinomial logit model of travel mode choice. Transport Policy, 18(2), 326–335. Retrieved from https://www.sciencedirect.com/science/article/pii/S0967070X10001204 doi: https://doi.org/10.1016/j.tranpol.2010.10.002
- [7]Blei, D. M., Kucukelbir, A., & McAuliffe, J. D. (2017). Variational inference: A review for statisticians. Journal of the American Statistical Association, 112(518), 859–877. doi: 10.1080/01621459.2017.1285773DOI
- [8]Borysov, S. S., Rich, J., & Pereira, F. C. (2019). How to generate micro-agents? a deep generative modeling approach to population synthesis. Transportation Research Part C: Emerging Technologies, 106, 73–97.DOI
- [9]Bouchacourt, D., Tomioka, R., & Nowozin, S. (2018). Multi-level variational autoencoder: Learning disentangled representations from grouped observations. In Proceedings of the aaai conference on artificial intelligence (Vol. 32).arxiv.org/abs/1705.08841
- [10]Bowman, S. R., Vilnis, L., Vinyals, O., Dai, A. M., Jozefowicz, R., & Bengio, S. (2016). Generating sentences from a continuous space. In Proceedings of the 20th signll conference on computational natural language learning (conll) (pp. 10–21).arxiv.org/abs/1511.06349
- [11]Breunig, M. M., Kriegel, H.-P., Ng, R. T., & Sander, J. (2000). Lof: identifying density-based local outliers. In Proceedings of the 2000 acm sigmod international conference on management of data (pp. 93–104).
- [12]Calastri, C., dit Sourd, R. C., & Hess, S. (2020, February). We want it all: experiences from a survey seeking to capture social network structures, lifetime events and short-term travel and activity planning. Transportation, 47(1), 175–201. doi: 10.1007/s11116-018-9858-7
- [13]Cao, S., & Akoglu, L. (2025). Trajectory anomaly detection with by-design complementary detectors. In Proceedings of the 2025 siam international conference on data mining (sdm) (pp. 71–80).
- [14]Cazor, L., Watling, D. P., Duncan, L. C., Nielsen, O. A., & Rasmussen, T. K. (2024). A novel choice model combining utility maximization and the disjunctive decision rules, application to two case studies. Journal of Choice Modelling, 52, 100510.DOI
- [15]Chandola, V., Banerjee, A., & Kumar, V. (2009). Anomaly detection: A survey. ACM computing surveys (CSUR), 41(3), 1–58.
- [16]Chen, S., Wang, W., & van Zuylen, H. (2010). A comparison of outlier detection algorithms for its data. Expert Systems with Applications, 37(2), 1169–1178.DOI
- [17]Crâmer, H. (1999). Mathematical methods of statistics (Vol. 9). Princeton university press.
- [18]Dang, T. T., Ngan, H. Y., & Liu, W. (2015). Distance-based k-nearest neighbors outlier detection method in large-scale traffic data. In 2015 ieee international conference on digital signal processing (dsp) (pp. 507–510). doi: 10.1109/ICDSP.2015.7251924DOI
- [19]Daoud, A. M., Elkomy, O. M., Khedr, W. I., & Hosny, K. M. (2025). A new hybrid model for improving outlier detection using combined autoencoder and variational autoencoder. Scientific Reports.DOI
- [20]Devroye, L., Mehrabian, A., & Reddad, T. (2018). The total variation distance between high-dimensional gaussians with the same mean. arXiv preprint arXiv:1810.08693.arxiv.org/abs/1810.08693
- [21]Ding, X., Zhao, L., & Akoglu, L. (2022). Hyperparameter sensitivity in deep outlier detection: Analysis and a scalable hyper-ensemble solution. In Advances in neural information processing systems (Vol. 35).arxiv.org/abs/2206.07647
- [22]Glorot, X., Bordes, A., & Bengio, Y. (2011). Deep sparse rectifier neural networks. In Proceedings of the fourteenth international conference on artificial intelligence and statistics (aistats) (pp. 315–323).
- [23]Haghi, H., Patterson, Z., & Farooq, B. (2026). Choice set generation in work destination choice modeling with variational autoencoders. Transportation Research Record, 03611981251409202.DOI
- [24]Han, J., Kamber, M., & Pei, J. (2012). Data mining: Concepts and techniques. Waltham: Morgan Kaufmann Publishers, 13.DOI
- [25]Han, Y., Pereira, F. C., Ben-Akiva, M., & Zegras, C. (2022). A neural-embedded discrete choice model: Learning taste representation with strengthened interpretability. Transportation Research Part B: Methodological, 163, 166–186. Retrieved from https://www.sciencedirect.com/science/article/pii/S0191261522001138 doi: https://doi.org/10.1016/j.trb.2022.07.001
- [26]Hawkins, D. M. (1980). Identification of outliers (Vol. 11). Springer.
- [27]Hensher, D., & Greene, W. (2003). The mixed logit model: the state of practice. Transportation, 30, 133–176.DOI
- [28]Hess, S., & Palma, D. (2019). Apollo: A flexible, powerful and customisable freeware package for choice model estimation and application. Journal of choice modelling, 32, 100170.DOI
- [29]Hess, S., Rose, J. M., & Polak, J. (2010). Non-trading, lexicographic and inconsistent behaviour in stated choice data. Transportation Research Part D: Transport and Environment, 15(7), 405–417.DOI
- [30]Hinton, G. E., & Salakhutdinov, R. R. (2006). Reducing the dimensionality of data with neural networks. Science, 313(5786), 504–507.pubmed.ncbi.nlm.nih.gov/16873662
- [31]Hodge, V., & Austin, J. (2004). A survey of outlier detection methodologies. Artificial intelligence review, 22(2), 85–126.DOI
- [32]Huang, H., Wang, P., Pei, J., Wang, J., Alexanian, S., & Niyato, D. (2025). Deep learning advancements in anomaly detection: A comprehensive survey. Retrieved from https://arxiv.org/abs/2503.13915
- [33]Hultkrantz, L., & Mortazavi, R. (2001). Anomalies in the value of travel-time changes. Journal of Transport Economics and Policy (JTEP), 35(2), 285–299.DOI
- [34]Iqbal, T., & Qureshi, S. (2023). Reconstruction probability-based anomaly detection using variational auto-encoders. International Journal of Computers and Applications, 45(3), 231–237.DOI
- [35]Jackson, N. J., Espinosa-Dice, N., Yan, C., & Malin, B. A. (2026). Reward-guided generation improves the scientific utility of synthetic biomedical data. medRxiv, 2026–03.DOI
- [36]Kingma, D. P., & Welling, M. (2013). Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114.arxiv.org/abs/1312.6114
- [37]Knorr, E. M., Ng, R. T., & Tucakov, V. (2000). Distance-based outliers: algorithms and applications. The VLDB Journal, 8(3), 237–253.DOI
- [39]Kullback, S. (1951). Kullback-leibler divergence. Encyclopedia of Machine Learning, 581–583.
- [43]Louviere, J. J., & Woodworth, G. (1983). Design and analysis of simulated consumer choice or allocation experiments: an approach based on aggregate data. Journal of marketing research, 20(4), 350–367.
- [44]Mariel, P., & Artabe, A. (2025). A simulation-based method for testing an abnormally high incidence of specific choice patterns in discrete choice data. Resource and Energy Economics, 82, 101496.DOI
- [45]McFadden, D. (1981). Econometric models of probabilistic choice. Structural analysis of discrete data with econometric applications, 198272.
- [46]Menéndez, M. L., Pardo, J. A., Pardo, L., & Pardo, M. d. C. (1997). The jensen-shannon divergence. Journal of the Franklin Institute, 334(2), 307–318.DOI
- [48]Nguyen, H. H., Nguyen, C. N., Dao, X. T., Duong, Q. T., Kim, D. P. T., & Pham, M.-T. (2024). Variational autoencoder for anomaly detection: A comparative study. Retrieved from https://arxiv.org/abs/2408.13561
- [49]Panaretos, V. M., & Zemel, Y. (2019). Statistical aspects of Wasserstein distances. Annual review of statistics and its application, 6(1), 405–431.DOI
- [50]Park, D., Hoshi, Y., & Kemp, C. C. (2018). A multimodal anomaly detector for robot-assisted feeding using an lstm-based variational autoencoder. IEEE Robotics and Automation Letters, 3(3), 1544–1551.arxiv.org/abs/1711.00614
- [51]Pol, A. A., Berger, V., Cerminara, G., Germain, C., & Pierini, M. (2019). Anomaly detection with conditional variational autoencoders. In 2019 18th ieee international conference on machine learning and applications (icmla) (pp. 1651–1657).arxiv.org/abs/2010.05531
- [52]Ruff, L., Kauffmann, J. R., Vandermeulen, R. A., Montavon, G., Samek, W., Kloft, M., . . . Müller, K.-R. (2021). A unifying review of deep and shallow anomaly detection. Proceedings of the IEEE, 109(5), 756–795.DOI
- [53]Rumelhart, D. E., Hinton, G. E., & Williams, R. J. (1986). Learning representations by back-propagating errors. Nature, 323(6088), 533–536. doi: 10.1038/323533a0DOI
- [54]Sælensminde, K. (2002). The impact of choice inconsistencies in stated choice studies. Environmental and Resource Economics, 23(4), 403–420.DOI
- [55]Sakurada, M., & Yairi, T. (2014). Anomaly detection using autoencoders with nonlinear dimensionality reduction. In Proceedings of the mlsda 2014 2nd workshop on machine learning for sensory data analysis (p. 4–11). New York, NY, USA: Association for Computing Machinery. Retrieved from https://doi.org/10.1145/2689746.2689747 doi: 10.1145/2689746.2689747
- [56]Salo, F., Injadat, M., Moubayed, A., Nassif, A. B., & Essex, A. (2019). Clustering enabled classification using ensemble feature selection for intrusion detection. In 2019 international conference on computing, networking and communications (icnc) (p. 276-281). doi: 10.1109/ICCNС.2019.8685636DOI
- [57]Schlegl, T., Seeböck, A., Waldstein, S. M., Schmidt-Erfurth, U., & Langs, G. (2017). Unsupervised anomaly detection with generative adversarial networks to guide marker discovery. Retrieved from https://arxiv.org/abs/1703.05921
- [58]Sfeir, G., Abou-Zeid, M., Rodrigues, F., Pereira, F. C., & Kaysi, I. (2021). Latent class choice model with a flexible class membership component: A mixture model approach. Journal of Choice Modelling, 41, 100320. Retrieved from https://www.sciencedirect.com/science/article/pii/S1755534521000531 doi: https://doi.org/10.1016/j.jocm.2021.100320
- [59]Sifringer, B., Lurkin, V., & Alahi, A. (2020). Enhancing discrete choice models with representation learning. Transportation Research Part B: Methodological, 140, 236-261. Retrieved from https://www.sciencedirect.com/science/article/pii/S0191261520303830 doi: https://doi.org/10.1016/j.trb.2020.08.006
- [60]Škvara, V., Franců, J., Zorek, M., Pevný, T., & Šmídl, V. (2021). Comparison of anomaly detectors: Context matters. arXiv preprint arXiv:2102.06260.
- [62]Sun, J., Wang, X., Xiong, N., & Shao, J. (2018). Learning sparse representation with variational auto-encoder for anomaly detection. IEEE Access, 6, 33353-33361. doi: 10.1109/ACCESS.2018.2848210DOI
- [63]Titar, R. R., & Ramanathan, M. (2024). Variational autoencoders for generative modeling of drug dosing determinants in renal, hepatic, metabolic, and cardiac disease states. Clinical and Translational Science, 17(7), e13872.DOI
- [64]Train, K. E. (2009). Discrete choice methods with simulation (2nd ed.). Cambridge: Cambridge University Press.
- [65]Tsoleridis, P., Choudhury, C. F., & Hess, S. (2022). Deriving transport appraisal values from emerging revealed preference data. Transportation Research Part A: Policy and Practice, 165, 225-245. Retrieved from https://www.sciencedirect.com/science/article/pii/S0965856422002208 doi: https://doi.org/10.1016/j.tra.2022.08.016
- [66]Varotto, S. F., Glerum, A., Stathopoulos, A., Bierlaire, M., & Longo, G. (2017). Mitigating the impact of errors in travel time reporting on mode choice modelling. Journal of Transport Geography, 62, 236-246. Retrieved from https://www.sciencedirect.com/science/article/pii/S0966692316304161 doi: https://doi.org/10.1016/j.jtrangeo.2017.05.016
- [67]Vrtic, M., & Axhausen, K. W. (2002). The impact of tilting trains in switzerland: A route choice model of regional-and long distance public transport trips. Arbeitsberichte Verkehrs- und Raumplanung, 128.DOI
- [68]Wang, S., Mo, B., & Zhao, J. (2020). Deep neural networks for choice analysis: Architecture design with alternative-specific utility functions. Transportation Research Part C: Emerging Technologies, 112, 234-251. Retrieved from https://www.sciencedirect.com/science/article/pii/S0968090X19310381 doi: https://doi.org/10.1016/j.trc.2020.01.012
- [69]Wang, S., Mo, B., & Zhao, J. (2021). Theory-based residual neural networks: A synergy of discrete choice models and deep neural networks. Transportation research part B: methodological, 146, 333–358.arxiv.org/abs/2010.11644
- [70]Wong, M. (2019). Generative modelling and machine learning methods for travel behaviour analysis (Unpublished doctoral dissertation). Toronto Metropolitan University.
- [71]Xiong, Y., Kim, H. J., & Singh, V. (2019). Mixed effects neural networks (menets) with applications to gaze estimation. In 2019 ieee/cuf conference on computer vision and pattern recognition (cupr) (pp. 7735–7744).DOI
- [72]Yao, R., & Bekhor, S. (2022). A variational autoencoder approach for choice set generation and implicit perception of alternatives in choice modeling. Transportation Research Part B: Methodological, 158, 273-294. Retrieved from https://www.sciencedirect.com/science/article/pii/S019126152200042X doi: https://doi.org/10.1016/j.trb.2022.02.015
- [74]Zhang, H., Zhang, J., Srinivasan, B., Shen, Z., Qin, X., Faloutsos, C., . . . Karypis, G. (2024). Mixed-type tabular data synthesis with score-based diffusion in latent space. In The twelfth international conference on learning representations (iclr).DOI
- [76]Ögretir, M., Ramchandran, S., Papatheodorou, D., & Lähdesmäki, H. (2022). A variational autoencoder for heterogeneous temporal and longitudinal data. In 2022 21st ieee international conference on machine learning and applications (icmla) (p. 1522–1529). IEEE. Retrieved from http://dx.doi.org/10.1109/ICMLA55696.2022.00239 doi: 10.1109/icmla55696.2022.00239
Machine contribution statement
No AI-use declaration is available for this version in Valency.
The available record does not establish whether AI systems or models contributed to this work.