el2.test.wts {emplik2} | R Documentation |
Computes maximium-likelihood probability jumps for a single mean-type hypothesis, based on two independent uncensored samples
Description
This function computes the maximum-likelihood probability jumps for a single mean-type hypothesis, based on two samples that are independent, uncensored, and weighted. The target function for the maximization is the constrained log(empirical likelihood) which can be expressed as,
where the variables are defined as follows:
is a vector of data for the first sample
is a vector of data for the second sample
is a vector of estimated weights for the first sample
is a vector of estimated weights for the second sample
is a vector of estimated probability jumps for the first sample
is a vector of estimated probability jumps for the second sample
Usage
el2.test.wts(u,v,wu,wv,mu0,nu0,indicmat,mean,lamOld=0)
Arguments
u |
a vector of uncensored data for the first sample |
v |
a vector of uncensored data for the second sample |
wu |
a vector of estimated weights for |
wv |
a vector of estimated weights for |
mu0 |
a vector of estimated probability jumps for |
nu0 |
a vector of estimated probability jumps for |
indicmat |
a matrix |
mean |
a hypothesized value of |
lamOld |
The previous solution of lambda, used as the starting point to search for new solution of lambda. |
Details
This function is called by el2.cen.EMs
. It is listed here because the user may find it useful elsewhere.
The value of should be chosen between the maximum and minimum values of
; otherwise there may be no distributions for
and
that
will satisfy the the mean-type hypothesis. If
is inside this interval, but the convergence is
still not satisfactory, then the value of
should be moved closer to the NPMLE for
.
(The NPMLE itself should always be a feasible value for
.) The calculations for this function
are derived in Owen (2001).
Value
el2.test.wts
returns a list of values as follows:
u |
the vector of uncensored data for the first sample |
wu |
the vector of weights for |
jumpu |
the vector of probability jumps for |
v |
the vector of uncensored data for the second sample |
wv |
the vector of weights for |
jumpv |
the vector of probability jumps for |
lam |
the value of the Lagrangian multipler found by the calculations |
Author(s)
William H. Barton <bbarton@lexmark.com> and modified by Mai Zhou.
References
Owen, A.B. (2001). Empirical Likelihood
. Chapman and Hall/CRC, Boca Raton, pp.223-227.
Examples
u<-c(10, 209, 273, 279, 324, 391, 566, 785)
v<-c(21, 38, 39, 51, 77, 185, 240, 289, 524)
wu<-c(2.442931, 1.122365, 1.113239, 1.113239, 1.104113, 1.104113, 1.000000, 1.000000)
wv<-c( 1, 1, 1, 1, 1, 1, 1, 1, 1)
mu0<-c(0.3774461, 0.1042739, 0.09649724, 0.09649724, 0.08872055, 0.08872055, 0.0739222, 0.0739222)
nu0<-c(0.1013718, 0.1013718, 0.1013718, 0.1013718, 0.1013718, 0.1013718, 0.1095413, 0.1287447,
0.1534831)
mean<-0.5
#let fun=function(x,y){x>=y}
indicmat<-matrix(nrow=8,ncol=9,c(
-0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
-0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
-0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
-0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
-0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
-0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
-0.5, -0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
-0.5, -0.5, -0.5, -0.5, 0.5, 0.5, 0.5, 0.5,
-0.5, -0.5, -0.5, -0.5, -0.5, -0.5, 0.5, 0.5))
el2.test.wts(u,v,wu,wv,mu0,nu0,indicmat,mean)
# jumpu
# [1] 0.3774461, 0.1042739, 0.09649724, 0.09649724, 0.08872055, 0.08872055, 0.0739222, 0.0739222
# jumpv
# [1] 0.1013718, 0.1013718, 0.1013718, 0.1013718, 0.1013718, 0.1013718, 0.1095413, 0.1287447,
# [9] 0.1534831
# lam
# [1] 7.055471