optim_weights {OptimModel} | R Documentation |
Weight functions for optim_fit
Description
Weight functions for optim_fit
. May be used when fit.method=="irwls"
or fit.method=="mle"
. Generally, not called by the user.
Usage
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)
Arguments
phi |
Variance parameter(s) |
mu |
Vector of means |
resid |
Vector of model residuals |
Details
-
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. Letr=\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 theoptim_fit
function. weights_huber
is a Huber weighting function that returns\min(1, \phi/r)
, wherer = |\text{resid}|/\text{sig}
and\text{sig} = \text{mad}(\text{resid}, \text{center} = \text{TRUE})
. For this the user should usephi.fixed = TRUE
in theoptim_fit
function.
Value
A vector of numeric weights.
Author(s)
Steven Novick