| Title: | Goodness-of-Fit Tests for Location-Scale Distributions via Lorenz Curve |
|---|---|
| Description: | Implements goodness-of-fit test statistics and graphical methods for symmetric and asymmetric location-scale distributions under progressive Type-II censoring using the modified Lorenz curve and ratio modified sample Lorenz curve, as proposed by Lee (2024) <doi:10.3390/sym16020202>. Also provides order statistics distance test statistics based on Pakyari and Balakrishnan (2013) <doi:10.1080/00949655.2011.625424>. Supports calculation of test statistics, Monte Carlo p-values, critical values, and L-plot visual diagnostics for complete and progressively Type-II censored data. |
| Authors: | Shikhar Tyagi [aut, cre] (ORCID: <https://orcid.org/0000-0003-1606-0844>), Arvind Pandey [aut], Bhupendra Singh [aut], Vrijesh Tripathi [aut] |
| Maintainer: | Shikhar Tyagi <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 0.1.0 |
| Built: | 2026-10-11 13:04:22 UTC |
| Source: | https://github.com/cran/gofLorenz |
A dataset containing failure times of breaking strength data under progressive Type-II censoring from Nelson (1982) and King (1971), analyzed in Lee (2024) (Example 1).
breaking_strengthbreaking_strength
A list with components:
Numeric vector of 8 observed failure times.
Total sample size (20).
Observed failures (8).
Progressive censoring scheme (0, 4, 1, 3, 0, 2, 0, 2).
Lee, K. (2024). A New Test Statistic to Assess the Goodness of Fit of Location-Scale Distribution Based on Progressive Censored Data. Symmetry, 16(2), 202. doi:10.3390/sym16020202
Nelson, W. (1982). Applied Life Data Analysis. John Wiley & Sons, New York.
King, J. R. (1971). Probability Charts for Decision Making. Industrial Press, New York.
data(breaking_strength) gof_lorenz( x = breaking_strength$x, n = breaking_strength$n, m = breaking_strength$m, R = breaking_strength$R, dist = "norm", mc_rep = 100 )data(breaking_strength) gof_lorenz( x = breaking_strength$x, n = breaking_strength$n, m = breaking_strength$m, R = breaking_strength$R, dist = "norm", mc_rep = 100 )
Computes the six Lorenz curve test statistics L+, L-, L(1), L(2), L(3), L(4) from rLC(p).
calc_lorenz_stats(rLC)calc_lorenz_stats(rLC)
rLC |
Numeric vector of ratio modified Lorenz curve values. |
Named numeric vector of test statistics.
Computes the expected values p[j:m:n] of uniform order statistics under a progressive Type-II censoring scheme R.
calc_p(n, m, R)calc_p(n, m, R)
n |
Total sample size (integer). |
m |
Number of observed failures (integer, m <= n). |
R |
Vector of length m containing the number of items removed at each failure. |
A numeric vector of length m containing expected values p[j:m:n].
Computes the order statistics distance test statistics C+, C-, C, K, T(1), T(2) based on Pakyari & Balakrishnan (2013).
calc_pakyari_stats(x, n, m, R, p, dist = "norm", pfun = NULL, ...)calc_pakyari_stats(x, n, m, R, p, dist = "norm", pfun = NULL, ...)
x |
Numeric vector of failure times. |
n |
Total sample size. |
m |
Failure count. |
R |
Censoring scheme vector. |
p |
Expected uniform order statistics vector. |
dist |
Character string specifying distribution. |
pfun |
Optional custom CDF function. |
... |
Additional arguments. |
Named numeric vector of test statistics.
Fits location (alpha) and scale (beta) parameters using maximum likelihood estimation under progressive Type-II censoring.
fit_progressive_mle(x, R, dist = "norm", pfun = NULL, ...)fit_progressive_mle(x, R, dist = "norm", pfun = NULL, ...)
x |
Numeric vector of failure times. |
R |
Numeric vector of censoring scheme. |
dist |
Character string specifying distribution. |
pfun |
Optional custom CDF function. |
... |
Additional arguments. |
Named numeric vector c(alpha = ..., beta = ...).
Obtains standard quantile values for supported location-scale distributions or a custom quantile function.
get_quantile_vals(p, dist = "norm", qfun = NULL, ...)get_quantile_vals(p, dist = "norm", qfun = NULL, ...)
p |
Numeric vector of probabilities in (0, 1). |
dist |
Character string specifying the distribution name. |
qfun |
Optional custom quantile function accepting p as first argument. |
... |
Additional arguments passed to quantile function. |
Numeric vector of quantiles.
Performs goodness-of-fit tests for symmetric and asymmetric location-scale distributions under progressive Type-II censoring using the modified Lorenz curve methodology of Lee (2024) and order statistics distance methodology of Pakyari and Balakrishnan (2013).
gof_lorenz( x, n = NULL, m = NULL, R = NULL, dist = "norm", mc_rep = 1000, conf_level = 0.95, qfun = NULL, pfun = NULL, ... )gof_lorenz( x, n = NULL, m = NULL, R = NULL, dist = "norm", mc_rep = 1000, conf_level = 0.95, qfun = NULL, pfun = NULL, ... )
x |
Numeric vector of failure times (observed progressive Type-II censored sample). |
n |
Integer specifying total sample size. Defaults to |
m |
Integer specifying number of observed failures. Defaults to |
R |
Integer vector of length m specifying progressive censoring scheme. Defaults to |
dist |
Character string specifying hypothesized location-scale distribution.
Supported distributions: |
mc_rep |
Integer specifying Monte Carlo replicates for p-value estimation. Defaults to 1000. |
conf_level |
Numeric value specifying confidence level for critical value (default 0.95). |
qfun |
Optional custom quantile function accepting probability p as first argument. |
pfun |
Optional custom CDF function accepting standardized value z as first argument. |
... |
Additional parameters passed to quantile/CDF functions. |
An object of class "gof_lorenz" containing:
statistics |
Named vector of test statistics. |
p_values |
Named vector of Monte Carlo simulated p-values. |
critical_values |
Named vector of critical values. |
rLC |
Ratio modified sample Lorenz curve values. |
mLC_sample |
Modified sample Lorenz curve values. |
mLC_theory |
Theoretical modified Lorenz curve values. |
p_expected |
Expected uniform order statistics p[j:m:n]. |
l_plot |
L-plot values |1 - rLC|. |
data |
List containing input data x, n, m, R. |
dist |
Name of hypothesized distribution. |
mc_rep |
Number of Monte Carlo replicates. |
conf_level |
Confidence level. |
Lee, K. (2024). A New Test Statistic to Assess the Goodness of Fit of Location-Scale Distribution Based on Progressive Censored Data. Symmetry, 16(2), 202. doi:10.3390/sym16020202
Pakyari, R., & Balakrishnan, N. (2013). Goodness-of-fit tests for progressively Type II censored data from location-scale distribution. Journal of Statistical Computation and Simulation, 83(1), 167-178. doi:10.1080/00949655.2011.625424
# Example 1 from Lee (2024): Breaking strength data x_ex1 <- c(550, 750, 950, 1150, 1350, 1450, 1550, 1850) R_ex1 <- c(0, 4, 1, 3, 0, 2, 0, 2) res1 <- gof_lorenz( x = x_ex1, n = 20, m = 8, R = R_ex1, dist = "norm", mc_rep = 500 ) print(res1) summary(res1) plot(res1)# Example 1 from Lee (2024): Breaking strength data x_ex1 <- c(550, 750, 950, 1150, 1350, 1450, 1550, 1850) R_ex1 <- c(0, 4, 1, 3, 0, 2, 0, 2) res1 <- gof_lorenz( x = x_ex1, n = 20, m = 8, R = R_ex1, dist = "norm", mc_rep = 500 ) print(res1) summary(res1) plot(res1)
A dataset containing log-transformed failure times of insulating fluid test data under progressive Type-II censoring from Nelson (1982), analyzed in Lee (2024) (Example 2).
insulating_fluidinsulating_fluid
A list with components:
Numeric vector of 8 log-transformed failure times.
Total sample size (19).
Observed failures (8).
Progressive censoring scheme (0, 0, 3, 0, 3, 0, 0, 5).
Lee, K. (2024). A New Test Statistic to Assess the Goodness of Fit of Location-Scale Distribution Based on Progressive Censored Data. Symmetry, 16(2), 202. doi:10.3390/sym16020202
Nelson, W. (1982). Applied Life Data Analysis. John Wiley & Sons, New York.
data(insulating_fluid) gof_lorenz( x = insulating_fluid$x, n = insulating_fluid$n, m = insulating_fluid$m, R = insulating_fluid$R, dist = "gumbel", mc_rep = 100 )data(insulating_fluid) gof_lorenz( x = insulating_fluid$x, n = insulating_fluid$n, m = insulating_fluid$m, R = insulating_fluid$R, dist = "gumbel", mc_rep = 100 )
Draws the L-plot diagnostic curve |1 - rLC(p[j:m:n])| versus p[j:m:n] for assessing goodness-of-fit to a location-scale distribution based on Lee (2024).
lorenz_plot( x, n = NULL, m = NULL, R = NULL, dist = "norm", qfun = NULL, main = NULL, xlab = NULL, ylab = NULL, col = "blue", pch = 19, lwd = 2, ... )lorenz_plot( x, n = NULL, m = NULL, R = NULL, dist = "norm", qfun = NULL, main = NULL, xlab = NULL, ylab = NULL, col = "blue", pch = 19, lwd = 2, ... )
x |
Either an object of class |
n |
Total sample size (required if x is numeric vector and n > length(x)). |
m |
Failure count (required if x is numeric vector). |
R |
Censoring scheme vector. |
dist |
Hypothesized distribution name. |
qfun |
Optional custom quantile function. |
main |
Optional plot main title. |
xlab |
Optional x-axis label. |
ylab |
Optional y-axis label. |
col |
Line and point color. Defaults to |
pch |
Point symbol (default 19). |
lwd |
Line width (default 2). |
... |
Additional graphical parameters. |
Invisibly returns a data.frame containing p_expected, rLC, and L_plot.
Lee, K. (2024). A New Test Statistic to Assess the Goodness of Fit of Location-Scale Distribution Based on Progressive Censored Data. Symmetry, 16(2), 202. doi:10.3390/sym16020202
x_ex1 <- c(550, 750, 950, 1150, 1350, 1450, 1550, 1850) R_ex1 <- c(0, 4, 1, 3, 0, 2, 0, 2) lorenz_plot(x = x_ex1, n = 20, m = 8, R = R_ex1, dist = "norm")x_ex1 <- c(550, 750, 950, 1150, 1350, 1450, 1550, 1850) R_ex1 <- c(0, 4, 1, 3, 0, 2, 0, 2) lorenz_plot(x = x_ex1, n = 20, m = 8, R = R_ex1, dist = "norm")
Computes the modified sample Lorenz curve mLC(p) for ordered progressive data x[1:m:n] < ... < x[m:m:n].
mLC_sample(x, p)mLC_sample(x, p)
x |
Numeric vector of ordered failure times x[1:m:n] < ... < x[m:m:n]. |
p |
Expected uniform order statistics vector. |
Numeric vector of modified sample Lorenz curve values.
Computes the theoretical modified Lorenz curve mLC_F(p) for standard location-scale distribution.
mLC_theory(p, dist = "norm", qfun = NULL, ...)mLC_theory(p, dist = "norm", qfun = NULL, ...)
p |
Expected uniform order statistics vector. |
dist |
Character string specifying the distribution name. |
qfun |
Optional custom quantile function. |
... |
Additional parameters for quantile function. |
Numeric vector of theoretical modified Lorenz curve values.
Draws the L-plot diagnostic graph for a "gof_lorenz" object.
## S3 method for class 'gof_lorenz' plot(x, ...)## S3 method for class 'gof_lorenz' plot(x, ...)
x |
An object of class |
... |
Additional graphical arguments passed to |
Invisibly returns the diagnostic data.frame.
Prints formatted output of test statistics, p-values, and critical values.
## S3 method for class 'gof_lorenz' print(x, digits = 5, ...)## S3 method for class 'gof_lorenz' print(x, digits = 5, ...)
x |
An object of class |
digits |
Number of significant digits (default 5). |
... |
Additional arguments. |
Invisibly returns the input object.
Computes the ratio modified Lorenz curve rLC(p) = mLC(p) / mLC_F(p).
rLC_calc(x, p, dist = "norm", qfun = NULL, ...)rLC_calc(x, p, dist = "norm", qfun = NULL, ...)
x |
Numeric vector of ordered failure times. |
p |
Expected uniform order statistics vector. |
dist |
Character string specifying distribution. |
qfun |
Optional custom quantile function. |
... |
Additional arguments. |
Numeric vector of ratio modified Lorenz curve values rLC(p).
Generates random progressive Type-II censored samples from standard location-scale distribution.
rprcs(n, m, R, dist = "norm", qfun = NULL, ...)rprcs(n, m, R, dist = "norm", qfun = NULL, ...)
n |
Total sample size. |
m |
Observed failure count. |
R |
Censoring scheme vector. |
dist |
Distribution name. |
qfun |
Optional custom quantile function. |
... |
Additional arguments. |
Ordered numeric vector of length m containing simulated failure times.
Summarizes goodness-of-fit test statistics and diagnostic metrics.
## S3 method for class 'gof_lorenz' summary(object, ...)## S3 method for class 'gof_lorenz' summary(object, ...)
object |
An object of class |
... |
Additional arguments. |
Returns a summary list object.