Skip to contents

DUPLICATE: Hjort's beta-process posterior for right-censored survival is already implemented as morie_ghosal_survival_beta_process in ghsrv.R; this is an alias, not a second copy.

Usage

Npbsr(time, event = NULL, c = 1, lam0 = NULL)

Arguments

time

Observation times, possibly censored.

event

1 = event, 0 = censored; all events if NULL.

c

Prior concentration.

lam0

Exponential base hazard rate; 1 / mean(time) if NULL.

Value

List with estimate, times, S_post, H_post, c, lam0, n.

Details

Formula: with H ~ BP(c, H_0) the posterior is again a beta process and dH_post(t) = (c dH_0(t) + dN(t)) / (c + Y(t-)), so S_hat(t) = prod (1 - dH_post(s)). As c -> 0 this becomes the Kaplan-Meier estimator.

References

Hjort, N. L. (1990). Nonparametric Bayes estimators based on beta processes in models for life history data. Annals of Statistics, 18(3), 1259-1294. doi:10.1214/aos/1176347749

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
Npbsr(V)
#> $estimate
#> [1] 0.4812246
#> 
#> $times
#> [1] 1 2 3 4 5 6 7 8
#> 
#> $S_post
#> [1] 0.86419753 0.73216735 0.60432861 0.48122463 0.36359194 0.25249441 0.14962631
#> [8] 0.05818801
#> 
#> $H_post
#> [1] 0.1358025 0.2885802 0.4631834 0.6668871 0.9113316 1.2168871 1.6242945
#> [8] 2.2354056
#> 
#> $c
#> [1] 1
#> 
#> $lam0
#> [1] 0.2222222
#> 
#> $n
#> [1] 8
#> 
#> $method
#> [1] "Beta-process posterior survival (Hjort 1990)"
#>