# A Cox Model-Based Workflow for Increased Accuracy in Activity-Travel Patterns Generation
## 3 Methodology  
This section is organized into three parts. The first outlines the theoretical framework underlying the statistical and machine learning models employed in the activity-based approach, while the second presents the activity-based model that is used for the generation of synthetic activity-travel pattern datasets. The third part focuses on the criteria used for the models' performance evaluation. Modeling Unobserved Heterogeneity and Non-Linear Relationships in Source Data by Using the Cox-Based Model  
Several modern open-source libraries that are used to generate synthetic activity-travel patterns employ simple statistical distributions for the estimation of synthetic activity durations [48], with only a few exceptions [16]. This context highlights a key challenge: the need to identify and utilize more suitable statistics-based models for the generation of synthetic activity-travel patterns. In response, the current study investigates the applicability of three Cox-based models, aiming to evaluate their effectiveness in addressing this task. In more detail, these models are:  
1. A simple Cox model without unobserved heterogeneity considerations,
2. A Cox model that accounts for unobserved heterogeneity in the source dataset by including two latent classes,
3. A Cox-based machine learning model, which leverages a neural network to learn complex, non-linear relationships in the data while maintaining the proportional hazards structure of the traditional Cox model. Based on these three short descriptions, the current section dives deeper into each of the three models examined in this research work. Starting with the simple Cox model, it serves as a standard textbook approach to survival analysis [49], assuming proportional hazards and no unobserved heterogeneity. This model posits that all differences in survival outcomes can be attributed to observed covariates, treating individuals with identical covariate profiles as having the same hazard function, thereby excluding the influence of latent factors or frailty. Very importantly, its simplicity and reliance on fewer parameters make it a strong benchmark model, as it is less prone to overfitting compared, most likely to generalize better to bigger and more complex datasets. Moving on to the second model, a Cox model with unobserved heterogeneity incorporates measurable covariates that explain differences in individual hazard rates, allowing the model to account for known sources of variation across subjects. Considering the size of our dataset and the importance of model interpretability and replicability, the use of two latent classes was deemed more suitable, rather than having one, three, or more latent classes for this second model. This choice reflects findings in recent methodological literature, which highlight that two-class solutions often strike the best balance between interpretability, statistical fit, and model convergence, especially in clinical datasets of moderate size [32; 33]. Additionally, adding more classes frequently leads to overfitting and unstable class definitions, offering limited clinical value despite potentially improved statistical fit metrics [33]. More specifically, in the second model, two variables (\(frailty_{1}\) and \(frailty_{2}\)) were included to represent the two distinct latent classes identified in the population. The latent classes are two subgroups of observations that are not directly observed but are computed through statistical models. During the duration calculation process, the data are divided into two different groups based on their characteristics. Thus, each of these groups reveals a hidden pattern that, although not described by the data and the variables derived from them, is capable of affecting the final duration of the activities. For example, this could include travel by people with young children or travel by people who avoid traffic, etc. In other words, it concerns hidden characteristics or behaviors that can indeed influence the activity durations.