wle.gamma is a preliminary version; it 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), shape.tol=10,
use.smooth=TRUE, tol.int)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.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$, hence you can expect error from it. You can use shape.int and shape.tol to avoid them. It also use a fortran routine (dqagp) to calculate the smoothed model, i.e., evaluate an 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$.
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)
set.seed(1234)
x_rgamma(100,2,2)
wle.gamma(x)
x_c(rgamma(30,2,2),rgamma(100,20,20))
wle.gamma(x, boot=10, group=10, num.sol=2)Run the code above in your browser using DataLab