Weight functions for optim_fit
. May be used when fit.method=="irwls"
or fit.method=="mle"
. Generally, not called by the user.
weights_varIdent(phi, mu)
weights_varExp(phi, mu)
weights_varPower(phi, mu)
weights_varConstPower(phi, mu)
weights_tukey_bw(phi = 4.685, resid)
weights_huber(phi=1.345, resid)
A vector of numeric weights.
Variance parameter(s)
Vector of means
Vector of model residuals
Steven Novick
weights_varIdent
returns a vector of ones.
weights_varExp
returns \(\exp(\phi*\mu)\)
weights_varPower
returns \(|\mu|^{\phi}\)
weights_varConstPower
returns \(\phi_1 + |\mu|^{\phi_2}\) where \(\phi_i =\phi\)[i]
weights_tukey_bw
is a Tukey bi-weight function. Let
$$r=\tfrac{|\text{resid}|}{\text{mad}(\text{resid},\text{center}=\text{TRUE})}.$$
Then this function returns
$$\left(1-\left(\tfrac{r}{\phi}\right)^2\right)^2\text{ whenever } r <= \phi\text{ and }0{ o.w.}$$
For this the user should use phi.fixed=TRUE
in the optim_fit
function.
weights_huber
is a Huber weighting function that returns \(\min(1, \phi/r)\), where \(r = |\text{resid}|/\text{sig}\) and \(\text{sig} = \text{mad}(\text{resid}, \text{center} = \text{TRUE})\). For this the user should use phi.fixed = TRUE
in the optim_fit
function.
optim_fit
, rout_fitter