# Generation of Data-Driven Expected Energy Models for Photovoltaic Systems
## 2 Methodology
### Model Evaluation  
Three metrics were used to evaluate the performance of the trained expected energy models: logarithmic root mean squared error (\(\log RMSE\)), coefficient of determination (\(R^{2}\)), and percent error (\(\delta\)). Both partner-provided expected energy values and those calculated by the leading standardized expected energy model (i.e., IEC 61724) were used as reference values for model evaluations. The root mean squared error (\(RMSE\)) is a common goodness-of-fit statistic used for model evaluation. The \(RMSE\) is expressed as:  
\[RMSE=\sqrt{\frac{1}{n}\sum\limits_{i=1}^{n}(y_{i}-\hat{y}_{i})^{2}}\]  
where \(y_{i}\) and \(\hat{y}_{i}\) are the measured and predicted values of the response variable, and \(n\) is the number of samples. \(RMSE\) is in the same units as the response variable (i.e., kWh). Lower \(RMSE\) values indicate a better, lower predicted error. Because the error can be quite large in magnitude (\(10^{0}\) to \(10^{10}\)), a logarithmic transform is applied to facilitate evaluations. Because the magnitude of the error is closely connected to a site's capacity, the \(\log RMSE\) cannot be used to compare model performance between sites unless the sites are similar in size. The coefficient of determination (\(R^{2}\)), however, can be used to compare model performance across different site sizes. Specifically, \(R^{2}\) is calculated as:  
\[R^{2}=1-\frac{\sum(y_{i}-\hat{y}_{i})^{2}}{\sum(y_{i}-\hat{y})^{2}}, \tag{5}\]  
where \(\hat{y}\) is the average of the \(y\) values. \(R^{2}\) denotes the proportion of variability in the response explained by the model with a value of 1, indicating a perfect fit. \(R^{2}\) was used to compare trained model outputs with partner-generated expected energy values, whose underlying model structures were unknown. Generally, however, \(R^{2}\) is not well-suited for comparing models across varying numbers of parameters. Thus, when comparing the 13 trained models to one another, we utilize an adjusted \(R^{2}_{adj}\) metric, which checks whether the added parameters contribute to the explanation of the predictor variable and penalizes models with unnecessary complexity [34]. Low-effect parameters (i.e., \(\beta\approx 0\)) reduce the model's overall fit score. The adjusted \(R^{2}_{adj}\) is calculated as follows:  
\[R^{2}_{adj}=1-(\frac{(1-R^{2})(n-1)}{n-p-1}), \tag{6}\]  
where \(n\) is the number of samples, and \(p\) is the number of predictors. \begin{table}
\begin{tabular}{l l l l l} \hline \hline
**Model Category** & **Time Variables (\(b\))** & **Interaction Degree (\(d\))** & **Number Parameters for M Inputs** & **Number Parameters for 2 Inputs** \\ \hline Additive & & & \(M+1\) & 3 \\ \hline Additive with interaction & & 2 nd-order (\(d=2\)) & \(M+2\) & 4 \\ \hline Additive with Time-weighted & Season (\(t=4\)) & & \(tM+1\) & 9 \\  & Month (\(t=12\)) & & 25 \\  & Hour (\(t=15^{*}\)) & & 31 \\ \hline Polynomial & & 2 nd-order (\(d=2\)) & \(\sum\limits_{i=1}^{d}C^{\xi}(M,i)+1\) & 6 \\  & 3 rd-order (\(d=3\)) & \(\sum\limits_{i=1}^{d}C^{\xi}(M,i)+1\) & 10 \\ \hline Polynomial with Time-weighted & Season (\(t=4\)) & 2 nd-order (\(d=2\)) & & 4 = 25 & 41 \\  & Month (\(t=12\)) & 3 rd-order (\(d=3\)) & \(t\sum\limits_{i=1}^{d}C^{\xi}(M,i)+1\) & t = 12 & 73 & 121 \\  & Hour (\(t=15^{*}\)) & & & t = 15 & 90 & 151 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Combinations of parameters used to initiate the 13 regression kernels evaluated in this study. The simple additive model attaches a parameter to each predictor variable to evaluate individual effects. * For hourly temporal conditions, only 15 h are used to reflect daytime hours. Finally, \(\delta\) was used to capture the directionality of error (i.e., overprediction vs. underprediction):  
\[\delta=100\times\frac{\hat{y}-y}{y}. \tag{7}\]  
The \(\log RMSE\) and \(R^{2}\) were implemented to evaluate model performance at both site and fleet (i.e., across multiple sites) levels, while \(\delta\) was only implemented at the fleet level; all metrics were reported on the test dataset.