# Sensitivity Analysis for Microscopic Crowd Simulation
## 2 Materials and Methods
### Choice of Sensitivity Analysis Methods
#### 2.3.1 [PERSON]' Indices (Variance-Based Method)  
For the description of [PERSON]' indices, we assume that our model \(f\) is a square-integrable function defined over a \(k\)-dimensional unit hypercube \(\Omega\). This description follows [52]. Any model that fulfills these assumptions can be represented by an analysis of variance, or ANOVA, decomposition. The decomposition splits \(f\) into a set of orthogonal functions, depending on the factors \(x_{i},i=1,\ldots,n\) and their interactions:  
\[f(x)=f_{0}+\sum_{i}f_{i}(x_{i})+\sum_{i}\sum_{j,j>i}f_{ij}(x_{i},x_{j})+\cdots +f_{12\cdots n}(x_{1},x_{2},\ldots,x_{n}). \tag{2}\]  
First-order univariate functions \(f_{i}\) represent independent contributions due to the individual parameters. Interaction terms \(f_{ij}\) to \(f_{12\cdots n}\) quantify the interactions of several input parameters \(x_{i}\) on the response \(y\). When all \(2^{n}\) terms are used, the decomposition is an exact representation of \(f\).  
Sobol' indices are a measure related to the variance of the model response \(y\). This variance can be split into the variance of the functions in (2). Subsequently, the total variance of the response \(y\) can be written as  
\[V[y]=\int_{\Omega}f^{2}(x)dx-f_{0}^{2}=\sum_{i}V[f_{i}]+\sum_{i}\sum_{j>i}V[f_ {ij}]+\ldots+V[f_{12\ldots n}] \tag{3}\]  
with \(f_{0}=E[y]\). First order indices \(S_{i}\) and total order indices \(S_{T_{i}}\) are defined as  
\[S_{i}=\frac{V[E[y|x_{i}]]}{V[y]}\text{ and }S_{T_{i}}=\frac{E[V[y|x_{\sim i}]]}{ V[y]}=1-\frac{V[E[y|x_{\sim i}]]}{V[y]}, \tag{4}\]where \(V[E[y|x_{i}]]=V[f_{i}(x_{i})]\). First order indices \(S_{i}\) describe the variance in the response due to the variance in input parameter \(x_{i}\). In contrast to first order indices that only consider the effects of a single parameter, total order indices also consider interaction effects among parameters. The relation between the total order indices \(S_{T_{i}}\) and the first and higher order indices is:  
\[S_{T_{i}}=S_{i}+\sum_{j>i}S_{ij}+\sum_{j>i}\sum_{k>j}S_{ijk}+\ldots+S_{123\ldots n}. \tag{5}\]  
The total index \(S_{T_{i}}\) for parameter \(i\) is the sum over all indices that contain a contribution of \(x_{i}\). The interaction effects can also be measured by the higher order indices defined by [PERSON]'. Total indices \(S_{T_{i}}\) measure the variability of the output if all parameters, except \(x_{i}\), could be fixed.  
For most problems in practice, these indices cannot be analytically calculated, since they require solving high-dimensional integrals. Instead, we approximate the [PERSON]' indices by [PERSON]'s method [53]. For a given sampling factor \(M\), the number of Monte Carlo samples generated is \(N=\lfloor M/(m+1)\rfloor\). We generate two matrices, \(A\) and \(B\), with \(N\) samples each according to the input parameter density. The variation of all input factors except one is modeled by constructing matrices \(A_{B}^{(i)}\) that are identical to matrix \(A\), except for column \(i\), which originates from matrix \(B\). Subsequently, variances of model evaluations at row \(j\) of \(A\) and \(B\) to \(A_{B}^{(i)}\), respectively, are approximated. The first order indices \(S_{i}\) are approximated by  
\[\hat{S_{i}}=1-\frac{1}{2 Nv_{y}}\sum_{j=1}^{N}\left(f(B)_{j}-f(A_{B}^{(i)})_{j} \right)^{2}, \tag{6}\]  
where the variance of the model response \(V[y]\) is approximated by the sample variance \(v_{y}\) of the evaluations \(f(A)\) and the subscript \(j\) stands for row \(j\) of the matrix. The total order indices \(S_{T_{i}}\) are approximated by  
\[\hat{S}_{T_{i}}=\frac{1}{2 Nv_{y}}\sum_{j=1}^{N}\left(f(A)_{j}-f(A_{B}^{(i)})_{ j}\right)^{2}. \tag{7}\]