Type: Package
Title: Bivariate Laplace Transforms, Stochastic Orders, and Entropy Measures in Reliability
Version: 0.2.0
Description: Implements methods for bivariate Laplace transforms of residual lives and reversed residual lives, associated stochastic ordering concepts, and dynamic entropy measures for reliability analysis. The package covers three primary research areas: (1) Bivariate Laplace transform of residual lives and stochastic comparisons based on the bivariate Laplace transform order of residual lives (BLt-rl), including weak bivariate hazard rate, mean residual life, and relative mean residual life orders, nonparametric estimation, and NBUHR/NWUHR aging class characterisation (Jayalekshmi, Rajesh, and Nair, 2022, <doi:10.1080/03610926.2022.2085874>); (2) Bivariate Laplace transform order of reversed residual lives (BLt-Rrl), reversed hazard gradient, reversed mean residual life, and the associated stochastic orders (weak bivariate reversed hazard rate, weak bivariate reversed mean residual life); (3) Residual entropy generating function, a dynamic version of Golomb's (1966) information generating function whose derivative yields the residual entropy of Ebrahimi and Pellerey (1995), with nonparametric estimation and distribution characterisation. Parametric families supported include the Gumbel bivariate exponential, Farlie-Gumbel-Morgenstern (FGM), bivariate power, and Schur-constant distributions. Plotting utilities and a simulation framework for evaluating estimator performance are also provided.
License: GPL-3
URL: https://itsmdivakaran.github.io/BivLaplaceRL/, https://github.com/itsmdivakaran/BivLaplaceRL
BugReports: https://github.com/itsmdivakaran/BivLaplaceRL/issues
Encoding: UTF-8
Config/Needs/website: pkgdown
RoxygenNote: 7.3.3
Depends: R (≥ 4.1.0)
Imports: stats, graphics
Suggests: testthat (≥ 3.0.0), knitr, rmarkdown, MASS, survival, covr
VignetteBuilder: knitr
Config/testthat/edition: 3
NeedsCompilation: yes
Language: en-GB
Packaged: 2026-04-29 07:42:33 UTC; maheshdivakaran
Author: Mahesh Divakaran ORCID iD [aut, cre] (affiliation: Amity School of Applied Sciences, Amity University Lucknow), S. Jayalekshmi [aut] (affiliation: Department of Statistics, Cochin University of Science and Technology), G. Rajesh [aut] (affiliation: Department of Statistics, Cochin University of Science and Technology), N. Unnikrishnan Nair [aut] (affiliation: Department of Statistics, Cochin University of Science and Technology), Smitha S. [aut] (affiliation: K. E. College, Mannanam)
Maintainer: Mahesh Divakaran <imaheshdivakaran@gmail.com>
Repository: CRAN
Date/Publication: 2026-04-29 19:10:20 UTC

BivLaplaceRL: Bivariate Laplace Transforms, Stochastic Orders, and Entropy Measures in Reliability

Description

BivLaplaceRL provides a unified framework for three interconnected research themes in reliability analysis and survival theory:

1. Bivariate Laplace Transform of Residual Lives

Implements the vector Laplace transform of bivariate residual lives (L_{X_{t_1|t_2}}(s_1),\,L_{X_{t_2|t_1}}(s_2)), the associated stochastic ordering BLt-rl, and its relationships with the weak bivariate hazard rate order, weak bivariate mean residual life order, and bivariate relative mean residual life order. Nonparametric estimation and NBUHR/NWUHR aging class tests are included. Reference: Jayalekshmi, Rajesh, and Nair (2022) doi:10.1080/03610926.2022.2085874.

2. Bivariate Laplace Transform of Reversed Residual Lives

Implements the bivariate Laplace transform of reversed (past) residual lives, the BLt-Rrl stochastic order, and connections with weak bivariate reversed hazard rate and reversed mean residual life orders.

3. Residual Entropy Generating Function

Implements the dynamic information generating function (REGF), the residual entropy of Ebrahimi and Pellerey (1995), Golomb's (1966) information generating function, and nonparametric estimation of REGF with Monte-Carlo simulation support.

Parametric families

Gumbel bivariate exponential, Farlie-Gumbel-Morgenstern (FGM), bivariate power, Schur-constant, and exponential distributions are built in.

Plotting

plot_blt_residual, plot_blt_reversed, and plot_regf provide ready-made visualisations.

Author(s)

Maintainer: Mahesh Divakaran imaheshdivakaran@gmail.com (ORCID) (Amity School of Applied Sciences, Amity University Lucknow)

Authors:

References

Jayalekshmi S., Rajesh G., Nair N.U. (2022). Bivariate Laplace transform of residual lives and their properties. *Communications in Statistics - Theory and Methods*. doi:10.1080/03610926.2022.2085874

Jayalekshmi S., Rajesh G. Bivariate Laplace transform order and ordering of reversed residual lives. *International Journal of Reliability, Quality and Safety Engineering*.

Smitha S., Rajesh G., Jayalekshmi S. (2024). On residual entropy generating function. *Journal of the Indian Statistical Association*, 62(1), 81–93.

Belzunce F., Ortega E., Ruiz J.M. (1999). The Laplace order and ordering of residual lives. *Statistics & Probability Letters*, 42(2), 145–156.

Ebrahimi N., Pellerey F. (1995). New partial ordering of survival functions based on the notion of uncertainty. *Journal of Applied Probability*, 32(1), 202–211.

Golomb S.W. (1966). The information generating function of a probability distribution. *IEEE Transactions on Information Theory*, 12(1), 75–77.

See Also

Useful links:


Bivariate Relative Mean Residual Life Order

Description

Checks whether X \le_{\rm brlmr} Y: the ratio m_{i,Y}(t_1,t_2) / m_{i,X}(t_1,t_2) is increasing in t_i.

Usage

biv_brlmr_order(
  surv_X,
  surv_Y,
  t2_fixed = 0.5,
  t1_grid = seq(0.2, 3, by = 0.3),
  tol = 1e-06
)

Arguments

surv_X, surv_Y

Joint survival functions.

t2_fixed

Fixed value of t_2 for the univariate slices.

t1_grid

Grid of t_1 values.

tol

Tolerance.

Value

List with order_holds and ratio_values.

References

Kayid M., Izadkhah S., Alshami S. (2016). Residual probability function, associated orderings, and related aging classes. *Statistics and Probability Letters*, 116, 37–47.

Examples

sX <- function(x1, x2) sgumbel_biv(x1, x2, k1 = 2, k2 = 1)
sY <- function(x1, x2) sgumbel_biv(x1, x2, k1 = 1, k2 = 1)
biv_brlmr_order(sX, sY, t2_fixed = 0.5)


Bivariate Hazard Gradient

Description

Computes the bivariate hazard gradient

h_i(t_1,t_2) = -\frac{\partial}{\partial t_i}\log\bar{F}(t_1,t_2), \quad i = 1, 2.

Usage

biv_hazard_gradient(
  t1,
  t2,
  surv_fn = NULL,
  k1 = 1,
  k2 = 1,
  theta = 0,
  eps = 1e-07
)

Arguments

t1, t2

Evaluation points (non-negative).

surv_fn

A function function(x1, x2) returning the joint survival probability. Defaults to Gumbel bivariate exponential.

k1, k2, theta

Parameters for the default Gumbel distribution.

eps

Step size for numerical differentiation (default 1e-7).

Value

A named numeric vector (h1, h2).

References

Jayalekshmi S., Rajesh G., Nair N.U. (2022). doi:10.1080/03610926.2022.2085874

Examples

biv_hazard_gradient(t1 = 1, t2 = 1)
biv_hazard_gradient(t1 = 0.5, t2 = 0.5, k1 = 2, k2 = 1.5, theta = 0.3)


Bivariate Mean Residual Life Function

Description

Computes the bivariate mean residual life (MRL) function

m_1(t_1,t_2) = E(X_{t_1|t_2}) = \frac{\int_{t_1}^{\infty} \bar{F}(x_1,t_2)\,dx_1}{\bar{F}(t_1,t_2)}

and analogously m_2(t_1,t_2).

Usage

biv_mean_residual(
  t1,
  t2,
  surv_fn = NULL,
  k1 = 1,
  k2 = 1,
  theta = 0,
  upper = 100
)

Arguments

t1, t2

Non-negative thresholds.

surv_fn

Joint survival function; defaults to Gumbel bivariate exponential.

k1, k2, theta

Gumbel parameters (used when surv_fn = NULL).

upper

Upper integration bound (default 100).

Value

A named numeric vector (m1, m2).

References

Jayalekshmi S., Rajesh G., Nair N.U. (2022). doi:10.1080/03610926.2022.2085874

Examples

biv_mean_residual(t1 = 0.5, t2 = 0.5)
biv_mean_residual(t1 = 1, t2 = 0.5, k1 = 1, k2 = 2, theta = 0.2)


Bivariate Reversed Hazard Gradient

Description

Computes the bivariate reversed hazard gradient

h_i(x_1,x_2) = \frac{\partial}{\partial x_i}\log F(x_1,x_2), \quad i = 1, 2.

Usage

biv_rhazard_gradient(x1, x2, cdf_fn = NULL, theta = 0, eps = 1e-07)

Arguments

x1, x2

Positive evaluation points.

cdf_fn

Joint CDF function; defaults to FGM with parameter theta.

theta

FGM parameter (used when cdf_fn = NULL).

eps

Numerical differentiation step.

Value

Named numeric vector (rh1, rh2).

References

Jayalekshmi S., Rajesh G. — IJRQSE, Section 2.

Examples

biv_rhazard_gradient(x1 = 0.5, x2 = 0.5, theta = 0.3)


Bivariate Reversed Mean Residual Life Function

Description

Computes the bivariate reversed mean residual life (RMRL):

m_1(x_1,x_2) = \frac{\int_0^{x_1} F(t_1,x_2)\,dt_1}{F(x_1,x_2)}, \quad m_2(x_1,x_2) = \frac{\int_0^{x_2} F(x_1,t_2)\,dt_2}{F(x_1,x_2)}.

Usage

biv_rmrl(x1, x2, cdf_fn = NULL, theta = 0)

Arguments

x1, x2

Positive evaluation points.

cdf_fn

Joint CDF; defaults to FGM.

theta

FGM parameter.

Value

Named numeric vector (m1, m2).

References

Jayalekshmi S., Rajesh G. — IJRQSE, Section 2.

Examples

biv_rmrl(x1 = 0.5, x2 = 0.5, theta = 0.3)
biv_rmrl(x1 = 0.7, x2 = 0.4, theta = -0.2)


Weak Bivariate Hazard Rate Order

Description

Checks whether X \le_{\rm whr} Y: the ratio \bar{F}_Y(x_1,x_2) / \bar{F}_X(x_1,x_2) is increasing in (x_1,x_2), i.e.\ h_{i,X}(t_1,t_2) \ge h_{i,Y}(t_1,t_2),\; i=1,2.

Usage

biv_whr_order(
  surv_X,
  surv_Y,
  t1_grid = seq(0.1, 3, by = 0.5),
  t2_grid = seq(0.1, 3, by = 0.5),
  tol = 1e-06
)

Arguments

surv_X, surv_Y

Joint survival functions.

t1_grid, t2_grid

Evaluation grids.

tol

Tolerance.

Value

A list: order_holds (logical), violations (data frame).

References

Shaked M., Shanthikumar J.G. (2007). *Stochastic Orders*. Springer. Jayalekshmi S., Rajesh G., Nair N.U. (2022). doi:10.1080/03610926.2022.2085874

Examples

sX <- function(x1, x2) sgumbel_biv(x1, x2, k1 = 1, k2 = 1, theta = 0)
sY <- function(x1, x2) sgumbel_biv(x1, x2, k1 = 2, k2 = 2, theta = 0)
biv_whr_order(sX, sY)


Weak Bivariate Mean Residual Life Order

Description

Checks whether X \le_{\rm wmrl} Y: m_{i,X}(t_1,t_2) \le m_{i,Y}(t_1,t_2),\; i=1,2.

Usage

biv_wmrl_order(
  surv_X,
  surv_Y,
  t1_grid = seq(0.1, 2, by = 0.5),
  t2_grid = seq(0.1, 2, by = 0.5),
  tol = 1e-06
)

Arguments

surv_X, surv_Y

Joint survival functions.

t1_grid, t2_grid

Evaluation grids.

tol

Tolerance.

Value

List with order_holds and violations.

References

Jayalekshmi S., Rajesh G., Nair N.U. (2022). doi:10.1080/03610926.2022.2085874

Examples

sX <- function(x1, x2) sgumbel_biv(x1, x2, k1 = 1.5, k2 = 1.5)
sY <- function(x1, x2) sgumbel_biv(x1, x2, k1 = 1, k2 = 1)
biv_wmrl_order(sX, sY)


Weak Bivariate Reversed Hazard Rate Order

Description

Checks X \le_{\rm wrhr} Y: the ratio F_X(x_1,x_2)/F_Y(x_1,x_2) is decreasing in (x_1,x_2), i.e.\ h_{i,X}(x_1,x_2) \le h_{i,Y}(x_1,x_2),\; i=1,2.

Usage

biv_wrhr_order(
  cdf_X,
  cdf_Y,
  x1_grid = seq(0.1, 0.9, by = 0.2),
  x2_grid = seq(0.1, 0.9, by = 0.2),
  tol = 1e-06
)

Arguments

cdf_X, cdf_Y

Joint CDFs.

x1_grid, x2_grid

Evaluation grids (positive values).

tol

Tolerance.

Value

List with order_holds and violations.

References

Jayalekshmi S., Rajesh G. — IJRQSE, Section 2.

Examples

cX <- function(x1, x2) pfgm_biv(x1, x2, theta = 0.2)
cY <- function(x1, x2) pfgm_biv(x1, x2, theta = 0.5)
biv_wrhr_order(cX, cY)


Weak Bivariate Reversed Mean Residual Life Order

Description

Checks X \le_{\rm wrmrl} Y: m_{i,X}(x_1,x_2) \ge m_{i,Y}(x_1,x_2),\; i=1,2.

Usage

biv_wrmrl_order(
  cdf_X,
  cdf_Y,
  x1_grid = seq(0.2, 0.8, by = 0.2),
  x2_grid = seq(0.2, 0.8, by = 0.2),
  tol = 1e-06
)

Arguments

cdf_X, cdf_Y

Joint CDFs.

x1_grid, x2_grid

Evaluation grids.

tol

Tolerance.

Value

List with order_holds and violations.

References

Jayalekshmi S., Rajesh G. — IJRQSE, Section 2.

Examples

cX <- function(x1, x2) pfgm_biv(x1, x2, theta = 0.1)
cY <- function(x1, x2) pfgm_biv(x1, x2, theta = 0.8)
biv_wrmrl_order(cX, cY)


Bivariate Power Distribution

Description

Distribution function, survival function, density, and random generation for the bivariate power distribution:

F(x_1,x_2) = x_1^{p_1 + \theta \log x_2}\, x_2^{p_2},\quad 0 \le x_1,x_2 \le p_2,\; p_1,p_2 > 0,\; 0 \le \theta \le 1.

Usage

pbivpower(x1, x2, p1 = 1, p2 = 1, theta = 0)

sbivpower(x1, x2, p1 = 1, p2 = 1, theta = 0)

dbivpower(x1, x2, p1 = 1, p2 = 1, theta = 0)

rbivpower(n, p1 = 1, p2 = 1, theta = 0)

Arguments

x1, x2

Values in the support.

p1, p2

Positive shape parameters.

theta

Association parameter, 0 \le \theta \le 1.

n

Number of random observations.

Value

Numeric vector or two-column matrix (rbivpower).

References

Jayalekshmi S., Rajesh G. Bivariate Laplace transform order and ordering of reversed residual lives. *International Journal of Reliability, Quality and Safety Engineering*.

Examples

pbivpower(0.4, 0.5, p1 = 2, p2 = 2, theta = 0.3)
set.seed(7); head(rbivpower(30, p1 = 2, p2 = 2, theta = 0.2))


Bivariate Laplace Transform Order of Residual Lives (BLt-rl)

Description

Checks whether random vector X is smaller than Y in the bivariate Laplace transform order of residual lives (BLt-rl).

X \le_{\rm BLt\text{-}rl} Y if and only if for all (t_1,t_2) in the support:

\frac{\int_{t_1}^\infty e^{-s_1 x_1}\bar{F}_X(x_1,t_2)\,dx_1}{ e^{-s_1 t_1}\bar{F}_X(t_1,t_2)} \ge \frac{\int_{t_1}^\infty e^{-s_1 x_1}\bar{F}_Y(x_1,t_2)\,dx_1}{ e^{-s_1 t_1}\bar{F}_Y(t_1,t_2)}

i.e.\ L^*_{X_{t_1|t_2}}(s_1) \ge L^*_{Y_{t_1|t_2}}(s_1) for all t_1,t_2,s_1. The function evaluates this inequality at a grid.

Usage

blt_order_residual(
  surv_X,
  surv_Y,
  s1 = 1,
  s2 = 1,
  t1_grid = seq(0.1, 3, by = 0.5),
  t2_grid = seq(0.1, 3, by = 0.5),
  tol = 1e-06
)

Arguments

surv_X, surv_Y

Joint survival functions for X and Y respectively, each of the form function(x1, x2).

s1, s2

Laplace parameters to evaluate at.

t1_grid, t2_grid

Grids of truncation times (default 0.1 to 3).

tol

Tolerance for declaring inequality (default 1e-6).

Value

A list with elements:

order_holds

Logical; TRUE if X \le Y at all grid points.

violations

Data frame of grid points where the ordering fails.

ratio_matrix

Matrix of L^*_X / L^*_Y values.

References

Jayalekshmi S., Rajesh G., Nair N.U. (2022), Definition 4.1 & Prop. 4.1. doi:10.1080/03610926.2022.2085874

See Also

blt_residual, biv_whr_order

Examples

# Compare two Gumbel distributions
sX <- function(x1, x2) sgumbel_biv(x1, x2, k1 = 1, k2 = 1, theta = 0.2)
sY <- function(x1, x2) sgumbel_biv(x1, x2, k1 = 2, k2 = 2, theta = 0.2)
blt_order_residual(sX, sY, s1 = 1, s2 = 1,
                   t1_grid = c(0.1, 0.5, 1), t2_grid = c(0.1, 0.5))


Bivariate Laplace Transform Order of Reversed Residual Lives (BLt-Rrl)

Description

Checks whether X \le_{\rm BLt\text{-}Rrl} Y: for all (t_1,t_2), L^{X}_{t_1|t_2}(s_1) \ge L^{Y}_{t_1|t_2}(s_2).

Usage

blt_order_reversed(
  cdf_X,
  cdf_Y,
  s1 = 1,
  s2 = 1,
  t1_grid = seq(0.2, 0.8, by = 0.2),
  t2_grid = seq(0.2, 0.8, by = 0.2),
  tol = 1e-06
)

Arguments

cdf_X, cdf_Y

Joint CDF functions for X and Y.

s1, s2

Laplace parameters.

t1_grid, t2_grid

Grids of truncation times.

tol

Tolerance.

Value

Same structure as blt_order_residual.

References

Jayalekshmi S., Rajesh G. — IJRQSE, Definition 2.

See Also

blt_reversed, biv_wrhr_order

Examples

cX <- function(x1, x2) pfgm_biv(x1, x2, theta = 0.3)
cY <- function(x1, x2) pfgm_biv(x1, x2, theta = 0.5)
blt_order_reversed(cX, cY, s1 = 1, s2 = 1,
                   t1_grid = c(0.2, 0.5), t2_grid = c(0.2, 0.5))


Bivariate Laplace Transform of Residual Lives

Description

Computes the bivariate Laplace transform of residual lives L_{X_{t_1|t_2}}(s_1) and L_{X_{t_2|t_1}}(s_2) defined as

L_{X_{t_1|t_2}}(s_1) = \frac{\int_{t_1}^{\infty} e^{-s_1 x_1} f(x_1 | X_2 > t_2)\,dx_1}{e^{-s_1 t_1} \bar{F}(t_1 | X_2 > t_2)}

and analogously for the second component.

The *star* version (used for ordering) is

L^*_{X_{t_1|t_2}}(s_1) = \frac{1 - L_{X_{t_1|t_2}}(s_1)}{s_1} = \frac{\int_{t_1}^{\infty} e^{-s_1 x_1} \bar{F}(x_1, t_2)}{e^{-s_1 t_1}\bar{F}(t_1,t_2)}\,dx_1.

Usage

blt_residual(
  s1,
  s2,
  t1 = 0,
  t2 = 0,
  surv_fn = NULL,
  k1 = 1,
  k2 = 1,
  theta = 0,
  upper = 50,
  star = FALSE
)

Arguments

s1, s2

Positive Laplace parameters.

t1, t2

Non-negative time thresholds (truncation ages).

surv_fn

A function function(x1, x2) returning the joint survival probability \bar{F}(x_1, x_2). Defaults to the Gumbel bivariate exponential with k1, k2, theta.

k1, k2

Rate parameters (used only when surv_fn = NULL).

theta

Association parameter (used only when surv_fn = NULL).

upper

Integration upper bound (default 50).

star

Logical; if TRUE returns the star version L^*.

Value

A named numeric vector with elements L1 and L2 (or L1_star and L2_star when star = TRUE).

References

Jayalekshmi S., Rajesh G., Nair N.U. (2022). doi:10.1080/03610926.2022.2085874

See Also

blt_residual_gumbel, blt_order_residual, np_blt_residual

Examples

# Gumbel bivariate exponential, default parameters
blt_residual(s1 = 1, s2 = 1, t1 = 0.5, t2 = 0.5)

# Star version used in ordering
blt_residual(s1 = 0.5, s2 = 0.5, t1 = 1, t2 = 1, star = TRUE)

# User-supplied survival function (Schur-constant exponential)
surv <- function(x1, x2) exp(-(x1 + x2))
blt_residual(s1 = 1, s2 = 1, t1 = 0.3, t2 = 0.3, surv_fn = surv)


Closed-Form Bivariate Laplace Transform of Residual Lives (Gumbel)

Description

Returns the *star* bivariate Laplace transform of residual lives for the Gumbel bivariate exponential distribution in closed form:

L^*_{X_{t_1|t_2}}(s_1) = \frac{1}{k_1 + s_1 + \theta t_2},\quad L^*_{X_{t_2|t_1}}(s_2) = \frac{1}{k_2 + s_2 + \theta t_1}.

Usage

blt_residual_gumbel(s1, s2, t1 = 0, t2 = 0, k1 = 1, k2 = 1, theta = 0)

Arguments

s1, s2

Positive Laplace parameters.

t1, t2

Non-negative truncation ages.

k1, k2

Positive rate parameters.

theta

Non-negative association parameter.

Value

A named numeric vector (L1_star, L2_star).

References

Jayalekshmi S., Rajesh G., Nair N.U. (2022), Example 3.1. doi:10.1080/03610926.2022.2085874

See Also

blt_residual

Examples

blt_residual_gumbel(s1 = 1, s2 = 1, t1 = 0.5, t2 = 0.5)
blt_residual_gumbel(s1 = 2, s2 = 0.5, t1 = 0, t2 = 1, k1 = 2, k2 = 1, theta = 0.3)


Bivariate Laplace Transform of Reversed Residual Lives

Description

Computes the bivariate Laplace transform of reversed (past) residual lives. For a random pair (X_1,X_2) with joint distribution function F(x_1,x_2), the transform is

L_{t_1|t_2}(s_1) = e^{-s_1 t_1} + \frac{s_1 \int_0^{t_1} e^{-s_1 x_1} F(x_1, t_2)\,dx_1}{F(t_1, t_2)}

and the associated G function (useful for ordering) is

G_1(t_1,t_2) = \frac{\int_0^{t_1} e^{-s_1 x_1} F(x_1, t_2)\,dx_1}{ e^{-s_1 t_1} F(t_1,t_2)}.

Usage

blt_reversed(s1, s2, t1, t2, cdf_fn = NULL, theta = 0, g_form = FALSE)

Arguments

s1, s2

Positive Laplace parameters.

t1, t2

Positive truncation times (t_i > 0).

cdf_fn

A function function(x1, x2) returning the joint CDF F(x_1,x_2). Defaults to the FGM distribution.

theta

FGM association parameter (used when cdf_fn = NULL).

g_form

Logical; if TRUE returns the G form instead of L.

Value

A named numeric vector (L1, L2) or (G1, G2).

References

Jayalekshmi S., Rajesh G. Bivariate Laplace transform order and ordering of reversed residual lives. *International Journal of Reliability, Quality and Safety Engineering*.

See Also

blt_reversed_fgm, blt_order_reversed

Examples

# FGM distribution (default)
blt_reversed(s1 = 1, s2 = 1, t1 = 0.6, t2 = 0.6)

# G form
blt_reversed(s1 = 1, s2 = 1, t1 = 0.6, t2 = 0.6, g_form = TRUE)

# User-supplied CDF
cdf <- function(x1, x2) pfgm_biv(x1, x2, theta = 0.5)
blt_reversed(s1 = 1, s2 = 1, t1 = 0.5, t2 = 0.5, cdf_fn = cdf)


Closed-Form BLT of Reversed Residual Lives for the FGM Distribution

Description

Computes the bivariate Laplace transform of the FGM distribution in closed form (Jayalekshmi and Rajesh, Example 1):

L_X(s_1,s_2) = \frac{(1-e^{-s_1})(1-e^{-s_2})}{s_1 s_2} + \theta \Phi(s_1,s_2)

where \Phi captures the dependence correction.

Usage

blt_reversed_fgm(s1, s2, theta = 0)

Arguments

s1, s2

Positive Laplace parameters.

theta

FGM association parameter, |\theta| \le 1.

Value

Scalar numeric; the joint bivariate Laplace transform.

References

Jayalekshmi S., Rajesh G. Bivariate Laplace transform order and ordering of reversed residual lives. *International Journal of Reliability, Quality and Safety Engineering*, Example 1.

Examples

blt_reversed_fgm(s1 = 1, s2 = 1, theta = 0.5)
blt_reversed_fgm(s1 = 2, s2 = 0.5, theta = -0.3)


Bivariate Laplace Transform of Reversed Residual Lives — Power Distribution

Description

Computes the G_1 function for the bivariate power distribution:

G_1(t_1,t_2) = \frac{\int_0^{t_1} e^{-s_1 x_1} x_1^{p_1+\theta\log t_2}\,dx_1}{e^{-s_1 t_1}\, t_1^{p_1+\theta\log t_2}}

evaluated numerically.

Usage

blt_reversed_power(s1, t1, t2, p1 = 1, p2 = 1, theta = 0)

Arguments

s1

Positive Laplace parameter.

t1, t2

Positive truncation times.

p1, p2

Positive shape parameters.

theta

Association parameter, 0 \le \theta \le 1.

Value

Named numeric vector (G1, reversed_hazard_h1).

References

Jayalekshmi S., Rajesh G. — IJRQSE, Example 2.

Examples

blt_reversed_power(s1 = 1, t1 = 0.5, t2 = 0.5, p1 = 2, p2 = 2, theta = 0.3)


Farlie-Gumbel-Morgenstern (FGM) Bivariate Distribution

Description

Density, distribution function, survival function, and random generation for the FGM bivariate distribution on [0,1]^2:

F(x_1, x_2) = x_1 x_2 \bigl[1 + \theta(1-x_1)(1-x_2)\bigr], \quad 0 \le x_1, x_2 \le 1,\; |\theta| \le 1.

Usage

pfgm_biv(x1, x2, theta = 0)

dfgm_biv(x1, x2, theta = 0)

sfgm_biv(x1, x2, theta = 0)

rfgm_biv(n, theta = 0)

Arguments

x1, x2

Values in [0,1].

theta

Association parameter, |\theta| \le 1.

n

Number of random observations.

Value

Numeric vector (scalar functions) or two-column matrix (rfgm_biv).

References

Jayalekshmi S., Rajesh G. Bivariate Laplace transform order and ordering of reversed residual lives. *International Journal of Reliability, Quality and Safety Engineering*.

Examples

pfgm_biv(0.4, 0.6, theta = 0.5)
dfgm_biv(0.4, 0.6, theta = 0.5)
set.seed(1); head(rfgm_biv(50, theta = 0.5))


Gumbel Bivariate Exponential Distribution

Description

Density, distribution (survival) function, and random generation for the Gumbel bivariate exponential distribution with parameters k_1, k_2, and association parameter \theta.

The joint survival function is

\bar{F}(x_1,x_2) = \exp(-k_1 x_1 - k_2 x_2 - \theta x_1 x_2), \quad x_1,x_2 > 0,\; k_1,k_2 > 0,\; 0 \le \theta \le k_1 k_2.

Usage

dgumbel_biv(x1, x2, k1 = 1, k2 = 1, theta = 0, log.p = FALSE)

sgumbel_biv(x1, x2, k1 = 1, k2 = 1, theta = 0, log.p = FALSE)

pgumbel_biv(x1, x2, k1 = 1, k2 = 1, theta = 0)

rgumbel_biv(n, k1 = 1, k2 = 1, theta = 0)

Arguments

x1, x2

Non-negative numeric values or vectors.

k1, k2

Positive rate parameters.

theta

Non-negative association parameter; must satisfy 0 \le \theta \le k_1 k_2.

log.p

Logical; if TRUE probabilities are given as \log(p).

n

Number of random observations.

Value

dgumbel_biv

Numeric vector of density values.

pgumbel_biv

Numeric vector of joint CDF values.

sgumbel_biv

Numeric vector of joint survival function values.

rgumbel_biv

A two-column matrix with columns X1 and X2 containing the simulated observations.

References

Gumbel E.J. (1960). Bivariate exponential distributions. *Journal of the American Statistical Association*, 55(292), 698–707.

Jayalekshmi S., Rajesh G., Nair N.U. (2022). doi:10.1080/03610926.2022.2085874

Examples

# Survival function
sgumbel_biv(1, 2, k1 = 1, k2 = 1, theta = 0.5)

# Density
dgumbel_biv(0.5, 0.5, k1 = 1, k2 = 1.5, theta = 0.3)

# Random sample
set.seed(42)
dat <- rgumbel_biv(100, k1 = 1, k2 = 1, theta = 0.5)
head(dat)


Golomb Information Generating Function

Description

Computes the information generating function (IGF) introduced by Golomb (1966):

\mathcal{I}_\alpha(f) = \int_0^\infty f^\alpha(x)\,dx, \quad \alpha > 0.

When \alpha \to 1, -d\mathcal{I}_\alpha / d\alpha|_{\alpha=1} = H(f).

Usage

info_gen_function(dens_fn, alpha = 1, upper = 100)

Arguments

dens_fn

A function of one argument returning the density.

alpha

Positive parameter (default 1).

upper

Upper integration limit.

Value

Scalar numeric.

References

Golomb S.W. (1966). The information generating function of a probability distribution. *IEEE Transactions on Information Theory*, 12(1), 75–77.

See Also

residual_info_gen

Examples

# Exponential(1) with alpha=1 gives 1
info_gen_function(function(x) dexp(x, rate = 1), alpha = 1)

# alpha = 2
info_gen_function(function(x) dexp(x, rate = 1), alpha = 2)


Test NBUHR / NWUHR Aging Class

Description

Checks whether a bivariate lifetime distribution belongs to the NBUHR (New Better than Used in Hazard Rate) or NWUHR (New Worse than Used) aging class. A distribution is NBUHR if

h_1(0,t_2) \ge h_1(t_1,t_2)\;\text{ for all }t_1 > 0

and similarly for the second component. The function evaluates this at a grid of t_1 values.

Usage

nbuhr_test(
  t2 = 1,
  t1_grid = seq(0.1, 5, by = 0.1),
  surv_fn = NULL,
  k1 = 1,
  k2 = 1,
  theta = 0
)

Arguments

t2

Fixed value of the second age coordinate.

t1_grid

Numeric vector of t_1 values to check (default 0.1 to 5 in steps of 0.1).

surv_fn

Joint survival function; defaults to Gumbel bivariate exponential.

k1, k2, theta

Gumbel parameters.

Value

A list with components:

class1

Character: "NBUHR", "NWUHR", or "neither" for the first component.

class2

Same for the second component.

h1_grid

Numeric vector of h_1(t_1,t_2) values.

h2_grid

Numeric vector of h_2(t_1,t_2) values.

References

Jayalekshmi S., Rajesh G., Nair N.U. (2022), Definition 3.2. doi:10.1080/03610926.2022.2085874

Examples

nbuhr_test(t2 = 1, k1 = 1, k2 = 1, theta = 0.3)
nbuhr_test(t2 = 0.5,
           surv_fn = function(x1, x2) exp(-(x1 + x2)))


Nonparametric Estimator for the Bivariate Laplace Transform of Residual Lives

Description

Given a bivariate sample (X_{1i}, X_{2i}),\; i=1,\ldots,n, estimates

\hat{L}^*_{1}(s_1; t_1, t_2) = \frac{\sum_{i:X_{1i}>t_1,\,X_{2i}>t_2} \int_{t_1}^{X_{1i}} e^{-s_1 u}\,du}{e^{-s_1 t_1} \cdot \#\{X_{1i}>t_1,X_{2i}>t_2\}}

and analogously for the second component, using the empirical survival function as described in Jayalekshmi et al. (2022), Section 6.

Usage

np_blt_residual(data, s1, s2, t1 = 0, t2 = 0)

Arguments

data

A two-column numeric matrix or data frame with columns for X_1 and X_2.

s1, s2

Positive Laplace parameters.

t1, t2

Non-negative truncation ages.

Value

A named numeric vector (L1_hat, L2_hat).

References

Jayalekshmi S., Rajesh G., Nair N.U. (2022), Section 6. doi:10.1080/03610926.2022.2085874

See Also

blt_residual_gumbel, sim_blt_residual

Examples

set.seed(123)
dat <- rgumbel_biv(200, k1 = 1, k2 = 1, theta = 0.5)
np_blt_residual(dat, s1 = 1, s2 = 1, t1 = 0.3, t2 = 0.3)

# Compare with closed form
blt_residual_gumbel(s1 = 1, s2 = 1, t1 = 0.3, t2 = 0.3, theta = 0.5)


Nonparametric Estimator for the Residual Entropy Generating Function

Description

Given a univariate sample X_1,\ldots,X_n, estimates the REGF using a kernel density estimator for f and the empirical survival function for \bar{F}(t):

\hat{\mathcal{I}}_\alpha(t) = \sum_{i:X_i > t} \frac{\hat{f}(X_i)^{\alpha - 1}}{(n\,\hat{F}_n(t))^\alpha} \cdot \frac{1}{n}

where \hat{f} is a Gaussian kernel density estimator.

Usage

np_residual_info_gen(x, alpha = 1, t = 0, bw = NULL)

Arguments

x

Numeric vector; observed sample.

alpha

Positive parameter (default 1).

t

Truncation time (default 0).

bw

Bandwidth for KDE; uses bw.nrd0 if NULL.

Value

Scalar numeric estimate of REGF.

References

Smitha S., Rajesh G., Jayalekshmi S. (2024), Section 4. *Journal of the Indian Statistical Association*, 62(1), 81–93.

See Also

residual_info_gen, sim_regf

Examples

set.seed(1)
x <- rexp(100, rate = 1)
np_residual_info_gen(x, alpha = 2, t = 0)

# Compare with true value
f  <- function(x) dexp(x, 1)
Fb <- function(x) pexp(x, 1, lower.tail = FALSE)
residual_info_gen(f, Fb, alpha = 2, t = 0)


Plot Bivariate Laplace Transform of Residual Lives

Description

Plots the star Laplace transform of residual lives L^*_{X_{t_1|t_2}}(s_1) as a function of t_1 for fixed s_1, t_2. Optionally overlays two distributions for visual comparison of the BLt-rl order.

Usage

plot_blt_residual(
  surv_fn,
  surv_fn2 = NULL,
  s1 = 1,
  t2 = 0.5,
  t1_grid = seq(0.1, 3, by = 0.1),
  k1 = 1,
  k2 = 1,
  theta = 0,
  xlab = expression(t[1]),
  ylab = expression(L^"*"[X[t[1] * "|" * t[2]]](s[1])),
  main = "Bivariate LT of Residual Lives",
  col1 = "steelblue",
  col2 = "firebrick",
  lwd = 2,
  legend_labels = c("Distribution 1", "Distribution 2")
)

Arguments

surv_fn

Joint survival function. If a second distribution is to be overlaid, pass it as surv_fn2.

surv_fn2

Optional second survival function for comparison.

s1

Laplace parameter (default 1).

t2

Fixed second truncation age (default 0.5).

t1_grid

Grid of first truncation ages.

k1, k2, theta

Parameters for the default Gumbel distribution; used only when surv_fn = NULL.

xlab, ylab, main

Plot labels.

col1, col2

Line colours.

lwd

Line width.

legend_labels

Length-2 character vector for legend (ignored if surv_fn2 = NULL).

Value

Invisibly returns the data frame used for plotting.

Examples

sX <- function(x1, x2) sgumbel_biv(x1, x2, k1 = 1, k2 = 1, theta = 0.3)
sY <- function(x1, x2) sgumbel_biv(x1, x2, k1 = 2, k2 = 1, theta = 0.3)
plot_blt_residual(sX, sY, s1 = 1, t2 = 0.5,
                  legend_labels = c("k1=1", "k1=2"))


Plot Bivariate Laplace Transform of Reversed Residual Lives

Description

Plots the reversed-life Laplace transform L_{t_1|t_2}(s_1) as a function of t_1 for fixed s_1 and t_2.

Usage

plot_blt_reversed(
  cdf_fn,
  cdf_fn2 = NULL,
  s1 = 1,
  t2 = 0.5,
  t1_grid = seq(0.1, 0.9, by = 0.05),
  theta = 0,
  xlab = expression(t[1]),
  ylab = expression(L[t[1] * "|" * t[2]](s[1])),
  main = "Bivariate LT of Reversed Residual Lives",
  col1 = "darkgreen",
  col2 = "darkorange",
  lwd = 2,
  legend_labels = c("Distribution 1", "Distribution 2")
)

Arguments

cdf_fn

Joint CDF function.

cdf_fn2

Optional second CDF for comparison.

s1

Laplace parameter.

t2

Fixed second truncation time.

t1_grid

Grid of first truncation times.

theta

FGM parameter (used if cdf_fn = NULL).

xlab, ylab, main

Plot labels.

col1, col2

Line colours.

lwd

Line width.

legend_labels

Legend labels.

Value

Invisibly returns the data frame used for plotting.

Examples

cX <- function(x1, x2) pfgm_biv(x1, x2, theta = 0.2)
cY <- function(x1, x2) pfgm_biv(x1, x2, theta = 0.7)
plot_blt_reversed(cX, cY, s1 = 1, t2 = 0.5,
                  legend_labels = c("theta=0.2", "theta=0.7"))


Plot Residual Entropy Generating Function

Description

Plots the REGF \mathcal{I}_\alpha(X;t) as a function of t for given \alpha, or as a function of \alpha for given t.

Usage

plot_regf(
  dens_fn,
  surv_fn = NULL,
  alpha = 2,
  t = 0,
  grid = NULL,
  vary = c("t", "alpha"),
  upper = 100,
  col = "purple",
  lwd = 2,
  main = NULL
)

Arguments

dens_fn

Density function.

surv_fn

Survival function; computed if NULL.

alpha

Positive parameter (used when vary = "t").

t

Truncation time (used when vary = "alpha").

grid

Numeric vector of the varying quantity values.

vary

One of "t" (plot as function of t) or "alpha" (plot as function of \alpha).

upper

Integration upper bound.

col

Line colour.

lwd

Line width.

main

Plot title.

Value

Invisibly returns the data frame used for plotting.

Examples

f  <- function(x) dexp(x, 1)
Fb <- function(x) pexp(x, 1, lower.tail = FALSE)
plot_regf(f, Fb, alpha = 2, vary = "t")
plot_regf(f, Fb, t = 0.5, vary = "alpha")


Characterise a Distribution via the REGF

Description

Checks whether the functional form of \mathcal{I}_\alpha(X;t) over a grid of t values is consistent with an exponential distribution. For X \sim \text{Exp}(\lambda), \mathcal{I}_\alpha(t) / \mathcal{I}_\alpha(0) = e^{(\alpha-1)\lambda t}, a pure exponential in t.

Usage

regf_characterise(
  dens_fn,
  surv_fn = NULL,
  alpha = 2,
  t_grid = seq(0, 2, by = 0.2),
  upper = 100
)

Arguments

dens_fn

Density function.

surv_fn

Survival function.

alpha

REGF parameter.

t_grid

Grid of truncation times.

upper

Integration upper bound.

Value

A data frame with columns t, REGF, log_REGF, and the fitted linear-in-t slope slope (log-linear characterisation).

References

Smitha S., Rajesh G., Jayalekshmi S. (2024), Section 3.

Examples

f  <- function(x) dexp(x, 1)
Fb <- function(x) pexp(x, 1, lower.tail = FALSE)
regf_characterise(f, Fb, alpha = 2)


REGF Profile Over Alpha

Description

Evaluates residual_info_gen over a grid of \alpha values and optionally plots the result. Useful for studying how the information content varies with the Renyi-type parameter.

Usage

regf_profile(
  dens_fn,
  surv_fn = NULL,
  alpha_grid = seq(0.1, 3, by = 0.2),
  t = 0,
  upper = 100,
  plot = FALSE
)

Arguments

dens_fn

Density function.

surv_fn

Survival function; computed internally if NULL.

alpha_grid

Numeric vector of \alpha values (default 0.1 to 3).

t

Truncation time.

upper

Integration upper bound.

plot

Logical; if TRUE plots the profile (default FALSE).

Value

A data frame with columns alpha and REGF.

Examples

f  <- function(x) dexp(x, 1)
Fb <- function(x) pexp(x, 1, lower.tail = FALSE)
regf_profile(f, Fb, t = 0.5, plot = FALSE)


Residual Entropy Function

Description

Computes the residual entropy (dynamic entropy) introduced by Ebrahimi and Pellerey (1995):

H(X; t) = -\int_t^\infty \frac{f(x)}{\bar{F}(t)} \log\frac{f(x)}{\bar{F}(t)}\,dx, \quad t \ge 0.

Usage

residual_entropy(dens_fn, surv_fn = NULL, t = 0, upper = 100)

Arguments

dens_fn

Density function f(x).

surv_fn

Survival function \bar{F}(x); if NULL it is computed from dens_fn by integration.

t

Truncation time (default 0, which returns Shannon entropy).

upper

Upper integration limit.

Value

Scalar numeric.

References

Ebrahimi N., Pellerey F. (1995). New partial ordering of survival functions based on the notion of uncertainty. *Journal of Applied Probability*, 32(1), 202–211.

See Also

residual_info_gen, shannon_entropy

Examples

# Exponential(1)
f  <- function(x) dexp(x, 1)
Fb <- function(x) pexp(x, 1, lower.tail = FALSE)
residual_entropy(f, Fb, t = 0)   # = 1
residual_entropy(f, Fb, t = 1)   # = 1 + exp(-1) * log(exp(1)-1) or similar


Residual Entropy Generating Function (REGF)

Description

Computes the residual entropy generating function proposed by Smitha, Rajesh, and Jayalekshmi (2024):

\mathcal{I}_\alpha(X; t) = \int_t^\infty \left(\frac{f(x)}{\bar{F}(t)}\right)^\alpha dx, \quad \alpha > 0,\; t \ge 0.

Note that:

Usage

residual_info_gen(dens_fn, surv_fn = NULL, alpha = 1, t = 0, upper = 100)

Arguments

dens_fn

Density function f(x).

surv_fn

Survival function \bar{F}(x); computed by integration if NULL.

alpha

Positive parameter (default 1).

t

Truncation time (default 0).

upper

Upper integration limit.

Value

Scalar numeric.

References

Smitha S., Rajesh G., Jayalekshmi S. (2024). On residual entropy generating function. *Journal of the Indian Statistical Association*, 62(1), 81–93.

See Also

info_gen_function, residual_entropy, np_residual_info_gen

Examples

f  <- function(x) dexp(x, 1)
Fb <- function(x) pexp(x, 1, lower.tail = FALSE)

# At t=0, alpha=1: should equal 1
residual_info_gen(f, Fb, alpha = 1, t = 0)

# Dynamic version at t = 0.5
residual_info_gen(f, Fb, alpha = 2, t = 0.5)

# Derivative recovers residual entropy
(residual_info_gen(f, Fb, alpha = 1 + 1e-5, t = 0) -
  residual_info_gen(f, Fb, alpha = 1, t = 0)) / 1e-5   # approx -H(f)


Schur-Constant Bivariate Distribution

Description

Random generation and survival function for a Schur-constant bivariate distribution with survival function

\bar{F}(x_1,x_2) = S(x_1 + x_2),\quad x_1,x_2 > 0,

where S is a given univariate survival function. The default marginal is exponential with rate lambda.

Usage

sschur_biv(x1, x2, lambda = 1)

rschur_biv(n, lambda = 1)

Arguments

x1, x2

Non-negative values.

lambda

Exponential rate parameter for the generating survival function.

n

Number of random observations.

Value

Numeric vector (sschur_biv) or two-column matrix (rschur_biv).

References

Barlow R.E., Mendel M.B. (1992). De Finetti-type representations for life distributions. *Journal of the American Statistical Association*, 87(420), 1116–1122.

Examples

sschur_biv(0.5, 1, lambda = 1)
set.seed(2); head(rschur_biv(40, lambda = 1))


Shannon Differential Entropy

Description

Computes the Shannon differential entropy

H(f) = -\int_0^\infty f(x)\log f(x)\,dx

for a non-negative continuous random variable with density dens_fn.

Usage

shannon_entropy(dens_fn, upper = 100)

Arguments

dens_fn

A function of one argument returning the density f(x).

upper

Upper integration limit (default 100).

Value

Scalar numeric.

References

Shannon C.E. (1948). A mathematical theory of communication. *Bell System Technical Journal*, 27(3), 379–423.

Smitha S., Rajesh G., Jayalekshmi S. (2024). *Journal of the Indian Statistical Association*, 62(1), 81–93.

See Also

residual_entropy, info_gen_function

Examples

# Exponential(1): H = 1
shannon_entropy(function(x) dexp(x, rate = 1))

# Exponential(2): H = 1 - log(2)
shannon_entropy(function(x) dexp(x, rate = 2))


Monte-Carlo Simulation Study for the BLT Residual Estimator

Description

Evaluates the performance of np_blt_residual via repeated simulation from the Gumbel bivariate exponential distribution and compares estimates to the closed-form blt_residual_gumbel values. Returns bias, variance, and mean squared error (MSE).

Usage

sim_blt_residual(
  n_obs = 200,
  n_sim = 100,
  s1 = 1,
  s2 = 1,
  t1 = 0.3,
  t2 = 0.3,
  k1 = 1,
  k2 = 1,
  theta = 0.5,
  seed = 42L
)

Arguments

n_obs

Sample size per replicate.

n_sim

Number of simulation replicates.

s1, s2

Laplace parameters.

t1, t2

Truncation ages.

k1, k2, theta

Gumbel parameters.

seed

Random seed for reproducibility.

Value

A data frame with columns component, true_value, mean_est, bias, variance, mse.

References

Jayalekshmi S., Rajesh G., Nair N.U. (2022), Section 6. doi:10.1080/03610926.2022.2085874

See Also

np_blt_residual

Examples

sim_blt_residual(n_obs = 100, n_sim = 50, s1 = 1, s2 = 1,
                 t1 = 0.3, t2 = 0.3, k1 = 1, k2 = 1, theta = 0.5)


Monte-Carlo Simulation for the REGF Nonparametric Estimator

Description

Evaluates the performance of np_residual_info_gen via repeated simulation from the exponential distribution and compares to the true REGF \mathcal{I}_\alpha(\text{Exp}(\lambda); t) = \lambda^{\alpha-1} e^{(\alpha-1)\lambda t} / (\alpha-1).

Usage

sim_regf(lambda = 1, alpha = 2, t = 0, n_obs = 200, n_sim = 100, seed = 42L)

Arguments

lambda

Exponential rate.

alpha

REGF parameter.

t

Truncation time.

n_obs

Sample size per replicate.

n_sim

Number of replicates.

seed

Random seed.

Value

A data frame with true_value, mean_est, bias, variance, mse.

References

Smitha S., Rajesh G., Jayalekshmi S. (2024), Section 4.

See Also

np_residual_info_gen

Examples

sim_regf(lambda = 1, alpha = 2, t = 0, n_obs = 100, n_sim = 30)