TABLE OF CONTENTS


CmakeLikelihood/LikelihoodSplineFrailty [ Functions ]

NAME

    LikelihoodSplineFrailty --- likelihood of frailty spline parameters

FUNCTION

Compute loglikelihood of parameters for the spline component of the frailty curve. See also mklik.spline.frail.

SYNOPSIS

1747 static inline double LikelihoodSplineFrailty(curveP hazard, curveP frailty, regressionP regression)

INPUTS

    hazard        CCurve for the hazard
    frailty       CCurve for the frailty
    regression    CRegression structure

OUTPUTS

    lik    loglikelihood of frailty->SplinePar

SOURCE

1751 {
1752     // sum of log-hazards
1753     double lik =  LikelihoodFrailtyLogSum(frailty->nx, frailty->SplineY);
1754     // smoothness penalty
1755     lik -= frailty->SplinePenaltyFactor[0]*SmoothnessPenalty(frailty); 
1756     // penalize parameters that are too small or too big
1757     for(int i=0; i<frailty->nj; i++) lik -= frailty->SplinePar[i]<frailty->SplineMin[0] ?
1758         pow(frailty->SplinePar[i] - frailty->SplineMin[0],2) : 0.0;
1759     for(int i=0; i<frailty->nj; i++) lik += frailty->SplinePar[i] > MAX_PAR ? -INFINITY: 0.0; 
1760     return lik;
1761 }