class_docstr: A wrapper around the statistics used to estimate deltas at a given scale.
class_docstr_tok: ["A","wrapper","around","the","statistics","used","to","estimate","deltas","at","a","given","scale","."]
docstr: Tunes the recency weight according to recent forecast losses.
  
  :param losses: List of recent losses.
  :param eta: Constant by which to scale the update to the recency weight.
      A bigger eta means more aggressive updates to the recency_weight.
code: def tune(self, losses: List[float], eta: float):
      """
      Tunes the recency weight according to recent forecast losses.
  
      :param losses: List of recent losses.
      :param eta: Constant by which to scale the update to the recency weight.
          A bigger eta means more aggressive updates to the recency_weight.
      """
      if self.velocity.n == 1:
          return
      tune_stats = [self.velocity, self.vel_var] + [
          self.acceleration
      ] * (self.acceleration.n > 1)
      for loss in losses:
          nerr = np.tanh(eta * loss)
          for stat in tune_stats:
              gap = (
                  1.0 - stat.recency_weight
                  if nerr > 0
                  else stat.recency_weight
              )
              stat.recency_weight += eta * gap * nerr
  
imports: import logging
  from math import floor
  from typing import Dict, List, Optional, Tuple, Union
  import numpy
  import pandas
  from merlion.utils.time_series import TimeSeries, UnivariateTimeSeries, assert_equal_timedeltas
  from merlion.utils.istat import ExponentialMovingAverage, RecencyWeightedVariance
  from merlion.utils.resample import to_pd_datetime, to_timestamp
  from merlion.transform.moving_average import LagTransform
  from merlion.transform.resample import TemporalResample
  from merlion.models.forecast.base import ForecasterBase, ForecasterConfig
label_desc: Use image node_id 6 for calling the DeltaStats obj's underlying member method code with example usage: obj.tune(losses, eta) without return types