Skip to content

curvefit.utils.smoothing.local_deviations

Computes standard deviation within a neighborhood of covariate values

Compute standard deviation of residuals within a neighborhood defined by col_axis. Optionally use the median absolute deviation as a robust estimator of the standard deviation.

Arguments

  • df (pd.DataFrame): Residual data frame.
  • col_val (str): Name for column that store the residual.
  • col_axis (List[str]): List of two axis column names.
  • axis_offset (List[int] | None, optional): List of offset for each axis to make it suitable as numpy array.
  • radius (List[int] | None, optional): List of the neighbor radius for each dimension.
  • robust (bool): use the median absolute deviation * 1.4826 as a robust estimator for the standard deviation

Returns

  • pd.DataFrame: return the data frame an extra column for the median absolute deviation within a range