TABLE OF CONTENTS


ZZdebug/rmklik.spline.haz [ Functions ]

NAME

    rmklik.spline.haz --- R re-implementation of the likelihood function in C

FUNCTION

For debugging only, works like cInitLikHazSpline.

SYNOPSIS

3282 rmklik.spline.haz <- function(spline.par, status, lp, frailrep, hazParY, 
3283     hazParYcum, weight, B, C, P, penaltyType, sigma2)

SOURCE

3286 {
3287     hazSplineY <- B%*%exp(spline.par)
3288     hazY <- weight * hazSplineY + (1 - weight) * hazParY
3289     hazSplineYcum <- C%*%exp(spline.par)
3290     hazYcum <- weight * hazSplineYcum + (1 - weight) * hazParYcum
3291     lik <- sum(status * log(hazY) - frailrep * hazYcum * exp(lp))
3292     lik <- as.numeric(lik)
3293     if(penaltyType == 1) lik <- lik - t((spline.par))%*%P%*%(spline.par) / (2 * sigma2)
3294     if(penaltyType == 2) lik <- lik - t(exp(spline.par))%*%P%*%exp(spline.par) / (2 * sigma2)
3295     return(lik)
3296 }