el2.test.wts {emplik2} | R Documentation |
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,
sum_{dx_i=1} wx_i log{μ_i} + sum_{dy_j=1} wy_j log{nu_j} - eta ( 1 - sum_{dx_i=1} μ_i ) - delta ( 1 -sum_{dy_j=1} nu_j ) - λ sum_{dx_i=1} sum_{dy_j=1} ( g(x_i,y_j)- mean ) μ_i nu_j
where the variables are defined as follows:
x is a vector of data for the first sample
y is a vector of data for the second sample
wx is a vector of estimated weights for the first sample
wy is a vector of estimated weights for the second sample
μ is a vector of estimated probability jumps for the first sample
nu is a vector of estimated probability jumps for the second sample
el2.test.wts(u,v,wu,wv,mu0,nu0,indicmat,mean)
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 u |
wv |
a vector of estimated weights for v |
mu0 |
a vector of estimated probability jumps for u |
nu0 |
a vector of estimated probability jumps for v |
indicmat |
a matrix [g(u_i,v_j)-mean] where g(u, v) is a user-chosen function |
mean |
a hypothesized value of E(g(u,v)), where E indicates ``expected value.'' |
This function is called by el2.cen.EMs
. It is listed here because the user may find it useful elsewhere.
The value of mean should be chosen between the maximum and minimum values of (u_i,v_j); otherwise there may be no distributions for u and v that will satisfy the the mean-type hypothesis. If mean is inside this interval, but the convergence is still not satisfactory, then the value of mean should be moved closer to the NPMLE for E(g(u,v)). (The NPMLE itself should always be a feasible value for mean.) The calculations for this function are derived in Owen (2001).
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 u |
jumpu |
the vector of probability jumps for u that maximize the weighted empirical likelihood |
v |
the vector of uncensored data for the second sample |
wv |
the vector of weights for v |
jumpv |
the vector of probability jumps for v that maximize the weighted empirical likelihood |
lam |
the value of the Lagrangian multipler found by the calculations |
William H. Barton <bbarton@lexmark.com>
Owen, A.B. (2001). Empirical Likelihood
. Chapman and Hall/CRC, Boca Raton, pp.223-227.
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