plr_bootstrap_uncertainty {PVplr} | R Documentation |
Bootstrap: Resampling data going into each Model
Description
This function determines the uncertainty of a PLR measurement through resampling data for each model, prior to putting the data through the model.
Usage
plr_bootstrap_uncertainty(
df,
n,
fraction = 0.65,
var_list,
model,
by = "month",
power_var = "power_var",
time_var = "time_var",
data_cutoff = 100,
np = NA,
pred = NULL
)
Arguments
df |
A dataframe containing pv data. |
n |
(numeric) Number of samples to take. The higher the n value, the longer it takes to complete, but the results become more accurate as well. |
fraction |
The fraction of data that constitutes a resample for the bootstrap. |
var_list |
A list of variables obtained through |
model |
the String name of the model to bootstrap. Select from:
|
by |
String, either "day", "week", or "month". Time over which to perform
|
power_var |
Variable name of power in the dataframe. This must be the variable's name after being put through your selected model. Typically power_var |
time_var |
Variable name of time in the dataframe. This must be the variable's name after being put through your selected model. Typically time_var |
data_cutoff |
The number of data points needed to keep a value in the final table. Regressions over less than this number and their data will be discarded. |
np |
The system's reported name plate power. See |
pred |
passed to predict_data in model call. See |
Value
Returns PLR value and uncertainty calculated with bootstrap of data going into power correction models
Examples
# build var_list
var_list <- plr_build_var_list(time_var = "timestamp",
power_var = "power",
irrad_var = "g_poa",
temp_var = "mod_temp",
wind_var = NA)
# Clean Data
test_dfc <- plr_cleaning(test_df, var_list, irrad_thresh = 100,
low_power_thresh = 0.01, high_power_cutoff = NA)
xbx_mbm_plr_uncertainty <- plr_bootstrap_uncertainty(test_dfc, n = 2,
fraction = 0.65, by = 'month',
power_var = 'power_var', time_var = 'time_var',
var_list = var_list, model = "xbx",
data_cutoff = 10, np = NA,
pred = NULL)