R/brier_score_on_censored_data.R

Defines functions brier_score_on_censored_data

#' @export

brier_score_on_censored_data <- function(times, delta, estimated_y0s, estimated_mus, number_of_time_points=1000) {
  brier_times <- seq(from=0.1, to=max(times), length.out=number_of_time_points)
  brier_scores <- sapply(brier_times, function(time) {
    brier_score_with_censoring(time, times, delta, estimated_y0s, estimated_mus)
  })
  return(list(brier_times=brier_times, brier_scores=brier_scores))
}
vegarsti/fhtboost documentation built on Dec. 14, 2019, 10:44 p.m.