el.test.wt {emplik} | R Documentation |
Weighted Empirical Likelihood ratio for mean, uncensored data
Description
This program is similar to el.test( )
except
it takes weights, and is for one dimensional mu.
The mean constraint considered is:
where is a probability.
Plus the probability constraint:
.
The weighted log empirical likelihood been maximized is
Usage
el.test.wt(x, wt, mu, usingC=TRUE)
Arguments
x |
a vector containing the observations. |
wt |
a vector containing the weights. |
mu |
a real number used in the constraint, weighted
mean value of |
usingC |
TRUE: use C function, which may be benifit when sample size is large; FALSE: use pure R function. |
Details
This function used to be an internal function. It becomes external because others may find it useful elsewhere.
The constant mu
must be inside
for the computation to continue.
Value
A list with the following components:
x |
the observations. |
wt |
the vector of weights. |
prob |
The probabilities that maximized the weighted empirical likelihood under mean constraint. |
Author(s)
Mai Zhou, Y.F. Yang for C part.
References
Owen, A. (1990). Empirical likelihood ratio confidence regions. Ann. Statist. 18, 90-120.
Zhou, M. (2002). Computing censored empirical likelihood ratio by EM algorithm. Tech Report, Univ. of Kentucky, Dept of Statistics
Examples
## example with tied observations
x <- c(1, 1.5, 2, 3, 4, 5, 6, 5, 4, 1, 2, 4.5)
d <- c(1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1)
el.cen.EM(x,d,mu=3.5)
## we should get "-2LLR" = 1.2466....
myfun5 <- function(x, theta, eps) {
u <- (x-theta)*sqrt(5)/eps
INDE <- (u < sqrt(5)) & (u > -sqrt(5))
u[u >= sqrt(5)] <- 0
u[u <= -sqrt(5)] <- 1
y <- 0.5 - (u - (u)^3/15)*3/(4*sqrt(5))
u[ INDE ] <- y[ INDE ]
return(u)
}
el.cen.EM(x, d, fun=myfun5, mu=0.5, theta=3.5, eps=0.1)