ML2directInf             package:missreg             R Documentation

_C_o_r_e _l_i_k_e_l_i_h_o_o_d _c_a_l_c_u_l_a_t_i_o_n _f_u_n_c_t_i_o_n _f_o_r _t_h_e _d_i_r_e_c_t _a_p_p_r_o_a_c_h

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

     A sub-function called by 'MLdirectInf' to provide the value, score
     vector  and information matrix at 'theta' for the so-called
     profile loglikelihood  'l_P(theta)' of the form 'l(theta, delta)'
     within each s-stratum with stratified two-phase sampled data. It
     reduces to an unstratified approach when nstrata=1.

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

     ML2directInf(theta, nderivs = 2, modelfn, hmodelfn, x, y, Aposn, 
                  Acounts, Bposn, Bcounts, hvalue, Cmult, delta, 
                  off.set = matrix(0, dim(x)[1], dim(x)[3]), inxStrat, 
                  control.inner = mlefn.control.inner(...), ...)

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

   theta: Starting values for parameters 'theta' in the regression
          model.

 nderivs: Number of derivatives to be calculated. Either 0
          (loglikelihood value only), 1 (also return score vector), or
          2 (also return information matrix). 

 modelfn: A class of sub-functions called by 'ML2directInf' to supply 
          values and their derivatives with respect to the 'eta's' (M
          linear predictors  with respect to 'theta') for the model of
          interest 'f(Y|X;theta)'.  

hmodelfn: A class of sub-functions called by 'ML2directInf' to supply
          values and their derivatives with respect to the 'eta's' for 
          'pr(h_k|x_j;theta)' under the same class of models. 

       x: A 3-dimensional array (R*C*M) specifying the covariates
          values, with R the number of observations, C the length of
          'theta' and M the number of  linear predictors used. 

       y: The response of interest, can be eitehr a vector or matrix. 

   Aposn: A vector specifying the positions of those observations with
          the set  of complete (x, y)-values from s-stratum. 

 Acounts: A vector specifying the frequency of each observation ('n_i')
          with the set of complete (x,y)-values from s-stratum. 

   Bposn: A vector specifying the positions of those observations with
          the  x-values observed in s-stratum; 'NULL' in prospective
          sampling.

 Bcounts: A vector specifying the frequency of each observation ('m_j')
          with the x-values observed in s-stratum; 'NULL' in
          prospective sampling.

  hvalue: The 'h_k^(s)' in the loglikelihood. 

   Cmult: The 'r_k^(s)' in the loglikelihood. 

   delta: The 'delta_j^(s)' in the loglikelihood. 

 off.set: The offset provided in a matrix form (R*M) with R the number
          of observations and M the number of linear predictors used. 

inxStrat: See 'ML2Inf'. 

control.inner: Specify control parameters for inner iterations nested
          within the 'mlefn' function call. See 'mlefn' for details.

     ...: Further arguments passed to or from related functions. 

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

     This is the core function in the direct approach to calculate the
     value, score vector and observed information matrix at 'theta' for
     the profile loglikelihood 'l_P(theta)' of the form 
      'l^(s)(theta,delta^(s))' within each s-stratum. 

      It is an inner function called by 'MLdirectInf'.

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

     A list with the following components. 

   loglk: Log-likelihood value obtained from the current 'theta'
          values.

   score: Score vector obtained from the current 'theta' values when
          'nderivs>=1'; 'NULL' otherwise.

     inf: Observed information matrix obtained from the current 'theta'
          values when 'nderivs=2'; 'NULL' otherwise.

   delta: A vector of length J providing values for 'delta_j^(s)'
          either as its entry values or updated from the inner
          iterative process when 'Bposn' is not 'NULL'.

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

     Chris Wild, Yannan Jiang

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

     Description of the 'missreg' Library, Wild and Jiang, 2007.

_S_e_e _A_l_s_o:

     'MLdirectInf'; 'ML2Inf'

