Package {gofLorenz}


Type: Package
Title: Goodness-of-Fit Tests for Location-Scale Distributions via Lorenz Curve
Version: 0.1.0
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.
License: GPL (≥ 3)
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.3.3
Depends: R (≥ 4.0.0)
Imports: stats, graphics
Suggests: testthat (≥ 3.0.0), knitr, rmarkdown
VignetteBuilder: knitr
NeedsCompilation: no
Packaged: 2026-08-05 02:30:42 UTC; shikhar tyagi
Author: Shikhar Tyagi ORCID iD [aut, cre], Arvind Pandey [aut], Bhupendra Singh [aut], Vrijesh Tripathi [aut]
Maintainer: Shikhar Tyagi <shikhar1093tyagi@gmail.com>
Repository: CRAN
Date/Publication: 2026-08-09 08:20:02 UTC

Breaking Strength Data under Progressive Type-II Censoring

Description

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).

Usage

breaking_strength

Format

A list with components:

x

Numeric vector of 8 observed failure times.

n

Total sample size (20).

m

Observed failures (8).

R

Progressive censoring scheme (0, 4, 1, 3, 0, 2, 0, 2).

References

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.

Examples

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
)

Compute Lorenz Curve Test Statistics (Lee 2024)

Description

Computes the six Lorenz curve test statistics L+, L-, L(1), L(2), L(3), L(4) from rLC(p).

Usage

calc_lorenz_stats(rLC)

Arguments

rLC

Numeric vector of ratio modified Lorenz curve values.

Value

Named numeric vector of test statistics.


Calculate Expected Uniform Order Statistics under Progressive Censoring

Description

Computes the expected values p[j:m:n] of uniform order statistics under a progressive Type-II censoring scheme R.

Usage

calc_p(n, m, R)

Arguments

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.

Value

A numeric vector of length m containing expected values p[j:m:n].


Compute Pakyari and Balakrishnan (2013) Test Statistics

Description

Computes the order statistics distance test statistics C+, C-, C, K, T(1), T(2) based on Pakyari & Balakrishnan (2013).

Usage

calc_pakyari_stats(x, n, m, R, p, dist = "norm", pfun = NULL, ...)

Arguments

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.

Value

Named numeric vector of test statistics.


Fit Location and Scale Parameters under Progressive Censoring via MLE

Description

Fits location (alpha) and scale (beta) parameters using maximum likelihood estimation under progressive Type-II censoring.

Usage

fit_progressive_mle(x, R, dist = "norm", pfun = NULL, ...)

Arguments

x

Numeric vector of failure times.

R

Numeric vector of censoring scheme.

dist

Character string specifying distribution.

pfun

Optional custom CDF function.

...

Additional arguments.

Value

Named numeric vector c(alpha = ..., beta = ...).


Theoretical Quantiles for Location-Scale Distributions

Description

Obtains standard quantile values for supported location-scale distributions or a custom quantile function.

Usage

get_quantile_vals(p, dist = "norm", qfun = NULL, ...)

Arguments

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.

Value

Numeric vector of quantiles.


Goodness-of-Fit Tests for Location-Scale Distributions Based on Lorenz Curve

Description

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).

Usage

gof_lorenz(
  x,
  n = NULL,
  m = NULL,
  R = NULL,
  dist = "norm",
  mc_rep = 1000,
  conf_level = 0.95,
  qfun = NULL,
  pfun = NULL,
  ...
)

Arguments

x

Numeric vector of failure times (observed progressive Type-II censored sample).

n

Integer specifying total sample size. Defaults to length(x) + sum(R).

m

Integer specifying number of observed failures. Defaults to length(x).

R

Integer vector of length m specifying progressive censoring scheme. Defaults to rep(0, m).

dist

Character string specifying hypothesized location-scale distribution. Supported distributions: "norm" (default), "gumbel", "gumbel_max", "exp", "logistic", "t", "loggamma", "cauchy".

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.

Value

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.

References

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

Examples

# 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)


Log-Transformed Insulating Fluid Data under Progressive Type-II Censoring

Description

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).

Usage

insulating_fluid

Format

A list with components:

x

Numeric vector of 8 log-transformed failure times.

n

Total sample size (19).

m

Observed failures (8).

R

Progressive censoring scheme (0, 0, 3, 0, 3, 0, 0, 5).

References

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.

Examples

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
)

Plot Method for Lorenz Curve Goodness-of-Fit Diagnostics (L-plot)

Description

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).

Usage

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,
  ...
)

Arguments

x

Either an object of class "gof_lorenz" or a numeric vector of failure times.

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 "blue".

pch

Point symbol (default 19).

lwd

Line width (default 2).

...

Additional graphical parameters.

Value

Invisibly returns a data.frame containing p_expected, rLC, and L_plot.

References

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

Examples

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")


Modified Sample Lorenz Curve

Description

Computes the modified sample Lorenz curve mLC(p) for ordered progressive data x[1:m:n] < ... < x[m:m:n].

Usage

mLC_sample(x, p)

Arguments

x

Numeric vector of ordered failure times x[1:m:n] < ... < x[m:m:n].

p

Expected uniform order statistics vector.

Value

Numeric vector of modified sample Lorenz curve values.


Theoretical Modified Lorenz Curve

Description

Computes the theoretical modified Lorenz curve mLC_F(p) for standard location-scale distribution.

Usage

mLC_theory(p, dist = "norm", qfun = NULL, ...)

Arguments

p

Expected uniform order statistics vector.

dist

Character string specifying the distribution name.

qfun

Optional custom quantile function.

...

Additional parameters for quantile function.

Value

Numeric vector of theoretical modified Lorenz curve values.


Plot Method for gof_lorenz Objects

Description

Draws the L-plot diagnostic graph for a "gof_lorenz" object.

Usage

## S3 method for class 'gof_lorenz'
plot(x, ...)

Arguments

x

An object of class "gof_lorenz".

...

Additional graphical arguments passed to lorenz_plot.

Value

Invisibly returns the diagnostic data.frame.


Print Method for Lorenz Goodness-of-Fit Test Results

Description

Prints formatted output of test statistics, p-values, and critical values.

Usage

## S3 method for class 'gof_lorenz'
print(x, digits = 5, ...)

Arguments

x

An object of class "gof_lorenz".

digits

Number of significant digits (default 5).

...

Additional arguments.

Value

Invisibly returns the input object.


Ratio Modified Lorenz Curve

Description

Computes the ratio modified Lorenz curve rLC(p) = mLC(p) / mLC_F(p).

Usage

rLC_calc(x, p, dist = "norm", qfun = NULL, ...)

Arguments

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.

Value

Numeric vector of ratio modified Lorenz curve values rLC(p).


Generate Random Progressive Type-II Censored Samples

Description

Generates random progressive Type-II censored samples from standard location-scale distribution.

Usage

rprcs(n, m, R, dist = "norm", qfun = NULL, ...)

Arguments

n

Total sample size.

m

Observed failure count.

R

Censoring scheme vector.

dist

Distribution name.

qfun

Optional custom quantile function.

...

Additional arguments.

Value

Ordered numeric vector of length m containing simulated failure times.


Summary Method for Lorenz Goodness-of-Fit Test Results

Description

Summarizes goodness-of-fit test statistics and diagnostic metrics.

Usage

## S3 method for class 'gof_lorenz'
summary(object, ...)

Arguments

object

An object of class "gof_lorenz".

...

Additional arguments.

Value

Returns a summary list object.


Helper Functions for Lorenz Goodness-of-Fit Tests

Description

Helper Functions for Lorenz Goodness-of-Fit Tests

mirror server hosted at Truenetwork, Russian Federation.