## 3 Materials and Methods
### Research Method
#### 3.3.3 Time-at-Risk (TaR) and Monte Carlo Simulation
Hence its mean \(\mu\) can be expressed as: \(\mu=\frac{a+b+c}{5}\). Figure 7: Comparison of triangular and PERT distributions for the assumed “Project implementation stage” assumptions (i.e., minimum, maximum and mode values). The triangular distribution features with an angular shape, while the PERT distribution with a smoother shape (the difference is characteristic for subjective knowledge-type distributions). However, if the PERT distribution is strongly skewed, the extreme values may be underestimated [90]. One solution for controlling the risk specifically for construction schedules can be obtained with the use a modified PERT distribution [91], whereby the there is more control over tail values. Such a modified PERT distribution has an additional parameter by which the weight of the most likely value can be arbitrarily determined (the mean of this distribution can be expressed as: \(\mu=\frac{a+\gamma b+c}{\gamma+2}\)). As for the Monte Carlo simulation method, there are numerous studies based on this approach. [PERSON] [92], for example, used Monte Carlo simulation to estimate the time unpredictability of project activities. [PERSON] et al. [23] proposed a method to assess the risk of delay in projects planned according to the line-of-balance method (LOB) and used Monte Carlo simulation to quantify the risk. [PERSON] et al. [93] investigated the importance of using historical information and the correct choice of distribution when estimating activity duration for the Monte Carlo simulation process. [PERSON] [94] used Monte Carlo simulation and empirical project data from schedule risk analysis and earned value management process and proposed measures of project control efficiency. Additionally, [PERSON] et al. [16] show explicitly the benefits of using Monte Carlo simulation to assess risk in practical scheduling. These are just a few examples, of which there are many more. A very thorough overview of many construction-related studies based on Monte Carlo simulations can be found in the paper by [PERSON] et al. [95]. The method that we use yielded the deviations from the expected (most likely) completion times for each stage of the construction process. For this purpose, the Monte Carlo method was used (with 10,000 repetitions). In the next step, a covariance matrix was obtained taking into account the dependencies between schedules of individual project stages. Subsequently, the TaR of the entire project was calculated, i.e., for the entire \"portfolio of stages\", assuming that the weights of all project phases add up to 100%. The weights were calculated based on the durations and investment levels of each stage of the entire project. Given a confidence level of \(p\in(0,1)\) and assuming that the number of random samples \(s\) (of deviations from the estimated schedules) with \(\alpha\) equal to a certain quantile of the distribution, we would like to determine the change in \(\Delta T(\alpha)\) over time for the whole project (schedules). Let \(G_{\alpha}(x)\) be the cumulative distribution function \((\text{CDF})\) of \(\Delta T(\alpha)\). Since the time change is \(\Delta T(\alpha)\geq 0\), then we can define the TaR as a quantile of the CDF for a given \(p\) as \(p=\mathbb{P}[\Delta T(\alpha)\geq\text{TaR}]=G_{\alpha}(\text{TaR})\). Assuming that the project developer expects to complete all project phases in a period shorter than TaR, with a given \(\alpha\) and probability \(p\), which means that time, \(T\), changes \(\Delta T(\alpha)\leq 0\), the probability \(p\) with respect to TaR can be expressed as follows:  
\[p=\mathbb{P}[\Delta T(\alpha)\leq\text{TaR}]=1-\mathbb{P}[\Delta T(\alpha) \geq\text{TaR}]=1-G_{\alpha}(\text{TaR})\]  
Consequently the \(p-quantile\) of \(G_{\alpha}(x)\) for the CDF of \(G_{\alpha}(x)\) and a given confidence level of \(p\in(0,1)\) is \(\text{TaR}_{p}=x_{p}=inf\{x|G_{\alpha}(x)\geq p\}\), where \(inf\) denotes the lowest real number. Therefore, the tail behaviour of the CDF of \(G_{\alpha}\) or its quantile is a condition necessary for approaching TaR calculation.