Generic method for obtaining the survival function of an object.

surv(x, ...)

Arguments

x

The object to obtain the survival function of.

...

Additional arguments to pass.

Value

A function computing the survival function S(t)=P(X>t).

Examples

x <- exponential(1)
S <- surv(x)
S(0)  # 1 (survival at time 0)
#> [1] 1
S(1)  # exp(-1), approximately 0.368
#> [1] 0.3678794