From 108ffdd3e454028b5b14fb69b3bc0c8d86ebe43f Mon Sep 17 00:00:00 2001 From: Ferdinand Schenck Date: Wed, 6 Apr 2022 19:10:32 +0200 Subject: [PATCH] Add trend number to parameter calculation --- bfast/monitor/python/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bfast/monitor/python/base.py b/bfast/monitor/python/base.py index ba496d7..ab8c689 100644 --- a/bfast/monitor/python/base.py +++ b/bfast/monitor/python/base.py @@ -255,7 +255,7 @@ def fit_single(self, y): err_cs = np.cumsum(y_error[ns - h:Ns + 1]) mosum_nn = err_cs[h:] - err_cs[:-h] - sigma = np.sqrt(np.sum(y_error[:ns] ** 2) / (ns - (2 + 2 * self.k))) + sigma = np.sqrt(np.sum(y_error[:ns] ** 2) / (ns - (1 + int(self.trend) + 2 * self.k))) mosum_nn = 1.0 / (sigma * np.sqrt(ns)) * mosum_nn mosum = np.repeat(np.nan, N - self.n)