bdata_generator {BRDT} | R Documentation |
Data Generation Function for Binomial RDT Design
Description
Define the function to generate the dataset based on the design settings (for Binomial RDT).
Usage
bdata_generator(
Cf,
Cv,
nvec,
G,
Cw,
N,
Rvec,
cvec,
pi,
par = all(),
option = c("optimal"),
thres_CR
)
Arguments
Cf |
Fixed costs of RDT |
Cv |
Variable unit costs of RDT |
nvec |
Vector of test sample size |
G |
Reliabilty growth cost |
Cw |
Average cost per warranty claim |
N |
Sales volume |
Rvec |
Vector of lower level reliability requirements |
cvec |
Vector of maximum allowable failures |
pi |
Failure probability |
par |
Specify which columns to return. Default is all columns.The columns include c('n', 'R', 'c', 'CR', 'AP', 'RDT Cost', 'RG Cost', 'RG Cost Expected', 'WS Cost', 'WS Failure Probability', 'WS Cost Expected', 'Overall Cost') |
option |
Options to get different datasets. Default is 'optimal'. If option = 'all', get all test plans data for all combinations of n, c, R; If option = 'optimal', get test plans data with optimal test sample size for every combination of c, R. |
thres_CR |
Threshold (acceptable level) of consumer's risk |
Value
Matrix of the dataset
See Also
boptimal_cost
for getting the optial test plan with minimum overall cost;
boptimal_n
for getting the optial test sample size;
Examples
nvec <- seq(0, 10, 1)
Rvec <- seq(0.8, 0.85, 0.01)
cvec <- seq(0, 2, 1)
pi <- pi_MCSim_beta(M = 5000, seed = 10, a = 1, b = 1)
bdata_generator(Cf = 10, Cv = 10, nvec = nvec, G = 10000, Cw = 10,
N = 100, Rvec = Rvec, cvec = cvec, pi = pi,
par = c('n', 'R', 'c', 'CR', 'AP'), option = c("optimal"), thres_CR = 0.05)