In the IRWLS (iterative reweighted least square) procedure the value of
location and the value of the scale are updated in each step. In order to
find simultaneous estimates of location and dispersion we need to solve
the system of two equations
\sum_{i=1}^n \rho_\text{scale}\left( \frac{y_i - \hat{\mu}}{\hat{\sigma}}\right) = K.
In the two equations above we distinguish between \rho_\text{scale} used for scale estimation
and \psi_\text{loc} and its derivatives used for location. The two need
not be different and are, indeed, often the same. In this routine we
assume that they are the same and are specified in input parameter psifunc.
K corresponds to input parameter psifunc.kc1.
Given starting values \hat{\mu}_0 and \hat{\sigma}_0 the pair of reweighting equations moves forward from stage k using the calculations
[
1] Find the location weights
w_{i,k} = w\{(y_i - \hat{\mu}_k)/\hat{\sigma}_k\},
Note that in order to find the weights we need psifunc.c1, the tuning
constant associated to a nominal value of breakdown point or efficiency.
[
2] Calculate the new location estimate as
\hat{\mu}_{k+1} =
\sum_{i=1}^n w_{i,k}y_i / \sum_{i=1}^n w_{i,k}.
The new (squared) scale estimate is
[
3]
\hat{\sigma}^2_{k+1} = \hat{\sigma}^2_k\{{1}/(n K)\}\sum_{i=1}^n
\rho_\text{scale}\{(y_i - \hat{\mu}_{k+1})/\hat{\sigma}_k\}.
Note that in order to compute \rho_\text{scale} we need psifunc.c1, the
tuning constant associated to a nominal value of breakdown point or
efficiency. K corresponds to input parameter psifunc.kc1.
[
4] Return to Step 1 until the change in the estimates defined as
|\mu_{k+1}-\mu_{k}|/|\mu_{k}| + |\sigma_{k+1}-\sigma_{k}|/\sigma_{k}
is less than a
prespecified tolerance (optional input argument tol) or k
is equal to optional input parameter maxiter (maximum number of
iterations).
This alternating algorithm converges to a point with zero derivatives,
which may be a minimum, a maximum or a saddle point.