| wle.gamma {wle} | R Documentation |
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)
x |
a vector contain the observations. |
boot |
the number of starting points based on boostrap subsamples to use in the search of the roots. |
group |
the dimension of the bootstap subsamples. The default value is max(round(size/4),var) where size is the number of observations and var is the number of variables. |
num.sol |
maximum number of roots to be searched. |
raf |
type of Residual adjustment function to be use:
raf="HD": Hellinger Distance RAF,
raf="NED": Negative Exponential Disparity RAF,
raf="SCHI2": Symmetric Chi-Squared Disparity RAF. |
smooth |
the value of the smoothing parameter. |
tol |
the absolute accuracy to be used to achieve convergence of the algorithm. |
equal |
the absolute value for which two roots are considered the same. (This parameter must be greater than tol). |
max.iter |
maximum number of iterations. |
shape.int |
a 2 dimension vector for the interval search of the shape parameter at the first iteration. |
shape.tol |
the length of the interval search used in the successive iterations for the shape parameter. |
use.smooth |
if FALSE the unsmoothed model is used. This is usefull when the integration routine does not work well. |
tol.int |
the absolute accuracy to be used in the integration routine. The default value is tol*10^{-4}. |
The gamma is parametrized as follows (α = scale, omega = shape):
f(x) = 1/(α^omega Gamma(omega)) x^(omega-1) e^-(x/α)
for x > 0, α > 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.
wle.gamma returns an object of class "wle.gamma".
Only print method is implemented for this class.
The object returned by wle.gamma are:
shape |
the estimator of the shape parameter, one value for each root found. |
scale |
the estimator of the scale parameter, one value for each root found. |
tot.weights |
the sum of the weights divide by the number of observations, one value for each root found. |
weights |
the weights associated to each observation, one column vector for each root found. |
call |
the match.call(). |
tot.sol |
the number of solutions found. |
not.conv |
the number of starting points that does not converge after the max.iter iteration are reached. |
Claudio Agostinelli
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) 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)