class_docstr: Huber's proposal 2 for estimating location and scale jointly.
  
  Parameters
  ----------
  c : float, optional
      Threshold used in threshold for chi=psi**2.  Default value is 1.5.
  tol : float, optional
      Tolerance for convergence.  Default value is 1e-08.
  maxiter : int, optional0
      Maximum number of iterations.  Default value is 30.
  norm : statsmodels.robust.norms.RobustNorm, optional
      A robust norm used in M estimator of location. If None,
      the location estimator defaults to a one-step
      fixed point version of the M-estimator using Huber's T.
  
  call
      Return joint estimates of Huber's scale and location.
  
  Examples
  --------
  >>> import numpy as np
  >>> import statsmodels.api as sm
  >>> chem_data = np.array([2.20, 2.20, 2.4, 2.4, 2.5, 2.7, 2.8, 2.9, 3.03,
  ...        3.03, 3.10, 3.37, 3.4, 3.4, 3.4, 3.5, 3.6, 3.7, 3.7, 3.7, 3.7,
  ...        3.77, 5.28, 28.95])
  >>> sm.robust.scale.huber(chem_data)
  (array(3.2054980819923693), array(0.67365260010478967))
class_docstr_tok: ["Huber","'s","proposal","2","for","estimating","location","and","scale","jointly",".","Parameters","--","--","--","--","--","c",":","float",",","optional","Threshold","used","in","threshold","for","chi=psi","*","*","2",".","Default","value","is","1.5.","tol",":","float",",","optional","Tolerance","for","convergence",".","Default","value","is","1e-08",".","maxiter",":","int",",","optional0","Maximum","number","of","iterations",".","Default","value","is","30.","norm",":","statsmodels.robust.norms.RobustNorm",",","optional","A","robust","norm","used","in","M","estimator","of","location",".","If","None",",","the","location","estimator","defaults","to","a","one-step","fixed","point","version","of","the","M-estimator","using","Huber","'s","T.","call","Return","joint","estimates","of","Huber","'s","scale","and","location",".","Examples","--","--","--","--",">",">",">","import","numpy","as","np",">",">",">","import","statsmodels.api","as","sm",">",">",">","chem_data","=","np.array","(","[","2.20",",","2.20",",","2.4",",","2.4",",","2.5",",","2.7",",","2.8",",","2.9",",","3.03",",","...","3.03",",","3.10",",","3.37",",","3.4",",","3.4",",","3.4",",","3.5",",","3.6",",","3.7",",","3.7",",","3.7",",","3.7",",","...","3.77",",","5.28",",","28.95","]",")",">",">",">","sm.robust.scale.huber","(","chem_data",")","(","array","(","3.2054980819923693",")",",","array","(","0.67365260010478967",")",")"]
docstr: Compute Huber's proposal 2 estimate of scale, using an optional
  initial value of scale and an optional estimate of mu. If mu
  is supplied, it is not reestimated.
  
  Parameters
  ----------
  a : ndarray
      1d array
  mu : float or None, optional
      If the location mu is supplied then it is not reestimated.
      Default is None, which means that it is estimated.
  initscale : float or None, optional
      A first guess on scale.  If initscale is None then the standardized
      median absolute deviation of a is used.
  
  Notes
  -----
  `Huber` minimizes the function
  
  sum(psi((a[i]-mu)/scale)**2)
  
  as a function of (mu, scale), where
  
  psi(x) = np.clip(x, -self.c, self.c)
docstr_tok: ["Compute","Huber","'s","proposal","2","estimate","of","scale",",","using","an","optional","initial","value","of","scale","and","an","optional","estimate","of","mu",".","If","mu","is","supplied",",","it","is","not","reestimated",".","Parameters","--","--","--","--","--","a",":","ndarray","1d","array","mu",":","float","or","None",",","optional","If","the","location","mu","is","supplied","then","it","is","not","reestimated",".","Default","is","None",",","which","means","that","it","is","estimated",".","initscale",":","float","or","None",",","optional","A","first","guess","on","scale",".","If","initscale","is","None","then","the","standardized","median","absolute","deviation","of","a","is","used",".","Notes","--","--","-","`","Huber","`","minimizes","the","function","sum","(","psi","(","(","a","[","i","]","-mu",")","\/scale",")","*","*","2",")","as","a","function","of","(","mu",",","scale",")",",","where","psi","(","x",")","=","np.clip","(","x",",","-self.c",",","self.c",")"]
code: def __call__(self, a, mu=None, initscale=None, axis=0):
      """
      Compute Huber's proposal 2 estimate of scale, using an optional
      initial value of scale and an optional estimate of mu. If mu
      is supplied, it is not reestimated.
  
      Parameters
      ----------
      a : ndarray
          1d array
      mu : float or None, optional
          If the location mu is supplied then it is not reestimated.
          Default is None, which means that it is estimated.
      initscale : float or None, optional
          A first guess on scale.  If initscale is None then the standardized
          median absolute deviation of a is used.
  
      Notes
      -----
      `Huber` minimizes the function
  
      sum(psi((a[i]-mu)/scale)**2)
  
      as a function of (mu, scale), where
  
      psi(x) = np.clip(x, -self.c, self.c)
      """
      a = np.asarray(a)
      if mu is None:
          n = a.shape[0] - 1
          mu = np.median(a, axis=axis)
          est_mu = True
      else:
          n = a.shape[0]
          mu = mu
          est_mu = False
  
      if initscale is None:
          scale = mad(a, axis=axis)
      else:
          scale = initscale
      scale = tools.unsqueeze(scale, axis, a.shape)
      mu = tools.unsqueeze(mu, axis, a.shape)
      return self._estimate_both(a, scale, mu, axis, est_mu, n)
  
file_path: statsmodels/statsmodels/robust/scale.py
imports: import numpy
  from scipy.stats import norm
  from statsmodels.tools import tools
  from statsmodels.tools.validation import array_like, float_like
  from .None import norms
  from ._qn import _qn
label_desc: Use image node_id 2 for calling the Huber obj's underlying member method code with example usage: obj.__call__(a, mu, initscale, axis) and returns: self