code: def _calc_incremental_mean_std(series, end, window_size):
      stds = np.zeros(end)
      window = series[0:window_size]
      series_sum = np.sum(window)
      square_sum = np.sum(np.multiply(window, window))
  
      r_window_length = 1.0 / window_size
      mean = series_sum * r_window_length
      buf = math.sqrt(
          max(square_sum * r_window_length - mean * mean, 0.0)
      )
      stds[0] = buf if buf > 1e-8 else 1e-8
  
      for w in range(1, end):
          series_sum += series[w + window_size - 1] - series[w - 1]
          mean = series_sum * r_window_length
          square_sum += (
              series[w + window_size - 1] * series[w + window_size - 1]
              - series[w - 1] * series[w - 1]
          )
          buf = math.sqrt(
              max(square_sum * r_window_length - mean * mean, 0.0)
          )
          stds[w] = buf if buf > 1e-8 else 1e-8
  
      return stds
  
file_path: sktime/sktime/transformations/panel/dictionary_based/_sfa_fast_numba.py
imports: import math
  from warnings import simplefilter
  import numpy
  from sktime.utils.numba.njit import njit
  from sktime.utils.validation._dependencies import _check_soft_dependencies
label_desc: Use image node_id 5 for calling a global function with example usage: _calc_incremental_mean_std(series, end, window_size) and returns: stds