## 2 Materials and Methods
### Second Step: Duration Estimation by Sliding Windows and Markov-Based Approaches
#### 2.3.2 Discretization by Markov Chains  
Since the weather data for wind speed and wave height come in a discrete form with an hourly resolution, the following approach discretizes the different basic operations and combines them in a directed graph. It represents each basic operation by a node, and each weighted edge represents the probability of transitioning to the adjacent node in the next time step. The goal is to estimate the average time needed to pass from the first to the last node in that graph. Since the probability of reaching the next node is only dependent on the weather forecast, the graph represents a discrete-time Markov Chain. The used chain has three specific characteristics: First, each state points only on itself or to the following state with a combined probability of 1, since it is assumed that the operation was either successfully performed or not started at all. The second characteristic aims to render the problem easier to handle mathematically. This approach introduces helper states after each normal state. Therefore, a series of \(k\) helper states follow each normal state to represent the passing of time that is needed for that process to finish. The amount \(k\) of helper states conforms to the base duration of the respective operation minus one. The third characteristic describes that the final state is indeed final since it is not escapable. Let \(P_{x,y}^{n}=P(X_{n+1}=y\mid X_{n}=x)\) be the probability of transitioning from state \(x\in\mathbb{S}\) to \(y\in\mathbb{S}\) with the state-space \(\mathbb{S}\) at time step \(t_{n}\). The state-space \(\mathbb{S}\) thereby contains all the possible states from starting the turbine construction until the finished state, including all helper states in between. The stated characteristics from before are given as:  
\[P_{x,y}^{n}+P_{x,x}^{n} =1 \forall n\in\mathbb{N}_{0} \text{if $y$ follows $x$}\] \[P_{x,y}^{n} =1 \forall n\in\mathbb{N}_{0} \text{if $x$ is a help state}\] \[P_{x,x}^{n} =1 \forall n\in\mathbb{N}_{0} \text{if $x$ is the last state}\]  
Since the weather and its forecast changes over time, most of the time \(P_{x,y}^{n+1}\
eq P_{x,y}^{n}\) which makes this Markov-Chain non-time-homogeneous and results in a time-dependent transition matrix \(P^{n}\) with the entries \(P_{x,y}^{n}\). Writing the states as a vector \(s\) with a length equal to the number of states with its binary entries indicating which state \(s\) is represented, it is possible to apply the transition matrices \(P^{0},\ldots,P^{n}\) on the initial state to calculate the probabilities of the states at time step \(t_{n}\). Figure 5 displays an example transition matrix. Let \(s_{0}=[1,0,\ldots,0]\) indicate the initial state, then the last entry of \(s_{i}=s_{0}\prod_{i=0}^{n}P^{i}\) represents the probability of being in the final state at time step \(t_{n}\). This approach uses a weighted sum \(d=\sum_{i=1}^{\infty}i\cdot p_{i}\) with \(p_{i}=s_{i}(q)-s_{i-1}(q)\) and \(q\) equal to the number of all states to estimate the average time \(d\) needed to reach the final state. Since it is possible that \(s_{i}(q)<1\)\(\forall i\in\mathbb{N}_{0}\), the sum does not need to converge. This particularly happens, if an operation cannot finish during the forecast period due to high uncertainties or bad weather. For numerical purposes, this approach caps the sum after \(s_{i}(q)>0.9973\), which correlates with a standard deviation of \(3\sigma\) in a normal distribution. The Markov-Chain approach uses the presented concepts in combination with the limits on weather restrictions provided in Table 1 to estimate the duration of aggregate operations. Therefore, it compares the limits for each operation with the minimum \(l_{i,j,r}\), and maximum \(u_{i,j,r}\) of the forecast for every time step \(t_{i},\ldots,t_{i+d-1}\) to calculate the probability that the operation could finish successfully if started at time step \(t_{i}\).Therefore, \(d\) denotes the specified base duration of that operation (c.f.