rdtools.soiling.CODSAnalysis.run_bootstrap
- CODSAnalysis.run_bootstrap(reps=512, confidence_level=68.2, degradation_method='YoY', process_noise=0.0001, order_alternatives=(('SR', 'SC', 'Rd'), ('SC', 'SR', 'Rd')), cleaning_sensitivity_alternatives=(0.25, 0.75), clean_pruning_sensitivity_alternatives=(0.6666666666666666, 1.5), forward_fill_alternatives=(True, False), verbose=False, bootstrap_seed=None, **kwargs)
Bootstrapping of CODS algorithm for uncertainty analysis, inherently accounting for model and parameter choices.
First, calls on
iterative_signal_decomposition()
to fit N different models. Next, bootstrap samples are generated based on these N initial model fits. Each bootstrap sample is generated by bootstrapping the residuals of the respective model fit, using circular block bootstrapping, then multiplying these new residuals back onto the model. Then, for each bootstrap sample, model parameters are randomly chosen and the CODS model is fit to the bootstrapped signal. The seasonal component is perturbed randomly and divided out, so as to capture its uncertainty. In the end, confidence intervals are calulated based on the percentile levels of the collection of bootstrapped model fits. The returned soiling ratio and rates are based on the best fit of the initial N models. See [1] for more details.- Parameters:
reps (int, default 512,) -- Number of bootstrap realizations to be run minimum N, where N is the possible combinations of model alternatives defined by possible combination of order_alternatives, cleaning_sensitivity_alternatives, clean_pruning_sensitivity_alternatives and forward_fill_alternatives.
confidence_level (float, default 68.2) -- The size of the confidence intervals to return, in percent
degradation_method (string, default 'YoY') -- Either 'YoY' or 'STL'. If anything else, 'YoY' will be assumed. Decides whether to use the YoY method [3] for estimating the degradation trend (assumes linear trend), or the STL-method (does not assume linear trend). The latter is slower.
order_alternatives (tuple of tuples, default (('SR', 'SC', 'Rd'), ('SC', 'SR', 'Rd'))) -- Component estimation orders that will be tested during initial model fitting.
cleaning_sensitivity_alternatives (tuple, default (.25, .75)) -- Detection tuner values that will be tested during initial fitting. Length must be >= 1. First and last values define limits of values that will be used during bootstrapping.
clean_pruning_sensitivity_alternatives (tuple, default (1/1.5, 1.5)) -- Pruning tuner values that will be tested during initial fitting. Length must be >= 1. First and last values define limits of values that will be used during bootstrapping.
forward_fill_alternatives (tuple, default (True, False)) -- Forward fill values that will be tested during initial fitting.
verbose (bool, default False) -- Wheter or not to print information about progress
bootstrap_seed ({Generator, RandomState, int}, default None) -- Seed passed to CircularBlockBootstrap use to ensure reproducable results. If an int, passes the value to value to
np.random.default_rng
. If None (default), a fresh Generator is constructed with system-provided entropy.**kwargs -- Keyword arguments that are passed on to
iterative_signal_decomposition()
- Returns:
result_df (pandas.DataFrame with pandas datetimeindex) -- Contains the columns/keys:
Column Name
Description
'soiling_ratio'
soiling ratio (SR) (-)
'soiling_rates'
soiling rates (1/day)
'cleaning_events'
True at cleaning events
'seasonal_component'
seasonal component (SC)
'degradation_trend'
degradation trend (Rd)
'total_model'
the total model fit, i.e. SR * SC * Rd * rs, where SR is the soiling ratio, SC is the seasonal component, Rd is the degradation trend, and rs is the residual shift, i.e. the mean of the residuals (adjusting the position of the model fit to the position of the input data)
'residuals'
The residuals of the model fit, i.e. PI / (SR * SC * Rd)
'SR_low'
lower bound of 95 % conf. interval of SR
'SR_high'
upper bound of 95 % conf. interval of SR
'rates_low'
lower bound of 95 % conf. interval of soiling rates
'rates_high'
upper bound of 95 % conf. interval of soiling rates
'bt_soiling_ratio'
Bootstrapped estimate of soiling ratio (SR)
'bt_soiling_rates'
Bootstrapped estimate of soiling rates
'seasonal_low'
lower bound of 95 % conf. interval of seasonal component (SC)
'seasonal_high'
upper bound of 95 % conf. interval of seasonal component (SC)
'model_high'
upper bound of 95 % confidence interval of the model fit
'model_low'
lower bound of 95 % confidence interval of the model fit
degradation (list) -- List of linear degradation rate of system in %/year, lower and upper bound of confidence interval.
soiling_loss (list) -- List of average soiling losses over the time series in %, lower and upper bound of confidence interval.
References