TABLE OF CONTENTS


makeLikelihood/mklik.coef [ Functions ]

NAME

    mklik.coef --- likelihood of regression coefficients

FUNCTION

Compute the likelihood of regression coefficients, given everything else.

SYNOPSIS

2198 mklik.coef <- function(coef, hazard, frailty, regression)

INPUTS

    coef       regression coefficients to be evaluated
    hazard     RCurve for hazard
    frailty    RCurve for frailty
    regression RRegression structure

OUTPUTS

    lik    loglikelihood of coef

SOURCE

2201 {
2202     status <- regression$status
2203     regression <- updateregression(regression, coef)
2204     lp <- regression$lp
2205     frailrep <- rep(frailty$x, regression$Ji)
2206     # point process likelihood
2207     lik <- status%*%lp
2208     lik <- lik - sum(frailrep * hazard$ycum * exp(lp))
2209     # prior penalty
2210     lik <- lik - sum(coef^2) / (2 * regression$priorvar)
2211     return(as.numeric(lik))
2212 }