## 3 The \(2^{k}\) Factorial Analysis  
VANET simulations often involve large and heterogeneous scenarios. The number of possible factors and their values, or levels, can be very large. In this section, we will explain how the \(2^{k}\) factorial analysis [6] can be used to determine the most relevant factors that govern a system's performance. The use of \(2^{k}\) factorial is important for several reasons: (i) to reduce the overall number of simulations needed; (ii) to evaluate the relationship between different factors; and (iii) to reduce the amount of simulation time required. The basic approach of this method is based on selecting a set of \(k\) parameters and determining \(2\) extreme levels (tagged with \(-1\) and \(1\)). An experiment is run for all the \(2^{k}\) possible combinations of the parameters. From each experiment, we can also extract the \(\binom{k}{2}\) two-factor interactions, the \(\binom{k}{3}\) three-factor interactions, and so on. For example, suppose that we have proposed a Warning Message Dissemination system, and that we want to study the impact of the density of vehicles (factor A) and the speed of these vehicles (factor B) on the warning notification time, _i.e._, the time required by normal vehicles to receive a warning message sent by a warning mode vehicle. If we make a \(2^{2}\) factorial analysis, we can find out the impact of each factor (density of vehicles and speed), and their combination, in the studied metric (warning notification time). Table 1 showsthe different experiments defined by the \(2^{2}\) design, and Table 2 shows the results obtained after the simulations. Let us define two variables \(x_{A}\) and \(x_{B}\) as presented in Equations (1) and (2):  
\[x_{A}=\left\{ \begin{matrix}-1&\text{if}&density\;of\;vehiches=25\\ 1&\text{if}&density\;of\;vehiches=150\end{matrix} \right\} \tag{1}\] \[x_{B}=\left\{ \begin{matrix}-1&\text{if}&speed=10\;km/h\\ 1&\text{if}&speed=80\;km/h\end{matrix} \right\} \tag{2}\]  
The warning notification time (\(y\)) can be regressed on \(x_{A}\) and \(x_{B}\) using a nonlinear regression model of the form:  
\[\mathbf{y} = q_{0}+q_{A}x_{A}+q_{B}x_{B}+q_{AB}x_{A}x_{B} \tag{3}\]  
Substituting the four observations in the model, we get the following four equations:  
\[1= q_{0}-q_{A}-q_{B}+q_{AB} \tag{4}\] \[0.5= q_{0}+q_{A}-q_{B}-q_{AB}\] (5) \[0.8= q_{0}-q_{A}+q_{B}+q_{AB}\] (6) \[0.4= q_{0}+q_{A}+q_{B}+q_{AB} \tag{7}\]  
These equations can be solved uniquely for the four unknowns. The regression equation is:  
\[\mathbf{y} = 0.675-0.225x_{A}-0.075x_{B}+0.025x_{A}x_{B} \tag{8}\]  
The result is interpreted as follows: the mean warning notification time is 0.675 s, the effect of the density of vehicles is \(-0.225\) s, the effect of the speed of the vehicles is \(-0.075\) s, and the interaction between speed and density of vehicles accounts for 0.025 s. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Experiment** & **A** & **B** & **y** \\ \hline
1 & \(-1\) & \(-1\) & \(y_{1}\) \\
2 & 1 & \(-1\) & \(y_{2}\) \\
3 & \(-1\) & 1 & \(y_{3}\) \\
4 & 1 & 1 & \(y_{4}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Experiments defined by a \(2^{2}\) design. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Density of vehicles** & **Speed 10 km/h** & **Speed 80 km/h** \\ \hline
25 veh./km\({}^{2}\) & 1 s & 0.8 s \\
150 veh./km\({}^{2}\) & 0.5 s & 0.4 s \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Example of results obtained in terms of warning notification time varying two factors. In a \(2^{k}\) factorial analysis, by using the sign table method, we can get the results and detect variations that depend on the combination of factors. For a \(2^{2}\) design, the effects can be computed easily by preparing a \(4\times 4\) sign matrix as shown in Table 3. The first column of the matrix is labeled \(I\), and all its elements are equal to 1. The next two columns, titled \(A\) and \(B\), contain basically all possible combinations of \(-1\) and \(1\).