Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

crSurv

Non-parametric estimator of conditional survival function


Description

Non-parametric estimator of the conditional survival function of Y given X for censored data, see Akritas and Van Keilegom (2003).

Usage

crSurv(x, y, Xtilde, Ytilde, censored, h, 
       kernel = c("biweight", "normal", "uniform", "triangular", "epanechnikov"))

Arguments

x

The value of the conditioning variable X to evaluate the survival function at. x needs to be a single number or a vector with the same length as y.

y

The value(s) of the variable Y to evaluate the survival function at.

Xtilde

Vector of length n containing the censored sample of the conditioning variable X.

Ytilde

Vector of length n containing the censored sample of the variable Y.

censored

A logical vector of length n indicating if an observation is censored.

h

Bandwidth of the non-parametric estimator.

kernel

Kernel of the non-parametric estimator. One of "biweight" (default), "normal", "uniform", "triangular" and "epanechnikov".

Details

We estimate the conditional survival function

1-F_{Y|X}(y|x)

using the censored sample (\tilde{X}_i, \tilde{Y}_i), for i=1,…,n, where X and Y are censored at the same time. We assume that Y and the censoring variable are conditionally independent given X.

The estimator is given by

1-\hat{F}_{Y|X}(y|x) = ∏_{\tilde{Y}_i ≤ y} (1-W_{n,i}(x;h_n)/(∑_{j=1}^nW_{n,j}(x;h_n) I\{\tilde{Y}_j ≥ \tilde{Y}_i\}))^{Δ_i}

where Δ_i=1 when (\tilde{X}_i, \tilde{Y}_i) is censored and 0 otherwise. The weights are given by

W_{n,i}(x;h_n) = K((x-\tilde{X}_i)/h_n)/∑_{Δ_j=1}K((x-\tilde{X}_j)/h_n)

when Δ_i=1 and 0 otherwise.

See Section 4.4.3 in Albrecher et al. (2017) for more details.

Value

Estimates for 1-F_{Y|X}(y|x) as described above.

Author(s)

Tom Reynkens

References

Akritas, M.G. and Van Keilegom, I. (2003). "Estimation of Bivariate and Marginal Distributions With Censored Data." Journal of the Royal Statistical Society: Series B, 65, 457–471.

Albrecher, H., Beirlant, J. and Teugels, J. (2017). Reinsurance: Actuarial and Statistical Aspects, Wiley, Chichester.

See Also

Examples

# Set seed
set.seed(29072016)

# Pareto random sample
Y <- rpareto(200, shape=2)

# Censoring variable
C <- rpareto(200, shape=1)

# Observed (censored) sample of variable Y
Ytilde <- pmin(Y, C)

# Censoring indicator
censored <- (Y>C)

# Conditioning variable
X <- seq(1, 10, length.out=length(Y))

# Observed (censored) sample of conditioning variable
Xtilde <- X
Xtilde[censored] <- X[censored] - runif(sum(censored), 0, 1)

# Plot estimates of the conditional survival function
x <- 5
y <- seq(0, 5, 1/100)
plot(y, crSurv(x, y, Xtilde=Xtilde, Ytilde=Ytilde, censored=censored, h=5), type="l", 
     xlab="y", ylab="Conditional survival function")

ReIns

Functions from "Reinsurance: Actuarial and Statistical Aspects"

v1.0.10
GPL (>= 2)
Authors
Tom Reynkens [aut, cre] (<https://orcid.org/0000-0002-5516-5107>), Roel Verbelen [aut] (R code for Mixed Erlang distribution, <https://orcid.org/0000-0002-2347-9240>), Anastasios Bardoutsos [ctb] (Original R code for cEPD estimator), Dries Cornilly [ctb] (Original R code for EVT estimators for truncated data), Yuri Goegebeur [ctb] (Original S-Plus code for basic EVT estimators), Klaus Herrmann [ctb] (Original R code for GPD estimator)
Initial release
2020-05-16

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.