Title: | Lower Confidence Bounds for Binomial Series System |
---|---|
Description: | Calculate and compare lower confidence bounds for binomial series system reliability. The R 'shiny' application, launched by the function launch_app(), weaves together a workflow of customized simulations and delta coverage calculations to output recommended lower confidence bound methods. |
Authors: | Edward Schuberg |
Maintainer: | Edward Schuberg <[email protected]> |
License: | GPL-3 |
Version: | 0.4.0 |
Built: | 2024-11-28 06:30:12 UTC |
Source: | CRAN |
Calculate a binomial series lower confidence bound using Bayes' method with a Beta prior distribution.
bayes(s, n, alpha, MonteCarlo, beta.a, beta.b, ...)
bayes(s, n, alpha, MonteCarlo, beta.a, beta.b, ...)
s |
Vector of successes. |
n |
Vector of sample sizes. |
alpha |
The significance level; to calculate a 100(1- |
MonteCarlo |
Number of samples to draw from the posterior distribution for the Monte Carlo estimate. |
beta.a |
Shape1 parameter for the Beta prior distribution. |
beta.b |
Shape2 parameter for the Beta prior distribution. |
... |
Additional arguments to be ignored. |
The 100(1-)% lower confidence bound.
bayes(s=c(35, 97, 59), n=c(35, 100, 60), alpha=.10, MonteCarlo=1000, beta.a=1, beta.b=1)
bayes(s=c(35, 97, 59), n=c(35, 100, 60), alpha=.10, MonteCarlo=1000, beta.a=1, beta.b=1)
Calculate a binomial series lower confidence bound using Bayes' method with Jeffrey's prior.
bayes_jeffreys(s, n, alpha, MonteCarlo, ...)
bayes_jeffreys(s, n, alpha, MonteCarlo, ...)
s |
Vector of successes. |
n |
Vector of sample sizes. |
alpha |
The significance level; to calculate a 100(1- |
MonteCarlo |
Number of samples to draw from the posterior distribution for the Monte Carlo estimate. |
... |
Additional arguments to be ignored. |
The 100(1-)% lower confidence bound.
bayes_jeffreys(s=c(35, 97, 59), n=c(35, 100, 60), alpha=.10, MonteCarlo=1000)
bayes_jeffreys(s=c(35, 97, 59), n=c(35, 100, 60), alpha=.10, MonteCarlo=1000)
Caclulate a binomal series lower confidence bound using Bayes' method with negative log gamma priors on the components, defined such that the prior on the system is a uniform distribution.
bayes_nlg(s, n, alpha, MonteCarlo, ...)
bayes_nlg(s, n, alpha, MonteCarlo, ...)
s |
Vector of successes. |
n |
Vector of sample sizes. |
alpha |
The significance level; to calculate a 100(1- |
MonteCarlo |
Number of samples to draw from the posterior distribution for the Monte Carlo estimate. |
... |
Additional arguments to be ignored. |
The 100(1-)% lower confidence bound.
bayes_nlg(s=c(35, 97, 59), n=c(35, 100, 60), alpha=.10, MonteCarlo=1000)
bayes_nlg(s=c(35, 97, 59), n=c(35, 100, 60), alpha=.10, MonteCarlo=1000)
Calculate a binomial series lower confidence bound using Bayes' method with a uniform prior distribution.
bayes_uniform(s, n, alpha, MonteCarlo, ...)
bayes_uniform(s, n, alpha, MonteCarlo, ...)
s |
Vector of successes. |
n |
Vector of sample sizes. |
alpha |
The significance level; to calculate a 100(1- |
MonteCarlo |
Number of samples to draw from the posterior distribution for the Monte Carlo estimate. |
... |
Additional arguments to be ignored. |
The 100(1-)% lower confidence bound.
bayes_uniform(s=c(35, 97, 59), n=c(35, 100, 60), alpha=.10, MonteCarlo=1000)
bayes_uniform(s=c(35, 97, 59), n=c(35, 100, 60), alpha=.10, MonteCarlo=1000)
Calculate a binomial series lower confidence bound using Chao and Huwang's (1987) method.
chao_huwang(s, n, alpha, MonteCarlo, ...)
chao_huwang(s, n, alpha, MonteCarlo, ...)
s |
Vector of successes. |
n |
Vector of sample sizes. |
alpha |
The significance level; to calculate a 100(1- |
MonteCarlo |
Number of samples to draw from the posterior distribution for the Monte Carlo estimate. |
... |
Additional arguments to be ignored. |
The 100(1-)% lower confidence bound.
chao_huwang(s=c(35, 97, 59), n=c(35, 100, 60), alpha=.10, MonteCarlo=1000)
chao_huwang(s=c(35, 97, 59), n=c(35, 100, 60), alpha=.10, MonteCarlo=1000)
Calculate a binomial series lower confidence bound using Coit's (1997) method.
coit(s, n, alpha, use.backup = FALSE, backup.method, ...)
coit(s, n, alpha, use.backup = FALSE, backup.method, ...)
s |
Vector of successes. |
n |
Vector of sample sizes. |
alpha |
The significance level; to calculate a 100(1- |
use.backup |
If TRUE, then a backup.method in the will be used for the methods with calculate LCB = 1 in the case of no failures across all components. If FALSE (default), no backup.method is used. |
backup.method |
The backup method which is used for the methods which calculate LCB = 1 in the case of zero failures. Use function name. |
... |
Additional arguments to be ignored. |
The 100(1-)% lower confidence bound.
coit(s=c(35, 97, 59), n=c(35, 100, 60), alpha=.10)
coit(s=c(35, 97, 59), n=c(35, 100, 60), alpha=.10)
Calculate a binomial series lower confidence bound using Easterling's (1972) method.
easterling(s, n, alpha, ...)
easterling(s, n, alpha, ...)
s |
Vector of successes. |
n |
Vector of sample sizes. |
alpha |
The significance level; to calculate a 100(1- |
... |
Additional arguments to be ignored. |
The 100(1-)% lower confidence bound.
easterling(s=c(35, 97, 59), n=c(35, 100, 60), alpha=.10)
easterling(s=c(35, 97, 59), n=c(35, 100, 60), alpha=.10)
Launches an instance of an R Shiny App, which runs locally on the user's computer.
launch_app(MonteCarlo = 1000, use.backup = TRUE, backup.method = lindstrom_madden_AC, sample.omega = "corners", number = 50)
launch_app(MonteCarlo = 1000, use.backup = TRUE, backup.method = lindstrom_madden_AC, sample.omega = "corners", number = 50)
MonteCarlo |
The number of Monte Carlo samples to take. E.g. In a Bayesian method, how many samples to take from a posterior distribution to estimate the lower |
use.backup |
If TRUE (default), then a backup.method in the will be used for the methods with calculate LCB = 1 in the case of no failures across all components. If FALSE, no backup.method is used. |
backup.method |
The backup method which is used for the methods which calculate LCB = 1 in the case of zero failures. The default is lindstrom_madden_AC. |
sample.omega |
The method used to define component reliabilities. Can be only one of "corners" (default), "random", or "both". See Details below. |
number |
The number of component reliability vectors sampled if sample.omega = "random" or "both". Default is 50. |
If the "Download Histograms" button does not work, it can be fixed by launching the Shiny App on your local browser. This can be done by clicking on "Open in Browser" located at the top of your Shiny App. This seems to be an issue with the Download Handler that Shiny uses.
Define
and
. If sample.omega = "corners" (the default), then the elements of
are used for component reliabilities, of which there are
combinations. If sample.omega = "random", then each component reliability is sampled uniformly from the interval
. If sample.omega = "both", then the results of "corners" and "random" are appended together and both are used.
Calculate a binomial series lower confidence bound using Lindstrom and Madden's (1962) method.
lindstrom_madden(s, n, alpha, ...)
lindstrom_madden(s, n, alpha, ...)
s |
Vector of successes. |
n |
Vector of sample sizes. |
alpha |
The significance level; to calculate a 100(1- |
... |
Additional arguments to be ignored. |
The 100(1-)% lower confidence bound.
lindstrom_madden(s=c(35, 97, 59), n=c(35, 100, 60), alpha=.10)
lindstrom_madden(s=c(35, 97, 59), n=c(35, 100, 60), alpha=.10)
Calculate a binomial series lower confidence bound using Agresti-Coull (1998) lower confidence bound calculation in the Lindstrom and Madden's (1962) method.
lindstrom_madden_AC(s, n, alpha, ...)
lindstrom_madden_AC(s, n, alpha, ...)
s |
Vector of successes. |
n |
Vector of sample sizes. |
alpha |
The significance level; to calculate a 100(1- |
... |
Additional arguments to be ignored. |
The 100(1-)% lower confidence bound.
lindstrom_madden_AC(s=c(35, 97, 59), n=c(35, 100, 60), alpha=.10)
lindstrom_madden_AC(s=c(35, 97, 59), n=c(35, 100, 60), alpha=.10)
Calculate a binomial series lower confidence bound using Madansky's (1965) method.
madansky(s, n, alpha, use.backup = FALSE, backup.method, ...)
madansky(s, n, alpha, use.backup = FALSE, backup.method, ...)
s |
Vector of successes. |
n |
Vector of sample sizes. |
alpha |
The significance level; to calculate a 100(1- |
use.backup |
If TRUE, then a backup.method in the will be used for the methods with calculate LCB = 1 in the case of no failures across all components. If FALSE (default), no backup.method is used. |
backup.method |
The backup method which is used for the methods which calculate LCB = 1 in the case of zero failures. Use function name. |
... |
Additional arguments to be ignored. |
The 100(1-)% lower confidence bound. Note that if there are zero observed
failures across all components, the output is LCB = 0.
madansky(s=c(35, 97, 59), n=c(35, 100, 60), alpha=.10)
madansky(s=c(35, 97, 59), n=c(35, 100, 60), alpha=.10)
This function is called in the madansky()
function to solve for the Lagrange multipliers.
madansky.fun(lam, s, n, alpha)
madansky.fun(lam, s, n, alpha)
lam |
The value of the Lagrange multiplier |
s |
Vector of successes. |
n |
Vector of sample sizes. |
alpha |
The significance level; to calculate a 100(1- |
Calculate a binomial series lower confidence bound using Mann and Grubb's (1974) method.
mann_grubbs(s, n, alpha, ...)
mann_grubbs(s, n, alpha, ...)
s |
Vector of successes. |
n |
Vector of sample sizes. |
alpha |
The significance level; to calculate a 100(1- |
... |
Additional arguments to be ignored. |
The 100(1-)% lower confidence bound.
mann_grubbs(s=c(35, 97, 59), n=c(35, 100, 60), alpha=.10)
mann_grubbs(s=c(35, 97, 59), n=c(35, 100, 60), alpha=.10)
Calculate the LCB in the Mann-Grubbs method.
mann_grubbs_calc(s, n, A, alpha)
mann_grubbs_calc(s, n, A, alpha)
s |
Vector of successes. |
n |
Vector of sample sizes. |
A |
The restricted sum, as caclulated by the mann_grubbs_sum() function. |
alpha |
The significance level; to calculate a 100(1- |
The LCB for the Mann-Grubbs method.
Calculate the restricted sum in the Mann-Grubbs method.
mann_grubbs_sum(s, n)
mann_grubbs_sum(s, n)
s |
Vector of successes. |
n |
Vector of sample sizes. |
The restricted sum.
in the Myhre-Rennie 2 methodThis function is called in myhre_rennie2()
function to solve for the value.
mr.fun(beta, s, n)
mr.fun(beta, s, n)
beta |
The value of |
s |
Vector of successes. |
n |
Vector of sample sizes. |
Calculate a binomial series lower confidence bound using the Myhre-Rennie (modified ML) method (1986).
myhre_rennie1(s, n, alpha, use.backup = FALSE, backup.method, ...)
myhre_rennie1(s, n, alpha, use.backup = FALSE, backup.method, ...)
s |
Vector of successes. |
n |
Vector of sample sizes. |
alpha |
The significance level; to calculate a 100(1- |
use.backup |
If TRUE, then a backup.method in the will be used for the methods with calculate LCB = 1 in the case of no failures across all components. If FALSE (default), no backup.method is used. |
backup.method |
The backup method which is used for the methods which calculate LCB = 1 in the case of zero failures. Use function name. |
... |
Additional arguments to be ignored. |
The 100(1-)% lower confidence bound.
myhre_rennie1(s=c(35, 97, 59), n=c(35, 100, 60), alpha=.10)
myhre_rennie1(s=c(35, 97, 59), n=c(35, 100, 60), alpha=.10)
Calculate a binomial series lower confidence bound using the Myhre-Rennie (reliability invariant) method (1986).
myhre_rennie2(s, n, alpha, use.backup = FALSE, backup.method, ...)
myhre_rennie2(s, n, alpha, use.backup = FALSE, backup.method, ...)
s |
Vector of successes. |
n |
Vector of sample sizes. |
alpha |
The significance level; to calculate a 100(1- |
use.backup |
If TRUE, then a backup.method in the will be used for the methods with calculate LCB = 1 in the case of no failures across all components. If FALSE (default), no backup.method is used. |
backup.method |
The backup method which is used for the methods which calculate LCB = 1 in the case of zero failures. Use function name. |
... |
Additional arguments to be ignored. |
The 100(1-)% lower confidence bound.
myhre_rennie2(s=c(35, 97, 59), n=c(35, 100, 60), alpha=.10)
myhre_rennie2(s=c(35, 97, 59), n=c(35, 100, 60), alpha=.10)
Calculate a binomial series lower confidence bound using Nishime's (1959) method.
nishime(s, n, alpha, ...)
nishime(s, n, alpha, ...)
s |
Vector of successes. |
n |
Vector of sample sizes. |
alpha |
The significance level; to calculate a 100(1- |
... |
Additional arguments to be ignored. |
The 100(1-)% lower confidence bound.
nishime(s=c(35, 97, 59), n=c(35, 100, 60), alpha=.10)
nishime(s=c(35, 97, 59), n=c(35, 100, 60), alpha=.10)
Randomly sample from the posterior distribution resulting from a NLG prior and Binomial data.
nlg.post.sample(sample.size, shape, scale, s, n)
nlg.post.sample(sample.size, shape, scale, s, n)
sample.size |
The number of draws from the posterior distribution. |
shape |
The shape parameter for the NLG prior. |
scale |
The scale parameter for the NLG prior. |
s |
The number of successes for the binomial data (should be a scalar). |
n |
The number of tests for the binomial data (should be a scalar). |
nlg.post.sample(sample.size=50, shape=.2, scale=1, s=29, n=30)
nlg.post.sample(sample.size=50, shape=.2, scale=1, s=29, n=30)
Calculate a binomial series lower confidence bound using a normal approximation with MLE estimates.
normal_approximation(s, n, alpha, use.backup = FALSE, backup.method, ...)
normal_approximation(s, n, alpha, use.backup = FALSE, backup.method, ...)
s |
Vector of successes. |
n |
Vector of sample sizes. |
alpha |
The significance level; to calculate a 100(1- |
use.backup |
If TRUE, then a backup.method in the will be used for the methods with calculate LCB = 1 in the case of no failures across all components. If FALSE (default), no backup.method is used. |
backup.method |
The backup method which is used for the methods which calculate LCB = 1 in the case of zero failures. Use function name. |
... |
Additional arguments to be ignored. |
The 100(1-)% lower confidence bound.
normal_approximation(s=c(35, 97, 59), n=c(35, 100, 60), alpha=.10)
normal_approximation(s=c(35, 97, 59), n=c(35, 100, 60), alpha=.10)
Calculate a matrix of p-vector combinations (component reliabilities) which lie in the specified interval of system reliability. Rows correspond to p-vectors and columns correspond to components.
pm(Rs.int, m)
pm(Rs.int, m)
Rs.int |
Interval (or single number) of total system reliability. |
m |
Number of components. |
Denote Rs.int . This function calculates all elements of the set
.
The by
matrix of p-vector combinations.
pm(Rs.int = c(.9, .95), m=3)
pm(Rs.int = c(.9, .95), m=3)
Randomly sample to build a matrix of p-vector combinations (component reliabilities) which lie in the specified interval of system reliability. Rows correspond to p-vectors and columns correspond to components.
pm.random(Rs.int, m, number)
pm.random(Rs.int, m, number)
Rs.int |
Interval (or single number) of total system reliability. |
m |
Number of components. |
number |
The number of random samples to draw. |
pm.random(Rs.int=c(.9, .95), m=3, number=100)
pm.random(Rs.int=c(.9, .95), m=3, number=100)
Calculate a binomial series lower confidence bound using Rice and Moore's (1983) method.
rice_moore(s, n, alpha, MonteCarlo, f.star = 1.5 - min(n) + 0.5 * sqrt((3 - 2 * min(n))^2 - 4 * (min(n) - 1) * log(alpha) * qchisq(p = alpha, df = 2)), ...)
rice_moore(s, n, alpha, MonteCarlo, f.star = 1.5 - min(n) + 0.5 * sqrt((3 - 2 * min(n))^2 - 4 * (min(n) - 1) * log(alpha) * qchisq(p = alpha, df = 2)), ...)
s |
Vector of successes. |
n |
Vector of sample sizes. |
alpha |
The significance level; to calculate a 100(1- |
MonteCarlo |
Number of samples to draw from the posterior distribution for the Monte Carlo estimate. |
f.star |
The number of psuedo-failures to use for a component that exhibits zero observed failures. The default value is from the log-gamma procedure proposed by Gatliffe (1976), and is the value used by Rice and Moore. |
... |
Additional arguments to be ignored. |
The 100(1-)% lower confidence bound.
rice_moore(s=c(35, 97, 59), n=c(35, 100, 60), alpha=.10, MonteCarlo=1000)
rice_moore(s=c(35, 97, 59), n=c(35, 100, 60), alpha=.10, MonteCarlo=1000)
Calculate the root mean squared errors of the LCB's from the true system reliability. A measure of spread.
rmse.LCB(LCB, R)
rmse.LCB(LCB, R)
LCB |
Vector of LCB's. |
R |
The true system reliability . |
The root mean squared error of the LCB's from the true system reliability.