NewLemma1              package:NPBayes              R Documentation

_C_o_m_p_u_t_e _t_h_e _C_o_n_d_i_t_i_o_n_a_l _E_x_p_e_c_t_a_t_i_o_n _g_i_v_e_n _l_e_f_t _t_r_u_n_c_a_t_e_d _a_n_d 
_r_i_g_h_t _c_e_n_s_o_r_e_d _o_b_s_e_r_v_a_t_i_o_n_s

_D_e_s_c_r_i_p_t_i_o_n:

     This function will compute the  expectation of  P[u, infty) prod
     P[x_i , infty)/P[y_i, infty) , assuming the distribution function
     is distributed as a Dirichlet process prior. (assume  x_i  are all
     right censored.)

     Similar to 'Lemma1' except the term involve  y_i . 

     The data must be nonnegative. We assume F(0)=0.

_U_s_a_g_e:

     NewLemma1(B, theta, u=numeric(0), y, x, d)

_A_r_g_u_m_e_n_t_s:

       B: a positive number. The parameter for the Dirichlet process
          prior,  the weight of prior information. If B is very small,
          then the resulting prior is "non-informative". 

   theta: a positive number. Another parameter for the Dirichlet
          process prior,  how quickly the probability decrease. The
          measure/parameter is  alpha [t, infty ) = B exp( - theta t) . 

       u: optional.  a non-negative number, where the expectation of 1-
          hat F(u) time  [1-F(x)]/[1-F(y)]  is to be computed. 

       y: vector holding the truncation times. 

       x: vector holding the right censored observations. 

       d: vectors holding the censoring indicators for x. 

_D_e_t_a_i_l_s:

     The parameter of the Dirichlet prior is a measure alpha: we took
     it to be alpha [t, infty) = B exp(- theta t). 

     If there are uncensored observations x, status=1,  then the
     theoretical expectation will include terms  like  alpha { x} .
     Since this is zero for our choice of the  alpha, we exclude those
     factor in the output.

     The observations must all be non-negative.

     The Bayes estimator is formed with the ratio of two such
     expectations, both of them include the term like  alpha { x} .

_V_a_l_u_e:

     a single value that is  the conditional expectation. If u is
     present then it includes a term  1- hat F(u) .   If there is
     uncensored data, then the product it return will exclude the
     factor  alpha {a_i} , which is zero under continuous measure. This
     do not matter when all we need is the  ratio of two such terms.
     They will be canceled in a ratio expression anyway. (this is the
     case for the Bayes estimator).

_A_u_t_h_o_r(_s):

     Mai Zhou.

_R_e_f_e_r_e_n_c_e_s:

     Susarla and Van Ryzin (1976) Nonparametric Bayesian estimation of
     survival curves from incomplete observations. _ J. Amer. Statist.
     Assoc._ *71*,  897-902.

     Zhou, M. (2000). Nonparametric Bayes estimator of survival
     functions for doubly/interval censored data. Tech Report, Univ. of
     Kentucky.  

     See also Zhou, M. (2004). Statistica Sinica. 

     Zhou and Luan (2004). Tech Report, Univ. Kentucky

_E_x_a_m_p_l_e_s:

     uncensored <- c(1,5,9)
     rightcensored <- c(4,7)
     NPBayes(B=12, theta=0.2, u=3.2, uncen=uncensored, rightcen=rightcensored)

     leftpt <- 0
     rightpt <- 3
     NPBayes(B=12, theta=0.2, u=3.2, uncen=uncensored, rightcen=rightcensored, 
     lefts = leftpt, rights = rightpt)

