TABLE OF CONTENTS


CmakeLikelihood/LikelihoodFrailty [ Functions ]

NAME

    LikelihoodFrailty --- likelihood of the frailty itself

FUNCTION

Compute frailty likelihoods as part of MH_Frail. See also mklik.frail

SYNOPSIS

1581 static inline double LikelihoodFrailty(int i, curveP hazard, curveP frailty, regressionP regression)

INPUTS

    i             index of the frailty whose likelihood should be evaluated
    hazard        CCurve for the hazard
    frailty       CCurve for the frailty
    regression    CRegression structure

OUTPUTS

    lik   loglikelihood of frailty->X[i]

SOURCE

1585 {
1586    double Ui = frailty->X[i];
1587    double lUi = log(Ui);
1588    double lik = 0;
1589    int c1 = 1;
1590    lik += log(frailty->Y[i]);
1591    int start = regression->Jicum[i];
1592    int n = regression->Jicum[i+1] - start;
1593    lik += lUi * F77_CALL(dasum)(&n, regression->status+start, &c1);
1594    lik -= Ui * ddotWrapper(n, hazard->Ycum+start, regression->elp+start);
1595    return(lik);
1596 }