## 2 Background Information
### Linear Regression Prediction Model  
Considering a prediction data-driven model selection, performance comparison among several options were made, including linear and non-linear formulations. Test results indicated that a linear regression model was sufficient to yield a great prediction performance. In addition, it is a simpler model with less hyper parameters than other formulations. Multiple linear regression models can be used to estimate SG measurements. The justification for multiple linear regression use is that it is a simple model with few parameters to train. It has been shown that the linear model can achieve satisfying prediction performance on daily load data [29]. Historical measurement values are used as input features to train these multiple linear regression models. During the training, ML model takes historical data (measurement values from past 'K' days) as inputs and current day measurements as the target. The training process returns model coefficients that can be used to generate synthetic measurement values from historical measurements. These coefficients estimated using the multiple linear regression model for properly scaled input features also provide an easy way to understand the contribution of each input feature in estimating the target.  
Consider \(D\) equal to the number of measurement values, and the number of past days used as input features for regression models be \(K\). Thus, \(D\) linear regression models can be trained, corresponding to \(D\) measurements. The corresponding measurements from \(K\) past days are used as input features for the regression model.  
\[\mathbf{y}_{d}=\mathbf{f}_{d}^{0}+\mathbf{f}_{d}^{1}\mathbf{x}_{d1}+\cdots+ \mathbf{f}_{d}^{K}\mathbf{x}_{dK}, \tag{3}\]  
where the dependent variable \(\mathbf{y}_{d}\in\mathbb{R}^{D\times 1}\) is a vector that contains \(d\)-th measurement values for the current day, the independent variable \(\mathbf{x}_{dK}\in\mathbb{R}^{D\times 1}\) is a vector that contains \(d\)-th measurement values from \(k\)-th past day, and \(\mathbf{f}_{d}\in\mathbb{R}^{1\times(K+1)}\) is a vector that contains \(\mathbf{f}_{d}^{0},\mathbf{f}_{d}^{1},\ldots,\mathbf{f}_{d}^{K}\) values.  
The regression coefficient matrix \(\mathbf{fi}\in\mathbb{R}^{D\times(K+1)}\) contains \((K+1)\) values (one for each of the past \(K\) days and one intercept) for \(D\) multiple linear regression models. \(\mathbf{fi}\) is estimated by solving (3) using the Least Squares Fit method. Figure 1 illustrates recorded measurement values and the measurement values prediction by the multiple linear regression models, trained with past temporal data.  
Figure 1: An example for ML-predicted measurement vs. recorded measurement value.  
We create 'Weight matrix (\(W_{ml}\))' based on values of regression model coefficients of each measurement. \(W_{ml}\in\mathbb{R}^{D\times D}\) is used to weigh the measurements in state estimation process and it is calculated from \(\mathbf{fi}\) as:  
\[W_{ml}^{i,j}=\begin{cases}\frac{K+1}{\sum\limits_{k=0}^{K}(\mathbf{fi}_{i}^{2}- \overline{\mathbf{fi}}_{i})^{2}},&\text{if }i=j\\ 0,&\text{if }i\
eq j.\end{cases} \tag{4}\]  
where \(i,j=1,2,3,\ldots,D\) represents the measurement number and \(\overline{\mathbf{fi}}_{i}\) represents measurement \(i\) average of \(K+1\) regression coefficients.  
As a greater number of days are used to create historical data, the reliance of the model on any one day reduces and the model develops a capability to capture the general measurement deviation patterns. This can improve the generalization ability of the model. We assume that the current day measurements do not deviate from the historical trend by a huge margin and the training data does not have any anomalies. The historical data could be analyzed through bad detection techniques such as [18] for the presence of anomalies and then only the data that does not contain bad data could be used for ML model training.