| ML2Inf {missreg} | R Documentation |
A sub-function called by MLInf to provide the value, score vector and
information matrix at theta for the so-called profile loglikelihood
l*(theta, Q) within each stratum with stratified two-phase
sampled data. It reduces to an unstratified approach when nstrata=1.
ML2Inf(theta, nderivs = 2, ProspModInf, StratModInf, x, y, Aposn,
Acounts, Bposn, Bcounts, rvec, Qs, usage = "thetaonly",
thetaparts = 0, paruse = "auto", inxStrat,
off.set = matrix(0, dim(x)[1], dim(x)[3]),
control.inner = mlefn.control.inner(...), ...)
theta |
Starting values for parameters theta in the regression
model unless usage below is "combined", in which case theta
should contain starting values for the theta parameters followed by starting
values fo the rho or xi parameters (which will be stripped off on entry
to the function). |
nderivs |
Number of derivatives to be calculated. Either 0 (loglikelihood value only), 1 (also return score vector), or 2 (also return information matrix). |
ProspModInf |
A class of sub-functions called by ML2Inf to supply
values and their derivatives for the first (A) part of the loglikelihood regarding
to the model of interest. |
StratModInf |
A class of sub-functions called by ML2Inf to supply
values and their derivatives for the third (B) part of the loglikelihood
regarding to the h-distribution at the first phase. |
x |
See MEtaProspModInf. |
y |
See MEtaProspModInf. |
Aposn |
A vector specifying the positions of those observations contributed to the A part of the loglikelihood in the data matrix. |
Acounts |
A vector specifying the frequency of each observation (n_i)
contributed to the A part of the loglikelihood. |
Bposn |
A vector specifying the positions of those observations contributed to the B part of the loglikelihood in the data matrix. |
Bcounts |
A vector specifying the frequency of each observation (m_j)
contributed to the B part of the loglikelihood. |
rvec |
The r_k^(s) in the loglikelihood. |
Qs |
The Q_k^(s) in the loglikelihood. |
usage |
Work with and report results for the following three conditions:
(1) "thetaonly" (profile other parameters); (2) "combined" (fit both
theta and rho/xi simultaneously); and (3) "Qfixed" (fix other parameters). |
thetaparts |
A vector of length 2 specifying the number of theta and rho/xi
parameters as appropriate; Used only if usage="combined". |
paruse |
The choice of using either rho or xi parameters as follows:
(1) "rhos"; (2) "xis"; or (3) "auto" (function to choose the rho's
if no more than one r_k^(s)=0 and the xi's otherwise). Any other string is treated
as the last option. |
inxStrat |
Optional to enable printing a diagnostic when ML2Inf fails
and has been called from MLInf. |
off.set |
See MEtaProspModInf. |
control.inner |
Specify control parameters for inner iterations nested within
the mlefn function call. |
... |
Further arguments passed to or from related functions. |
This is the core function at the distrete partition version to calculate the value,
score vector and observed information matrix at theta for the so-called profile
loglikelihood l*^(s)(theta,Q^(s)). It is an inner function called by MLInf
to supply values of l* and its derivatives within each s-stratum.
See "Description of the missreg Library" for more details.
A list with the following components.
loglk |
Log-likelihood obtained from the current theta values. |
score |
Score vector obtained from the current theta values when
nderivs>=1; NULL otherwise. |
inf |
Observed information matrix obainted from the current theta
values when nderivs=2; NULL otherwise. |
Qs |
A vector of length K providing values for Q_k^(s) either as
its entry values or updated from the inner iterative process when r_k^(s) is
not equal to 0 and usage="thetaonly". |
Chris Wild, Yannan Jiang
Description of the missreg Library, Wild and Jiang, 2007.