## 4 Proposed Extension to CARLA
### PGM for Modeling Complex Urban Environment  
To capture the realistic dynamics of the complex urban environment such as the number of vehicles, the dynamic speed of the vehicles, the probability of pedestrians in an urban environment, the dynamic weather of the environment, and the time of the day, the probabilistic graphical model (PGM) is used. We aim at capturing the dynamically changing state of the environment, the partially observable state of the environment, and unprecedented events in the environment. To further understand the environment, consider Figure 1 which explains some scenario scenes of the complex urban environment. In what follows next, we discuss the motivation to opt for the PGM, which comes from the following facts:  
* It is instrumental in understanding the complex relationship between a set of random variables. This is an important feature because the considered problem domain involves several variables (e.g., number of vehicles, number of pedestrians, vehicle speed, weather state, time of the day, distance from other vehicles and objects, road markings, road signs, road traffic lights, etc.) Furthermore, these variables have an impact on one another, resulting in much more complex hyperparameter relationships;
* It allows to reuse the knowledge accumulated over the different scenes and settings;
* It allows for solving tasks such as inference learning. This feature is relevant to the considered collaborative autonomous driving problem domain since we are interested in estimating the probability distributions and probability functions in different use cases. For instance, when the probability is associated with the elements of action space in a specific use case, we are interested in achieving the optimal values of the associated probability values;
* It allows the independence properties to represent high-dimensional data more compactly. The independence properties help in the considered problem domain by assisting in understanding the characteristics of a particular attribute separately from the rest of the system;* The concept of conditional independence brings in significant savings in terms of how to compute and represent the network structure. A PGM models a joint probability distribution over a set of random variables \(\mathbf{X}=\{X_{1},...,X_{n}\}\). It is represented as a pair \((\mathcal{G},\Theta)\), which consists of a graph structure \(\mathcal{G}\) that codifies the dependent relationships between the random variables and a set of parameters \(\Theta\). There are different types of PGM models, however, in this research, we implement the PGM model based on directed acyclic graphs (DAG). Given a PGM \((\mathcal{G},\Theta)\) with a DAG \(\mathcal{G}=(\mathbf{X},\mathbf{R})\), where \(X\) is a non-empty finite set of nodes and \(R\) is a set of edges, and three distinct subsets of variables \((\mathbf{U},\mathbf{Y},\mathbf{Z})\) of \(\mathbf{X}\), \(\mathbf{Y}\) is conditionally independent of \(\mathbf{Z}\) given \(\mathbf{U}\) if \(\mathbf{U}\) d-separates \(\mathbf{Y}\) and \(\mathbf{Z}\) in \(\mathcal{G}\). We suppose that the set of variables \(\mathbf{X}\) is arranged in accordance with a DAG \(\mathcal{G}\) ancestral ordering, the parent nodes of \(X_{j}(\mathbf{PA}_{j})\) variable d-separates \(X_{j}\) from any prior variable in the ancestral ordering, \(X_{i}(i<j)\). This is to say that \(X_{j}\) is conditionally independent of any \(X_{i}(i<j)\) given its parents, \(\mathbf{PA}_{j}\). Based on this property, we express the joint probability distribution of \(\mathbf{X}\) given the chain rule as:  
\[p(x)=p(x_{1},...,x_{n})=\prod_{j=1}^{n}p(x_{j}\mid x_{1},...,x_{j-1}) \tag{1}\]  
when codified by a DAG-based PGM, it is factorized as:  
\[p(x)=\prod_{j=1}^{n}p(x_{j}\mid\mathbf{pa}_{j}) \tag{2}\]  
Bayesian network (BN) models are DAG-based PGMs with all the discrete random variables, comprised of a DAG \(\mathcal{G}\) and a set of parameters \(\Theta\).