TABLE OF CONTENTS


ZZdebug/rmkgr.spline.haz [ Functions ]

NAME

    rmkgr.spline.haz --- R reimplementation of cInitGrHazSpline

FUNCTION

For debugging only, works like cInitGrHazSpline

SYNOPSIS

3344 rmkgr.spline.haz <- function(spline.par, status, lp, frailrep, hazParY, hazParYcum,
3345     weight, B, C, P, penaltyType, sigma2)

SOURCE

3348 {
3349     B <- matrix(B, length(lp), length(spline.par))
3350     C <- matrix(C, length(lp), length(spline.par))
3351     hazSplineY <- B%*%exp(spline.par)
3352     hazY <- weight * hazSplineY + (1 - weight) * hazParY
3353     hazSplineYcum <- C%*%exp(spline.par)
3354     hazYcum <- weight * hazSplineYcum + (1 - weight) * hazParYcum
3355     gr <- rep(0, length(spline.par))
3356     status = status / hazY
3357     lp = exp(lp) * frailrep
3358     gr <- gr + t(B)%*%status
3359     gr <- gr - t(C)%*%lp
3360     gr <- gr * exp(spline.par)
3361     return(gr)
3362 }