Description Usage Arguments Value Examples
View source: R/repGBprior.plan.R
This function computes the design of the censored repetitive sampling plan using a model prior of p and expected sampling risks given the requirements of the producer and consumer about maximum allowable risks and quality levels
1 | repGBprior.plan(risks, p, asvar, beta.pars, pg_bar = TRUE)
|
risks |
Vector of producer and consumer maximum sampling risks |
p |
Vector of acceptance and rejection quality levels |
asvar |
List with the asymptotical variance-covariance matrix of MLE estimators of location and scale lifetime distribution parameters. See |
beta.pars |
Data frame with the GB parameters according to the available knowledge about p. See |
A data.frame with the following variables of the censored repetitive design of the sampling plans.
"q": Censoring degree
"n": Sample size
"n_low": Lower bound of sample size
"n_up": Upper bound of sample size
"ka": Acceptance constant
"kr": Rejection constant
"termcd": Termination code of Newton-Raphson optimization
"message": Final message of Newton-Raphson optimization
"p_alpha": Acceptable quality level (AQL)
"p_beta": Rejectable quality level (RQL)
"a": Parameter a
"b": Parameter b
"l": Lower limit of p
"u": Upper limit of p
"mean_p": Mean of p
"var_p": Variance of p
"dist": Distribution name
"alpha": Maximum producer's risk
"beta": Maximum consumer's risk
"asn_alpha": ASN at AQL
"asn_beta": ASN at RQL
"asn_avg": Average of ASN at AQL and ASN at RQL
"easn": Expected ASN
"p_asn_max": Quality level in which ASN maximizes
"asn_max": Maximum ASN over the quality level
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | risks<-c(0.05,0.10)
p<-c(0.00654, 0.0426)
q<- 0.1
asvar<-asympt.var(q,"normal")
l<- p[1]/5
u<- p[2]+(p[1]-l)
# GB parameters for a knowledge of mean and variance of p distribution
know_p<-list(mean_p=p[1],var_p=((p[2]-p[1])/4)^2)
beta.parms<-beta.params(p,l,u, know_p)
designs<-repGBprior.plan(risks,p,asvar, beta.parms)
optimal.design<-designs %>% group_by(q,dist,p_alpha,p_beta) %>%
filter( (abs(alpha-risks[1])<1e-05) & (abs(risks[2]-beta)<1e-05) & (termcd==1)) %>%
group_by(q,p_alpha,p_beta,a,b,l,u,dist) %>%
mutate(easn_min=min(easn)) %>%
slice(which.min(easn)) %>% as.data.frame()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.