TABLE OF CONTENTS


CWrappers/cmklik.spline.haz [ Functions ]

NAME

    cmklik.spline.haz --- spline hazard likelihood in C wrapper

FUNCTION

Wrapper for cInitLikHazSpline, likelihood function for use during initialization.

SYNOPSIS

3321 cmklik.spline.haz <- function(par, status, lp, frailrep, hazParY, hazParYcum, weight, 
3322         B, C, P, penaltyType, sigma2, min)

INPUTS

    par        vector of spline parameters whose likelihood should be computed
    status     vector of event indicators
    lp         vector of linear predictors, beta%*%Z
    frailrep   vector of frailties of same length as lp, repeated if necessary
    hazParY    parametric hazard evaluated at each of the event times
    hazParYcum parametric cumulative hazards
    weight     relative weight of parametric and spline component
    B          spline basis produced by csplinedesign
    C          cumulative spline basis produced by cevalCinte
    P          penalty matrix
    penaltyType    integer, see typePenalty
    sigma2     prior variance of spline parameters
    min        minimum allowed value of spline parameters

OUTPUTS

    lik        loglikelihood of par

SOURCE

3325 {
3326     lik <- as.double(rep(0, 1))
3327     out <- .C("cInitLikHazSpline",
3328             lik = lik, par = par, status = status, lp = lp, frailrep = frailrep,
3329             hazParY = hazParY, hazParYcum = hazParYcum, weight = weight, B = B, C = C, P = P,
3330             penaltyType = penaltyType, sigma2 = sigma2, ny = as.integer(length(lp)),
3331             nj = as.integer(length(par)), DUP = FALSE)
3332     lik <- out$lik
3333     lik <- lik - sum(ifelse(par< min, (par - min)^2, 0))    
3334     return(lik)
3335 }