TABLE OF CONTENTS


fortranwrappers/fmkprofgr2 [ Functions ]

NAME

    fmkprofgr2 --- compute profile likelihood gradient

FUNCTION

Compute the gradient of the profile likelihood, conditional on the frailties and other parameters. This is just a Fortran wrapper for fprofgr that avoids unnecessary type conversions for speed. Most of the inputs need to have been converted into the row vectors required by FORTRAN.

SYNOPSIS

1825 fmkprofgr2 <- function(m, Ji, betahat, index, delta, times, Z, as, Uijmat, d, ncovs, nr, ns)

INPUTS

    m          number of clusters
    Ji         cluster sizes
    betahat    regression parameters at which the profile likelihood should be
               computed
    index      matrix of indices i,j,k,r,smin,smax for each row (integer)
    delta      vector of event indicators (double)
    times      vector of actual time span for each row (double)
    Z          matrix of covariates (as a double row vector)
    as         matrix of discretization breakpoints (double row vector)
    Uijmat     matrix of frailty estimates (double row vector)
    d          number of rows of Z
    ncovs      number of covariates
    nr         number of strata
    ns         number of breakpoints

OUTPUTS

    likgr      gradient of profile loglikelihood of betahat conditional 
               on the other parameters

SOURCE

1828 {
1829     gr <- rep(0, length(betahat))
1830     # Direct call to Fortran
1831     out <- .Fortran("fprofgr", betahat = as.double(betahat), index = index,
1832         delta = delta, times = times, Z = Z, as = as, Uijmat = Uijmat,
1833         d = d, ncovs = ncovs, nr = nr, ns = ns, m = as.integer(m),
1834         maxj = as.integer(max(Ji)), gr = gr)
1835     return(out$gr)
1836 }