class_docstr: Huber's scaling for fitting robust linear models.
  
  Huber's scale is intended to be used as the scale estimate in the
  IRLS algorithm and is slightly different than the `Huber` class.
  
  Parameters
  ----------
  d : float, optional
      d is the tuning constant for Huber's scale.  Default is 2.5
  tol : float, optional
      The convergence tolerance
  maxiter : int, optiona
      The maximum number of iterations.  The default is 30.
  
  Methods
  -------
  call
      Return's Huber's scale computed as below
  
  Notes
  -----
  Huber's scale is the iterative solution to
  
  scale_(i+1)**2 = 1/(n*h)*sum(chi(r/sigma_i)*sigma_i**2
  
  where the Huber function is
  
  chi(x) = (x**2)/2       for \|x\| < d
  chi(x) = (d**2)/2       for \|x\| >= d
  
  and the Huber constant h = (n-p)/n*(d**2 + (1-d**2)*
  scipy.stats.norm.cdf(d) - .5 - d*sqrt(2*pi)*exp(-0.5*d**2)
class_docstr_tok: ["Huber","'s","scaling","for","fitting","robust","linear","models",".","Huber","'s","scale","is","intended","to","be","used","as","the","scale","estimate","in","the","IRLS","algorithm","and","is","slightly","different","than","the","`","Huber","`","class",".","Parameters","--","--","--","--","--","d",":","float",",","optional","d","is","the","tuning","constant","for","Huber","'s","scale",".","Default","is","2.5","tol",":","float",",","optional","The","convergence","tolerance","maxiter",":","int",",","optiona","The","maximum","number","of","iterations",".","The","default","is","30",".","Methods","--","--","--","-","call","Return","'s","Huber","'s","scale","computed","as","below","Notes","--","--","-","Huber","'s","scale","is","the","iterative","solution","to","scale_","(","i+1",")","*","*","2","=","1\/","(","n","*","h",")","*","sum","(","chi","(","r\/sigma_i",")","*","sigma_i","*","*","2","where","the","Huber","function","is","chi","(","x",")","=","(","x","*","*","2",")","\/2","for","\\|x\\|","<","d","chi","(","x",")","=","(","d","*","*","2",")","\/2","for","\\|x\\|",">","=","d","and","the","Huber","constant","h","=","(","n-p",")","\/n","*","(","d","*","*","2","+","(","1-d","*","*","2",")","*","scipy.stats.norm.cdf","(","d",")","-",".5","-","d","*","sqrt","(","2","*","pi",")","*","exp","(","-0.5","*","d","*","*","2",")"]
code: def __init__(self, d=2.5, tol=1e-08, maxiter=30):
      self.d = d
      self.tol = tol
      self.maxiter = maxiter
  
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 1 to create a new HuberScale object  with example: obj = HuberScale(d, tol, maxiter)