A good trick (I discovered accidentally) is to use the weight
![]() |
(16) |
| |
(17) |
![]() |
Because the second derivative is not positive everywhere,
the Cauchy function introduces the possibility of multiple solutions,
but because of the good results we see in Figure 4,
you might like to try it anyway.
Perhaps the reason it seems to work so well is that
it uses mostly residuals of ``average size,''
not the big ones or the small ones.
This happens because
is made from
and
the components of
which are a function
that is maximum for those residuals near
.
Module irls
supplies two useful
weighting functions that can be interchanged as arguments to the
reweighted scheme
.
module irls {
use quantile_mod
contains
integer function l1 (res, weight) {
real, dimension (:) :: res, weight
real :: rbar
rbar = quantile( int( 0.5*size(res)), abs (res)) # median
weight = 1. / sqrt( sqrt (1. + (res/rbar)**2)); l1 = 0
}
integer function cauchy (res, weight) {
real, dimension (:) :: res, weight
real :: rbar
rbar = quantile( int( 0.5*size(res)), abs (res)) # median
weight = 1. / sqrt (1. + (res/rbar)**2); cauchy = 0
}
}