R/plloss.R

Defines functions plloss

Documented in plloss

plloss <- function(event, f, Ri) {
    n <- length(event)
    if (length(f) == 1) {
        f <- rep(f, n)
    }
    ef <- exp(f)
    risk <- do.call(c, lapply(X = Ri, FUN = helpfunctionmultistate1, ef = ef))
    lpl <- sum(event * (f - log(risk)))
    return(lpl)}

Try the gamboostMSM package in your browser

Any scripts or data that you put into this service are public.

gamboostMSM documentation built on May 6, 2022, 9:06 a.m.