Occasionally, PV data can include features such as saturation, failure, or strong seasonality that should be removed prior or during examination. This package includes feature correction methods addressing each of these.
Inverter saturation can throw off trends in the data as well. If you know the saturation limit of the inverter for your data, you can run this function to remove saturated data points.
<- plr_saturation_removal(test_dfc, var_list, sat_limit = 3000, power_thresh = 0.99) test_dfc_removed_saturation # fraction of data kept nrow(test_dfc_removed_saturation)/nrow(test_dfc) #>  0.994224
If a user knows or suspects that a period of system failure is present in the data, this package offers solutions for identifying and removing these data points. The method plr_failure_test filters data for particularly low correlation between power and irradiance, and then executes k-means clustering (with k=2) to identify a cluster of points which may indicate soiling. It has an option to group data by months or look over all data. The function removes data which is in the smaller cluster if the cluster indicates much lower power production per irradiance and accounts for a small (<.25) portion of the data.
# default values inserted for reference #df_failure <- plr_failure_test(test_dfc, var_list, corr_thresh = 0.95, plot = FALSE, by_month = FALSE) # fraction of data kept #nrow(df_failure)/nrow(test_dfc)
The method includes an option to plot slopes of day-by-day linear models of irradiance and power production against days. In order to plot, one must specify a file_path and file_name to save the plot under; it is not returned within the R environment. The generated boxplot is of those same slopes, visually identifying outliers which may represent failures or soiling.
Following power prediction, seasonality may still be apparent in the data. This is often the case in the XbX model, the data-driven nature of which is prone to leaving in seasonality. Decomposition, the statistical method of removing seasonality from data, can be performed on such power predicted data.
<- plr_decomposition(test_xbx_wbw_res, freq = 52, power_var = 'power_var', time_var = 'time_var', plot = FALSE, plot_file = NULL, title = NULL, data_file = NULL) test_xbx_wbw_decomp # generate a pretty table ::kable(test_xbx_wbw_decomp[1:5, ], caption = "XbX Week-by-Week Decomposition: Resulting Data")knitr
# make plots of the decomposed data <- ggplot2::ggplot(test_xbx_wbw_decomp, aes(age, raw)) + raw_plot geom_point() + geom_smooth( method = "lm") + theme_bw() <- ggplot2::ggplot(test_xbx_wbw_decomp, aes(age, trend)) + trend_plot geom_point() + geom_smooth( method = "lm") + theme_bw() <- ggplot2::ggplot(test_xbx_wbw_decomp, aes(age, seasonal)) + seasonal_plot geom_point() + geom_smooth( method = "lm") + theme_bw() raw_plot#> `geom_smooth()` using formula 'y ~ x'
trend_plot#> `geom_smooth()` using formula 'y ~ x'
seasonal_plot#> `geom_smooth()` using formula 'y ~ x'