Skip to contents

The DP posterior mean survival function interpolates between the prior and the data and converges to the KAPLAN-MEIER estimator as \(\alpha \to 0\) (Sec. 13.2) – the nonparametric Bayes answer becomes the classical frequentist one in the vanishing-prior limit. The maximum discrepancy is returned so the convergence is measured. Mirrors morie.fn.gh_c13_2.

Usage

morie_dp_survival(x, event = NULL, alpha = 1, g0_rate = NULL)

Arguments

x

observed times, non-negative.

event

1 for an event, 0 for right-censoring.

alpha

positive DP concentration.

g0_rate

rate of the exponential base measure.

Value

list: times, survival_dp, survival_km, max_abs_diff_to_km, alpha, limit_note, n_events, n, method.

References

Ghosal and van der Vaart, Sec. 13.2; Susarla and Van Ryzin (1976).

Examples

set.seed(1)
morie_dp_survival(rexp(50), alpha = 0.01)$max_abs_diff_to_km
#> [1] 2.250961e-05