wle.gamma
is used to robust estimate the shape and the scale parameters via Weighted Likelihood, when the majority of the data are from a gamma distribution.
wle.gamma(x, boot=30, group, num.sol=1, raf="HD", smooth=0.008, tol=10^(-6), equal=10^(-3), max.iter=500, shape.int=c(0.01, 100), use.smooth=TRUE, tol.int, verbose=FALSE, maxiter=1000)
raf="HD"
: Hellinger Distance RAF,
raf="NED"
: Negative Exponential Disparity RAF,
raf="SCHI2"
: Symmetric Chi-Squared Disparity RAF.
tol
).FALSE
the unsmoothed model is used. This is usefull when the integration routine does not work well.TRUE
warnings are printed.uniroot
function.wle.gamma
returns an object of class
"wle.gamma"
.Only print method is implemented for this class.The object returned by wle.gamma
are:max.iter
iteration are reached.$f(x) = 1/(\alpha^\omega Gamma(\omega)) x^(\omega-1) e^-(x/\alpha)$
for $x > 0$, $\alpha > 0$ and $\omega > 0$.
The function use uniroot
to solve the estimating equation
for $shape$, errors from uniroot
are handled by
try
. If errors occurs then the function returns NA
.
You can use shape.int
to avoid them. It also use a fortran routine (dqagp) to calculate the smoothed model, i.e., evaluate the integral. Sometime the accuracy is not satisfactory, you can use use.smooth=FALSE
to have an approximate estimation using the model instead of the smoothed model.
The Folded Normal distribution is use as kernel. The bandwith is $smooth*shape/scale^2$.
Markatou, M., Basu, A. and Lindsay, B.G., (1998). Weighted likelihood estimating equations with a bootstrap root search, Journal of the American Statistical Association, 93, 740-750.
Agostinelli, C., (1998). Inferenza statistica robusta basata sulla funzione di verosimiglianza pesata: alcuni sviluppi, Ph.D Thesis, Department of Statistics, University of Padova.
library(wle)
x <- rgamma(n=100, shape=2, scale=2)
wle.gamma(x)
x <- c(rgamma(n=30, shape=2, scale=2), rgamma(n=100, shape=20, scale=20))
wle.gamma(x, boot=10, group=10, num.sol=2) # depending on the sample, one or two roots.
Run the code above in your browser using DataLab