Calculates the Integrated Graf Score, aka integrated Brier score or squared loss.

For an individual who dies at time \(t\), with predicted Survival function, \(S\), the Graf Score at time \(t^*\) is given by $$L(S,t|t^*) = [(S(t^*)^2)I(t \le t^*, \delta = 1)(1/G(t))] + [((1 - S(t^*))^2)I(t > t^*)(1/G(t^*))]$$ where \(G\) is the Kaplan-Meier estimate of the censoring distribution.

Note: If comparing the integrated graf score to other packages, e.g. `pec::pec()`

, then
`method = 2`

should be used, however the results may still be very slightly different as
this package uses `survfit`

to estimate the censoring distribution, in line with the Graf 1999 paper.
Whereas some other packages use `prodlim`

with `reverse = TRUE`

(meaning Kaplan-Meier is not used).

If `integrated == FALSE`

then the sample mean is taken for the single specified `times`

, \(t^*\), and the returned
score is given by
$$L(S,t|t^*) = \frac{1}{N} \sum_{i=1}^N L(S_i,t_i|t^*)$$
where \(N\) is the number of observations, \(S_i\) is the predicted survival function for
individual \(i\) and \(t_i\) is their true survival time.

If `integrated == TRUE`

then an approximation to integration is made by either taking the sample
mean over all \(T\) unique time-points (`method == 1`

), or by taking a mean weighted by the difference
between time-points (`method == 2`

). Then the sample mean is taken over all \(N\) observations.
$$L(S) = \frac{1}{NT} \sum_{i=1}^N \sum_{j=1}^T L(S_i,t_i|t^*_j)$$

This Measure can be instantiated via the dictionary mlr_measures or with the associated sugar function msr():

MeasureSurvGraf$new() mlr_measures$get("surv.graf") msr("surv.graf")

Type:

`"surv"`

Range: \([0, \infty)\)

Minimize:

`TRUE`

Required prediction:

`distr`

Graf E, Schmoor C, Sauerbrei W, Schumacher M (1999).
“Assessment and comparison of prognostic classification schemes for survival data.”
*Statistics in Medicine*, **18**(17-18), 2529--2545.
doi: 10.1002/(sici)1097-0258(19990915/30)18:17/18<2529::aid-sim274>3.0.co;2-5
.

Other survival measures:
`MeasureSurvBeggC`

,
`MeasureSurvChamblessAUC`

,
`MeasureSurvGonenC`

,
`MeasureSurvGrafSE`

,
`MeasureSurvHarrellC`

,
`MeasureSurvHungAUC`

,
`MeasureSurvIntLoglossSE`

,
`MeasureSurvIntLogloss`

,
`MeasureSurvLoglossSE`

,
`MeasureSurvLogloss`

,
`MeasureSurvMAESE`

,
`MeasureSurvMAE`

,
`MeasureSurvMSESE`

,
`MeasureSurvMSE`

,
`MeasureSurvNagelkR2`

,
`MeasureSurvOQuigleyR2`

,
`MeasureSurvRMSESE`

,
`MeasureSurvRMSE`

,
`MeasureSurvSongAUC`

,
`MeasureSurvSongTNR`

,
`MeasureSurvSongTPR`

,
`MeasureSurvUnoAUC`

,
`MeasureSurvUnoC`

,
`MeasureSurvUnoTNR`

,
`MeasureSurvUnoTPR`

,
`MeasureSurvXuR2`

Other Probabilistic survival measures:
`MeasureSurvGrafSE`

,
`MeasureSurvIntLoglossSE`

,
`MeasureSurvIntLogloss`

,
`MeasureSurvLoglossSE`

,
`MeasureSurvLogloss`

Other distr survival measures:
`MeasureSurvGrafSE`

,
`MeasureSurvIntLoglossSE`

,
`MeasureSurvIntLogloss`

,
`MeasureSurvLoglossSE`

,
`MeasureSurvLogloss`

`mlr3::Measure`

-> `mlr3proba::MeasureSurv`

-> `mlr3proba::MeasureSurvIntegrated`

-> `MeasureSurvGraf`

`new()`

Creates a new instance of this R6 class.

MeasureSurvGraf$new(integrated = TRUE, times, method = 2)

`integrated`

(

`logical(1)`

)

If`TRUE`

(default), returns the integrated score; otherwise, not integrated.`times`

(

`numeric()`

)

If`integrate == TRUE`

then a vector of time-points over which to integrate the score. If`integrate == FALSE`

then a single time point at which to return the score.`method`

(

`integer(1)`

)

If`integrate == TRUE`

selects the integration weighting method.`method == 1`

corresponds to weighting each time-point equally and taking the mean score over discrete time-points.`method == 2`

corresponds to calculating a mean weighted by the difference between time-points.`method == 2`

is default to be in line with other packages.

`clone()`

The objects of this class are cloneable with this method.

MeasureSurvGraf$clone(deep = FALSE)

`deep`

Whether to make a deep clone.