TABLE OF CONTENTS
makeLikelihood/mklik.weight.haz [ Functions ]
NAME
mklik.weight.haz --- likelihood of weight of spline component for hazard
FUNCTION
Compute loglikelihood of relative weight of spline and parametric components if the hazard curve has both.
SYNOPSIS
2481 mklik.weight.haz <- 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
2484 { 2485 hazard$weight <- weight 2486 hazard <- weightcurve(hazard) 2487 status <- regression$status 2488 lp <- regression$lp 2489 frailrep <- rep(frailty$x, regression$Ji) 2490 # point process likelihood 2491 lik <- sum(status * log(hazard$y) - frailrep * hazard$ycum * exp(lp)) 2492 # prior on the weight 2493 lik <- lik + (hazard$weight.hyper[1] - 1) * log(hazard$weight) + 2494 (hazard$weight.hyper[2] - 1) * log(1 - hazard$weight) 2495 return(lik) 2496 }