From aeb7bd8a88ca68b5b53f38aa8b0e2d3f040c5d04 Mon Sep 17 00:00:00 2001 From: hagne Date: Mon, 4 Mar 2024 16:29:30 -0700 Subject: [PATCH] more features for the gam seasonality --- atmPy/general/statistics.py | 260 +++++++++++++++++++++++++++++++----- 1 file changed, 224 insertions(+), 36 deletions(-) diff --git a/atmPy/general/statistics.py b/atmPy/general/statistics.py index e675f98..93af6c9 100644 --- a/atmPy/general/statistics.py +++ b/atmPy/general/statistics.py @@ -8,6 +8,7 @@ import matplotlib.colors as _mcolors #import plt_tools as _plt_tools from atmPy.tools import array_tools as _array_tools +import atmPy.tools.plt_tool_kit.colors as _atmcols # from pygam import LinearGAM, pygam_s, pygam_l import datetime @@ -16,6 +17,8 @@ import matplotlib.lines as _mpllines import matplotlib.dates as _mpldates +import scipy.stats as scistats + class Statistics(object): def __init__(self, parent_ts): @@ -55,6 +58,8 @@ def __init__(self, parent_stats = None): self._seasonality_nsplines = None self._trend_lam = None self._trend_nsplines = None + self._prediction_grid_size = None + self._prediction_confidence = None self._rerun() @@ -63,7 +68,33 @@ def _rerun(self): self._prediction = None self._gam = None + @property + def prediction_confidence(self): + if isinstance(self._prediction_confidence, type(None)): + self._prediction_confidence = 0.95 + + return self._prediction_confidence + + @prediction_confidence.setter + def prediction_confidence(self,value): + assert(0