# Cyber Insurance for Energy Economic Risks
## 2 Modeling of Cyber Intrusions in Energy Systems  
This section illustrates how the stealthily designed FDI attacks are executed to introduce erroneous data into system measurements, thereby causing disruptions in the  
Figure 1: A graphical summary of the research motivations. operations and decision-making processes of the energy systems. State estimation is widely used for detecting the redundant measurements and eliminating erroneous signals [47]. Equation (1) demonstrates nonlinear measurement between meter measurements, \(z\), and state variable \(\psi\), where \(e\) denotes the measurement errors. The Jacobian matrix is denoted as \(H\). This manipulation of data typically occurs without detection, as FDI attacks are designed to mimic legitimate data patterns. These attacks introduce discrepancies that can lead to incorrect system operations, affecting energy distribution and stability. The process of state estimation, therefore, is crucial for identifying and correcting these deviations by providing a mathematical method of estimating the actual system states based on the measurements received. \[z=H\psi+e \tag{1}\]  
Weighted least squares (WLS) is widely used for bad data detection; it estimates the values of the model parameters based on ordinary least squares and linear regression. WLS estimates the unknown values in the regression function via minimizing the sum of squared deviations of errors and functional portion of the model [48]; in (2), \(z_{m}\) is assumed to follow normal distribution with zero mean and diagonal covariance matrix \(D=\text{diag}(\sigma_{1}^{2},\sigma_{2}^{2},\ldots,\sigma_{M}^{2})\). WLS is a refinement of the ordinary least squares, incorporating weights into the regression to account for variations in data quality or informational content. This method is particularly effective in contexts where measurement errors vary significantly across data points, allowing for more accurate estimation by giving less weight to data points with higher variances. In energy system monitoring, where measurements can be influenced by a variety of error sources, applying WLS helps in minimizing the influence of these errors on the estimation process. By optimizing the weights assigned to each measurement based on their estimated precision, represented by the diagonal elements of matrix \(D\), WLS finetunes the parameter estimation process to improve the robustness and reliability of the state estimation. The objective of the WLS in this context is to minimize the sum of the weighted squared differences between observed measurements and those predicted by the model, which leads directly into the formulation of Equation (2). \[L(\psi)=\sum_{m=1}^{M}{(z_{m}-H_{m}\psi)^{2}/D_{mm}} \tag{2}\]  
The derivation of the optimal solution involves computing the pseudo-inverse of the matrix formed by the product of the transpose of the Jacobian matrix, \(H\), the inverse of the covariance matrix, \(D\), and \(H\) again. This calculation method leverages the generalized least squares approach, which assigns weights to the measurements optimally according to their respective variances to minimize estimation errors. The resulting solution, represented by Equation (3), provides the most statistically efficient estimate of the state variables, assuming that the errors are normally distributed and independent. \[\hat{\psi}\ =\Big{(}H^{\text{T}}D^{-1}H\Big{)}^{-1}H^{\text{T}}D^{-1}z \tag{3}\]  
When an FDI attack is launched, erroneous measurements are manipulated. Bad data detection utilizes residual \(\rho=z\ -H\ \hat{\psi}\) to detect the measurements that have been tampered with. When \(\frac{z_{m}-H_{m}\hat{\psi}}{\sigma_{m}}\) follows the normal distribution; \(L(\hat{\psi})\) is proved to follow the \(\chi^{2}\) distribution. \(z\) is considered as a bad data measurement when \(L(\hat{\psi})\) is larger than the threshold \(\zeta\).