From 36e104a3ad2db11dbd0e8cb4bd73d837c1812daa Mon Sep 17 00:00:00 2001 From: Meyers-Im Date: Thu, 14 Mar 2024 23:54:01 -0700 Subject: [PATCH] report upper and lower bounds --- solardatatools/algorithms/loss_factor_analysis.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/solardatatools/algorithms/loss_factor_analysis.py b/solardatatools/algorithms/loss_factor_analysis.py index 0723d4d9..270a2fed 100644 --- a/solardatatools/algorithms/loss_factor_analysis.py +++ b/solardatatools/algorithms/loss_factor_analysis.py @@ -39,6 +39,8 @@ def __init__( self.problem = self.make_problem(**kwargs) self.user_settings = kwargs self.degradation_rate = None + self.degradation_rate_lb = None + self.degradation_rate_ub = None self.energy_model = None self.log_energy_model = None self.total_energy_loss = None @@ -142,6 +144,8 @@ def estimate_degradation_rate( <= [median_tol, confidence_tol, confidence_tol] ) self.degradation_rate = np.median(output["deg"]) + self.degradation_rate_lb = np.quantile(output["deg"], 0.025, method=method) + self.degradation_rate_ub = np.quantile(output["deg"], 0.975, method=method) self.MC_results = {"samples": output, "running stats": running_stats} self.problem = self.make_problem(**self.user_settings) @@ -187,6 +191,8 @@ def report(self): if self.total_energy_loss is not None: out = { "degradation rate [%/yr]": self.degradation_rate, + "deg rate lower bound [%/yr]": self.degradation_rate_lb, + "deg rate upper bound [%/yr]": self.degradation_rate_ub, "total energy loss [kWh]": self.total_energy_loss, "degradation energy loss [kWh]": self.degradation_energy_loss, "soiling energy loss [kWh]": self.soiling_energy_loss,