Learn R Programming

mos (version 0.1.3)

rpcens2: Generate Progressive Type-II Censored Samples

Description

This function generates progressive Type-II censored samples based on the algorithm provided by Balakrishnan and Sandhu (1995).

Usage

rpcens2(n, R, dist, ...)

Value

A numeric vector of size m, representing the failure times of the observed items.

Arguments

n

total number of items in the sample.

R

a vector of non-negative integers representing the number of items censored at each stage of the experiment. The length of R determines the number of failure stages (m), and the sum of R plus m must equal n.

dist

a character string specifying the name of the distribution (e.g., "norm" for the normal distribution, "exp" for the exponential distribution).

...

further arguments to be passed to dist.

Details

This function implements the algorithm described by Balakrishnan and Sandhu (1995) to simulate progressive Type-II censored samples. Progressive Type-II censoring is a common scheme in reliability and life-testing experiments, where items are progressively removed (censored) during the testing process.

References

Balakrishnan, N., & Sandhu, R. A. (1995). A simple simulational algorithm for generating progressive Type-II censored samples. The American Statistician, 49(2), 229-230.

See Also

rcens

Examples

Run this code
# Generate a progressive Type-II censored sample from the normal distribution
n <- 10
R <- c(2, 1, 2, 0, 0)
rpcens2(n, R, dist = "norm", mean = 0, sd = 1)

# Generate a progressive Type-II censored sample from the exponential distribution
rpcens2(n = 10, R = c(2, 2, 1, 0, 0), dist = "exp", rate = 1)

Run the code above in your browser using DataLab