# A Cox Model-Based Workflow for Increased Accuracy in Activity-Travel Patterns Generation
## 3 Methodology
The prior probabilities, classprobs, are obtained from a Dirichlet prior distribution, and they must satisfy:  
\[\sum_{c\in c}classprobs_{c}=1,\,classprobs_{c}\geq 0\]  
This condition ensures that the prior probabilities are valid probabilities, summing to one and being non-negative. We note that \(Z_{ic}\) is calculated from the following equation, which combines the prior probability with the data likelihood, and normalizes across all classes to yield a posterior probability. \[Z_{ic}=classprobs_{c}*likelihood_{c}*\frac{1}{\sum_{c}classprobs_{c}*likelihood _{c}}\] \begin{table}
\begin{tabular}{p{113.8 pt} p{113.8 pt} p{113.8 pt} p{113.8 pt}} \hline
**Category** & **Variable Name** & **Type** & **Vaue Mappings** \\ \hline
**Demographic** & Gender & Categorical & (1: male, 0: female) \\ \hline  & Age & Continuous & Age in years \\ \hline  & Education & Categorical & 1: Primary School, 2: High School, 3: Bachelor, 4: Master or PhD \\ \hline  & Employment & Categorical & 1: Inactive, 2: Unemployed, 3: Student, 4: Active \\ \hline  & Income & Categorical & 0: No income, 1: \(\leq\)750, 2: 750–1500, 3: 1500–2500, 4: \(\geq\)2500 \\ \hline  & Car\_own & Categorical & 0: No, 1: Yes \\ \hline
**Spatial Variables** & Dest & Categorical & 1: Central Athens, 2: West Athens, 3: East Attica, 4: South Athens, 5: North Athens, 6: Piraeus \\ \hline  & Home & Categorical & Same as Dest \\ \hline
**Mode Choice** & Mode & Categorical & 1: car, 2: taxi,3: bus, 4: train, 5: motorcycle, 6: bicycle, 7: walk, 8: E-scooter \\ \hline
**Temporal Variables** & Time & Continuous & Start trip time (24-h format) \\ \hline
**Distance** & Dist & Continuous & Distance \\ \hline \end{tabular}
\end{table} 
Table 3: Survey variables for the Activity-Travel Patterns, that are also used as features for the training of the models. where:  
* _classprobs_\({}_{c}\) is the prior probability of belonging to latent class \(c\)
* _likelihood_\({}_{c}\) represents how well the data fit the parameters of latent class c, defined as: \[likelihood_{c}=\left\{ \begin{array}{ll}\text{\emph{Weibull}}\text{ \emph{PDF}},&status_{i}=1\\ \text{\emph{Weibull}}\text{\emph{CCDF}},&status_{i}=0\end{array} \right.\] This distinction accounts for whether the event of interest (end of activity) was observed or censored. The Weibull probability density function (PDF) is given by: \[\text{\emph{Weibull}}\text{\emph{PDF}}(t)=\frac{k}{\lambda}*\left(\frac{t}{ \lambda}\right)^{\kappa-1}\exp\left(-\frac{t}{\lambda}\right)^{\kappa}\] with the parameters: \[\text{k}=\frac{1}{\sigma_{frailty}}\text{\emph{and}}\text{ \emph{\lambda}}=\exp\left(X_{i}*\beta_{c}+frailty_{c}\right)\] These parameters reflect the shape and scale of the Weibull distribution, influenced by covariates and latent class-specific effects. Similarly, the complementary cumulative distribution function (CCDF) of the Weibull is: \[\text{\emph{Weibull}}\text{\emph{CCDF}}(t)=\exp\left(-\frac{t}{\lambda}\right)^ {\kappa}\] This form is used for censored observations to reflect the probability of survival beyond time \(t\). Finally, the term \(\sum_{c}classprobs_{c}*likelihood_{c}\) refers to the normalization of the probabilities so that their sum equals 1.