TABLE OF CONTENTS


makeLikelihood/mklik.weight.frail [ Functions ]

NAME

    mklik.weight.frail --- likelihood of weight of spline component for frailty

FUNCTION

Compute loglikelihood of relative weight of spline and parametric components if the frailty curve has both.

SYNOPSIS

2513 mklik.weight.frail <- function(weight, hazard, frailty, regression)

INPUTS

    weight     weight of the spline component (0<=weight<=1)
    hazard     RCurve for hazard
    frailty    RCurve for frailty
    regression RRegression structure

OUTPUTS

    lik        loglikelihood of weight

SOURCE

2516 {
2517     frailty$weight <- weight
2518     frailty <- weightcurve(frailty)
2519     # base likelihood
2520     lik <- sum(log(frailty$y))
2521     # prior on the weight
2522     lik <- lik + (frailty$weight.hyper[1] - 1) * log(frailty$weight) +
2523         (frailty$weight.hyper[2] - 1) * log(1 - frailty$weight)
2524     return(lik) 
2525 }