TABLE OF CONTENTS


CmakeLikelihood/LikelihoodSplineHazard [ Functions ]

NAME

    LikelihoodSplineHazard --- likelihood of hazard spline parameters

FUNCTION

Compute loglikelihood of parameters for the spline component of the hazard curve. See also mklik.spline.haz.

SYNOPSIS

1713 static inline double LikelihoodSplineHazard(curveP hazard, curveP frailty, regressionP regression)

INPUTS

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

OUTPUTS

    lik    loglikelihood of hazard->SplinePar

SOURCE

1717 {
1718     double * frailelp = regression->frailelp;
1719     double * hazYcum = hazard->Ycum;
1720     
1721     // point process likelihood
1722     double lik = LikelihoodHazardLogSum(hazard->nx, regression->status, hazard->SplineY);
1723     lik -= ddotWrapper(regression->n, frailelp, hazard->SplineYcum);
1724     // smoothness penalty
1725     lik -= hazard->SplinePenaltyFactor[0]*SmoothnessPenalty(hazard); 
1726     // penalize parameters that are too small or too large
1727     for(int i=0; i<hazard->nj; i++) lik -= hazard->SplinePar[i]<hazard->SplineMin[0] ?
1728         pow(hazard->SplinePar[i] - hazard->SplineMin[0],2) : 0.0;
1729     for(int i=0; i<hazard->nj; i++) lik += hazard->SplinePar[i] > MAX_PAR ? -INFINITY: 0.0; return lik;
1730 }