% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot.gg_brier.R
\name{plot.gg_brier}
\alias{plot.gg_brier}
\title{Plot a \code{\link{gg_brier}} object}
\usage{
\method{plot}{gg_brier}(x, type = c("brier", "crps"), envelope = FALSE, ...)
}
\arguments{
\item{x}{A \code{\link{gg_brier}} object.}

\item{type}{Which series to plot: \code{"brier"} (default) or
\code{"crps"}.}

\item{envelope}{Logical. When \code{TRUE}, overlays a ribbon spanning
the 15th-85th percentile of per-subject Brier (or running CRPS)
contributions at each time, around the overall line. When \code{FALSE}
(default), draws the overall series only.}

\item{...}{Extra arguments forwarded to \code{geom_line()}.}
}
\value{
A \code{ggplot} object.
}
\description{
Draws the time-resolved Brier score or the running CRPS from a
\code{\link{gg_brier}} object.  The curve moves across the event-time
grid on the x-axis; lower values mean the forest's predicted survival
probabilities are closer to what actually happened.  Think of
\code{0} as "perfect" and roughly \code{0.25} as "uninformative" -- a
forest that predicts \code{0.5} for every subject regardless of
prognosis would sit near that ceiling.
}
\details{
Set \code{envelope = TRUE} to add a ribbon around the overall curve
spanning the 15th to 85th percentile of the per-subject Brier
contributions at each time.  The ribbon shows how heterogeneous the
scoring is across subjects: a narrow ribbon means most subjects are
predicted equally well (or equally poorly); a wide ribbon means a
minority of subjects are driving the average.
}
\examples{
\donttest{
library(survival)   # Surv() must be on the search path for rfsrc()
data(pbc, package = "randomForestSRC")
rf <- randomForestSRC::rfsrc(Surv(days, status) ~ ., data = pbc,
                             nsplit = 10)
gg_dta <- gg_brier(rf)
plot(gg_dta)
plot(gg_dta, type = "crps")
plot(gg_dta, envelope = TRUE)   # adds 15-85\% envelope
}

}
\seealso{
\code{\link{gg_brier}},
\code{\link[randomForestSRC]{get.brier.survival}}
}
