Title: | Birnbaum-Saunders Goodness-of-Fit Test |
---|---|
Description: | Performs goodness-of-fit test for the Birnbaum-Saunders distribution and provides the maximum likelihood estimate and the method-of-moments estimate. For more details, see Park and Wang (2013) <arXiv:2308.10150>. This work was supported by the National Research Foundation of Korea (NRF) grants funded by the Korea government (MSIT) (No. 2022R1A2C1091319, RS-2023-00242528). |
Authors: | Chanseok Park [aut, cre]
|
Maintainer: | Chanseok Park <[email protected]> |
License: | GPL-2 | GPL-3 |
Version: | 0.24.1 |
Built: | 2025-02-02 05:25:27 UTC |
Source: | https://github.com/appliedstat/r |
Density, distribution function, quantile function and random generation for the Birnbaum-Saunders distribution with alpha (shape) and beta (scale)
dbs(x, alpha = 1, beta = 1, log = FALSE) pbs(q, alpha = 1, beta = 1, lower.tail = TRUE, log.p = FALSE) qbs(p, alpha = 1, beta = 1, lower.tail = TRUE, log.p = FALSE) rbs(n, alpha = 1, beta = 1)
dbs(x, alpha = 1, beta = 1, log = FALSE) pbs(q, alpha = 1, beta = 1, lower.tail = TRUE, log.p = FALSE) qbs(p, alpha = 1, beta = 1, lower.tail = TRUE, log.p = FALSE) rbs(n, alpha = 1, beta = 1)
x , q
|
vector of quantiles. |
p |
vector of probabilities. |
n |
number of observations. |
alpha |
shape parameter. |
beta |
scale parameter. |
log , log.p
|
logical; if |
lower.tail |
logical; if |
The Birnbaum-Saunders distribution was proposed by Birnbaum and Saunders (1969) and its probability density function and cumulative distribution function are given by
and
where ,
, and
.
dbs
gives the density, pbs
gives the distribution function, qbs
gives the quantile function,
and rbs
generates random deviates.
Chanseok Park
Birnbaum, Z. W. and Saunders, S. C. (1969). A new family of life distributions. J. Appl. Probab. 6(2): 637-652.
dbs(1.5, alpha=0.5, beta=1.5) exp( dbs(1.5, alpha=0.5, beta=1.5, log=TRUE) ) pbs(2.5, alpha=0.5, beta=1.5) 1 - pbs(2.5, alpha=0.5,beta=1.5, lower.tail = FALSE, log.p = FALSE) 1 - exp( pbs(2.5, alpha=0.5,beta=1.5, lower.tail = FALSE, log.p = TRUE) ) qbs(0.1, alpha=0.5, beta=1.5) qbs(0.9, alpha=0.5, beta=1.5, lower.tail = FALSE, log.p = FALSE) qbs(log(0.1), alpha=0.5, beta=1.5, lower.tail = TRUE, log.p = TRUE) qbs(log(0.9), alpha=0.5, beta=1.5, lower.tail = FALSE, log.p = TRUE) rbs(n=10, alpha=0.5, beta=1.5)
dbs(1.5, alpha=0.5, beta=1.5) exp( dbs(1.5, alpha=0.5, beta=1.5, log=TRUE) ) pbs(2.5, alpha=0.5, beta=1.5) 1 - pbs(2.5, alpha=0.5,beta=1.5, lower.tail = FALSE, log.p = FALSE) 1 - exp( pbs(2.5, alpha=0.5,beta=1.5, lower.tail = FALSE, log.p = TRUE) ) qbs(0.1, alpha=0.5, beta=1.5) qbs(0.9, alpha=0.5, beta=1.5, lower.tail = FALSE, log.p = FALSE) qbs(log(0.1), alpha=0.5, beta=1.5, lower.tail = TRUE, log.p = TRUE) qbs(log(0.9), alpha=0.5, beta=1.5, lower.tail = FALSE, log.p = TRUE) rbs(n=10, alpha=0.5, beta=1.5)
Calculates the maximum likelihood estimates of Birnbaum-Saunders distribution.
bs.mle(x)
bs.mle(x)
x |
a numeric vector of observations. |
The Birnbaum-Saunders distribution has the probability density function
where ,
, and
.
The parameters are estimated using the maximum likelihood method.
An object of class "bs.estimate"
, a list with parameter estimates.
Chanseok Park
Birnbaum, Z. W. and Saunders, S. C. (1969). Estimation for a Family of Life Distributions with Applications to Fatigue. J. Appl. Probab. 6(2): 328-347.
bs.mme
for the parameter estimation using the methof of moments.
# Aluminum-Coupons data set from Birnbaum and Saunders (1969). data = c(0.37, 0.706, 0.716, 0.746, 0.785, 0.797, 0.844, 0.855, 0.858, 0.886, 0.886, 0.93, 0.96, 0.988, 0.99, 1, 1.01, 1.016, 1.018, 1.02, 1.055, 1.085, 1.102, 1.102, 1.108, 1.115, 1.12, 1.134, 1.14, 1.199, 1.2, 1.2, 1.203, 1.222, 1.235, 1.238, 1.252, 1.258, 1.262, 1.269, 1.27, 1.29, 1.293, 1.3, 1.31, 1.313, 1.315, 1.33, 1.355, 1.39, 1.416, 1.419, 1.42, 1.42, 1.45, 1.452, 1.475, 1.478, 1.481, 1.485, 1.502, 1.505, 1.513, 1.522, 1.522, 1.53, 1.54, 1.56, 1.567, 1.578, 1.594, 1.602, 1.604, 1.608, 1.63, 1.642, 1.674, 1.73, 1.75, 1.75, 1.763, 1.768, 1.781, 1.782, 1.792, 1.82, 1.868, 1.881, 1.89, 1.893, 1.895, 1.91, 1.923, 1.94, 1.945, 2.023, 2.1, 2.13, 2.215, 2.268, 2.44) bs.mle(data)
# Aluminum-Coupons data set from Birnbaum and Saunders (1969). data = c(0.37, 0.706, 0.716, 0.746, 0.785, 0.797, 0.844, 0.855, 0.858, 0.886, 0.886, 0.93, 0.96, 0.988, 0.99, 1, 1.01, 1.016, 1.018, 1.02, 1.055, 1.085, 1.102, 1.102, 1.108, 1.115, 1.12, 1.134, 1.14, 1.199, 1.2, 1.2, 1.203, 1.222, 1.235, 1.238, 1.252, 1.258, 1.262, 1.269, 1.27, 1.29, 1.293, 1.3, 1.31, 1.313, 1.315, 1.33, 1.355, 1.39, 1.416, 1.419, 1.42, 1.42, 1.45, 1.452, 1.475, 1.478, 1.481, 1.485, 1.502, 1.505, 1.513, 1.522, 1.522, 1.53, 1.54, 1.56, 1.567, 1.578, 1.594, 1.602, 1.604, 1.608, 1.63, 1.642, 1.674, 1.73, 1.75, 1.75, 1.763, 1.768, 1.781, 1.782, 1.792, 1.82, 1.868, 1.881, 1.89, 1.893, 1.895, 1.91, 1.923, 1.94, 1.945, 2.023, 2.1, 2.13, 2.215, 2.268, 2.44) bs.mle(data)
Calculates the methof-of-moments estimates of Birnbaum-Saunders distribution.
bs.mme(x)
bs.mme(x)
x |
a numeric vector of observations. |
The Birnbaum-Saunders distribution has the probability density function
where ,
, and
.
The parameters are estimated using the methof-of-moments estimates method.
An object of class "bs.estimate"
, a list with parameter estimates.
Chanseok Park
Birnbaum, Z. W. and Saunders, S. C. (1969). Estimation for a Family of Life Distributions with Applications to Fatigue. J. Appl. Probab. 6(2): 328-347.
bs.mle
for the parameter estimation using the maximum likelihood method.
# Aluminum-Coupons data set from Birnbaum and Saunders (1969). data = c(0.37, 0.706, 0.716, 0.746, 0.785, 0.797, 0.844, 0.855, 0.858, 0.886, 0.886, 0.93, 0.96, 0.988, 0.99, 1, 1.01, 1.016, 1.018, 1.02, 1.055, 1.085, 1.102, 1.102, 1.108, 1.115, 1.12, 1.134, 1.14, 1.199, 1.2, 1.2, 1.203, 1.222, 1.235, 1.238, 1.252, 1.258, 1.262, 1.269, 1.27, 1.29, 1.293, 1.3, 1.31, 1.313, 1.315, 1.33, 1.355, 1.39, 1.416, 1.419, 1.42, 1.42, 1.45, 1.452, 1.475, 1.478, 1.481, 1.485, 1.502, 1.505, 1.513, 1.522, 1.522, 1.53, 1.54, 1.56, 1.567, 1.578, 1.594, 1.602, 1.604, 1.608, 1.63, 1.642, 1.674, 1.73, 1.75, 1.75, 1.763, 1.768, 1.781, 1.782, 1.792, 1.82, 1.868, 1.881, 1.89, 1.893, 1.895, 1.91, 1.923, 1.94, 1.945, 2.023, 2.1, 2.13, 2.215, 2.268, 2.44) bs.mme(data)
# Aluminum-Coupons data set from Birnbaum and Saunders (1969). data = c(0.37, 0.706, 0.716, 0.746, 0.785, 0.797, 0.844, 0.855, 0.858, 0.886, 0.886, 0.93, 0.96, 0.988, 0.99, 1, 1.01, 1.016, 1.018, 1.02, 1.055, 1.085, 1.102, 1.102, 1.108, 1.115, 1.12, 1.134, 1.14, 1.199, 1.2, 1.2, 1.203, 1.222, 1.235, 1.238, 1.252, 1.258, 1.262, 1.269, 1.27, 1.29, 1.293, 1.3, 1.31, 1.313, 1.315, 1.33, 1.355, 1.39, 1.416, 1.419, 1.42, 1.42, 1.45, 1.452, 1.475, 1.478, 1.481, 1.485, 1.502, 1.505, 1.513, 1.522, 1.522, 1.53, 1.54, 1.56, 1.567, 1.578, 1.594, 1.602, 1.604, 1.608, 1.63, 1.642, 1.674, 1.73, 1.75, 1.75, 1.763, 1.768, 1.781, 1.782, 1.792, 1.82, 1.868, 1.881, 1.89, 1.893, 1.895, 1.91, 1.923, 1.94, 1.945, 2.023, 2.1, 2.13, 2.215, 2.268, 2.44) bs.mme(data)
bs.plot
produces a Birnbaum-Saunders probability plot.
bs.plot(x, plot.it=TRUE, a, col.line="black", lty.line=1, xlim=NULL, ylim=NULL, main=NULL, sub=NULL, xlab=NULL, ylab="Probability", ...)
bs.plot(x, plot.it=TRUE, a, col.line="black", lty.line=1, xlim=NULL, ylim=NULL, main=NULL, sub=NULL, xlab=NULL, ylab="Probability", ...)
x |
a numeric vector of data values. Missing values are allowed. |
plot.it |
logical. Should the result be plotted? |
a |
the offset fraction to be used; typically in (0,1). See |
col.line |
the color of the straight line. |
lty.line |
the line type of the straight line. |
xlim |
the x limits of the plot. |
ylim |
the y limits of the plot. |
main |
a main title for the plot, see also |
sub |
a sub title for the plot. |
xlab |
a label for the x axis, defaults to a description of x. |
ylab |
a label for the y axis, defaults to "Probability". |
... |
graphical parameters. |
The Birnbaum-Saunders probability plot is based on the linearization proposed by Chang and Tang (1994).
A list with the following components:
x |
The sorted data |
w |
sqrt(x)*qnorm(p) |
Chanseok Park
Chang, D. S and Tang, L. C. (1994). Graphical analysis for Birnbaum-Saunders distribution.
Microelectronics Reliability 34: 17-22.
Birnbaum, Z. W. and Saunders, S. C. (1969). Estimation for a Family of Life Distributions with Applications to Fatigue. J. Appl. Probab. 6(2): 328-347.
qqnorm
, qqplot
, and
wp.plot
for the Weibull probability plot in package weibullness.
# Data set from Birnbaum and Saunders (1969). attach(BSdata) data = psi21k bs.plot(data) # Adding cosmetic lines bs.plot(data, main="BS probability plot", lty.line=2, pch=3, col.line="red") ticklabels=c(0.01, seq(0.1,0.9,by=0.1), seq(0.91,0.99,by=0.01) ) qn = quantile(data, probs=ticklabels) ticksat= qnorm(ticklabels)* sqrt( qn ) hline = qnorm( ticklabels ) * sqrt( qn ) abline( h=hline, col=gray(0.5), lty=3, lwd=0.6 ) abline( v= seq(0, 2500, by=100), col=gray(0.5), lty=3, lwd=0.5 ) abline( h= qnorm(0.5)*sqrt(median(data)), col=gray(0.1), lty=1, lwd=0.6 ) abline( v= median(data), col=gray(0.1), lty=1, lwd=0.6 )
# Data set from Birnbaum and Saunders (1969). attach(BSdata) data = psi21k bs.plot(data) # Adding cosmetic lines bs.plot(data, main="BS probability plot", lty.line=2, pch=3, col.line="red") ticklabels=c(0.01, seq(0.1,0.9,by=0.1), seq(0.91,0.99,by=0.01) ) qn = quantile(data, probs=ticklabels) ticksat= qnorm(ticklabels)* sqrt( qn ) hline = qnorm( ticklabels ) * sqrt( qn ) abline( h=hline, col=gray(0.5), lty=3, lwd=0.6 ) abline( v= seq(0, 2500, by=100), col=gray(0.5), lty=3, lwd=0.5 ) abline( h= qnorm(0.5)*sqrt(median(data)), col=gray(0.1), lty=1, lwd=0.6 ) abline( v= median(data), col=gray(0.1), lty=1, lwd=0.6 )
Quantiles for the goodness of fit test for the Birnbaum-Saunders distribution from the probability plot. They are obtained from the sample correlation from the Birnbaum-Saunders probability plot. Monte Carlo iteration is 1E08.
bs.plot.quantiles
bs.plot.quantiles
This data frame contains 998 rows and 1001 columns.
Quantile values between zero and one.
Chanseok Park
Park, C. and M. Wang (2023).
A goodness-of-fit test for the Birnbaum-Saunders distribution based on the probability plot.
ArXiv e-prints, 2308.10150.
doi:10.48550/arXiv.2308.10150
Performs goodness-of-fit test for the Birnbaum-Saunders distribution
bs.test(x, a) bs.test.pvalue(r, n) bs.test.critical(alpha, n)
bs.test(x, a) bs.test.pvalue(r, n) bs.test.critical(alpha, n)
x |
a numeric vector of data values. Missing values are allowed, but the number of non-missing values must be between 3 and 1000. |
a |
the offset fraction to be used; typically in (0,1). See |
r |
the sample correlation coefficient from the Birnbaum-Saunders probability plot; r is in (0,1). |
n |
the sample size. |
alpha |
the significance level. |
Using the sample correlation coefficeint from the Birnbaum-Saunders probability plot, it performs the goodness fit test for the Birnbaum-Saunders distribution.
A list with class "htest" containing the following components:
statistic |
the value of the test statistic (sample correlation from the Birnbaum-Saunders probability plot) |
p.value |
the p-value for the test. |
sample.size |
sample size (missing observations are deleted). |
method |
a character string indicating the goodness fit test for the Birnbaum-Saunders distribution. |
data.name |
a character string giving the name(s) of the data. |
Chanseok Park
Park, C. and M. Wang (2023).
A goodness-of-fit test for the Birnbaum-Saunders distribution based on the probability plot.
ArXiv e-prints, 2308.10150.
doi:10.48550/arXiv.2308.10150
ks.test
for performing a one- or two-sample Kolmogorov-Smirnov test. shapiro.test
for performing the Shapiro-Wilk test of normality. wp.test
{weibullness} for performing the Weibullness test.
# For the goodness of fit test x = c(1.2, 2.0, 3.3) bs.test(x) # p.value with r (sample correlation from the probability plot) and n (sample size) are given bs.test.pvalue(r=0.6, n=10) # Critical value with alpha (significane level) and n (sample size). bs.test.critical(alpha=0.01, n=10)
# For the goodness of fit test x = c(1.2, 2.0, 3.3) bs.test(x) # p.value with r (sample correlation from the probability plot) and n (sample size) are given bs.test.pvalue(r=0.6, n=10) # Critical value with alpha (significane level) and n (sample size). bs.test.critical(alpha=0.01, n=10)
psi21k
, psi26k
, and psi31k
are from Birnbaum and Saunders (1969).
The fatigue lifetimes of aluminum specimens exposed to a maximum stress of 21,000 psi, 26,000 psi, 31,000 psi,
respectively.
bearings
is from McCool (1974). The fatigue lifetimes (in hours) of ten bearings.
fatigue
is from Brown and Miller (1978). The fatigue lifetimes of cylindrical specimens
subjected to combined torsional and axial loads over constant-amplitude cycles until failure.
repair
is from Hsieh (1990). This is a maintenance data set
on active repair times (in hours) for an airborne communications transceiver.
BSdata
BSdata
Birnbaum, Z. W. and Saunders, S. C. (1969). A new family of life distributions. J. Appl. Probab. 6(2): 637-652.
McCool, J. I. (1974). Inferential techniques for Weibull populations. Aerospace Research Laboratories Report ARL T
R74-0180, Wright-Patterson Air Force Base, Dayton, OH.
Rieck, J. R. and Nedelman, J. (1991).
A Log-Linear Model for the Birnbaum-Saunders Distribution. Technometrics. 33, 51-60.
Brown, M. W. and Miller, K. J. (1978).
Biaxial Fatigue Data. Report CEMR1/78. University of Sheffield, Dept. of Mechanical Engineering.
Hsieh, H. K. (1990). Estimating the Critical Time of Inverse Gaussian Hazard Rate. IEEE Transactions on Reliability, 39(10): 342-345.
# Attach data sets attach(BSdata) psi21k psi26k psi31k bearings fatigue repair
# Attach data sets attach(BSdata) psi21k psi26k psi31k bearings fatigue repair
Printing objects of class "bs.estimate".
No return value, printing objects of class
bs.mle, bs.mme, print
Printing objects of class "bs.test.critical.value".
No return value, printing objects of class
bs.test.critical, print