The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.

Benchmark Analyses and Case Studies with UniLindleyApprox

Shikhar Tyagi, Arvind Pandey, Bhupendra Singh, Vrijesh Tripathi

2026-07-29

Introduction

This vignette demonstrates the application of UniLindleyApprox to 14 benchmark probability distributions across survival analysis, reliability theory, and computational statistics literature:

  1. Exponential
  2. Weibull
  3. Gamma
  4. Normal
  5. Lognormal
  6. Lindley
  7. Inverse Gaussian
  8. Generalized Gamma
  9. Power Lindley
  10. Linear Failure Rate
  11. Power Failure Rate
  12. Modified Topp-Leone
  13. Power Xgamma
  14. Arvind Distribution

Weibull Distribution under Progressive Type-II Censoring

library(UniLindleyApprox)

# Weibull PDF, CDF, Survival (theta = c(shape, scale))
dweibull_custom <- function(x, theta) dweibull(x, shape = theta[1], scale = theta[2])
pweibull_custom <- function(x, theta) pweibull(x, shape = theta[1], scale = theta[2])
sweibull_custom <- function(x, theta) 1 - pweibull(x, shape = theta[1], scale = theta[2])

# Independent Gamma log-prior for shape and scale
logprior_weibull <- function(theta) {
  if (theta[1] <= 0 || theta[2] <= 0) return(-Inf)
  dgamma(theta[1], shape = 2, rate = 1, log = TRUE) +
    dgamma(theta[2], shape = 2, rate = 1, log = TRUE)
}

# Simulated progressive Type-II data
obs <- c(0.5, 1.2, 1.8, 2.5, 3.1)
R <- c(2, 0, 1, 0, 2)
data_prog <- list(observed = obs, removal_scheme = R, n_total = 10)

fit_weibull <- lindley_fit(
  data = data_prog,
  pdf = dweibull_custom,
  cdf = pweibull_custom,
  survival = sweibull_custom,
  log_prior = logprior_weibull,
  theta0 = c(1.5, 2.0),
  scheme = "progressive_type2",
  loss = "SELF",
  control = lindley.control(verbose = FALSE)
)

summary(fit_weibull)
#> Summary of Bayesian Estimation Using Lindley's Approximation
#> ============================================================
#> 
#> Model Information:
#>   Censoring Scheme: progressive_type2 
#>   Loss Function: SELF 
#>   Number of Parameters: 2 
#> 
#> Parameter Estimates:
#>  Parameter      MAP Bayes_Estimate Posterior_Mean
#>     theta1 1.745905       1.789724       1.789724
#>     theta2 2.723526       3.014287       3.014287
#> 
#> Model Fit:
#>   Log-Likelihood: -10.3624 
#>   Log-Posterior: -13.2726 
#>   AIC: 24.7248 
#>   BIC: 22.922 
#> 
#> Optimization:
#>   Convergence: Successful 
#>   Iterations: 15 
#>   Elapsed Time: 0.02 seconds
#> 
#> Information Matrix:
#>           [,1]      [,2]
#> [1,]  2.811730 -0.075062
#> [2,] -0.075062  2.827562

Lindley Distribution

The 1-parameter Lindley distribution has PDF \(f(x) = \frac{\theta^2}{1 + \theta} (1 + x) e^{-\theta x}\) for \(x > 0, \theta > 0\).

dlindley_custom <- function(x, theta) {
  th <- theta[1]
  if (th <= 0 || any(x <= 0)) return(rep(0, length(x)))
  (th^2 / (1 + th)) * (1 + x) * exp(-th * x)
}

plindley_custom <- function(x, theta) {
  th <- theta[1]
  1 - (1 + (th * x) / (1 + th)) * exp(-th * x)
}

slindley_custom <- function(x, theta) 1 - plindley_custom(x, theta)

set.seed(123)
x_lindley <- rexp(40, rate = 1.5)

fit_lindley <- lindley_fit(
  data = x_lindley,
  pdf = dlindley_custom,
  cdf = plindley_custom,
  survival = slindley_custom,
  log_prior = function(th) dgamma(th[1], 2, 1, log = TRUE),
  theta0 = c(1.0),
  scheme = "complete",
  loss = "LINEX",
  control = lindley.control(verbose = FALSE)
)

print(fit_lindley)
#> Bayesian Estimation Using Lindley's Approximation
#> ================================================
#> 
#> Censoring Scheme: complete 
#> Loss Function: LINEX 
#> 
#> Posterior Mode (MAP):
#> [1] 2.032641
#> 
#> Bayes Estimate (LINEX):
#> [1] 2.03515
#> 
#> Posterior Mean:
#> [1] 2.067922
#> 
#> Log-Likelihood: -21.8484 
#> Log-Posterior: -23.1717 
#> Convergence: Successful 
#> Iterations: 14 
#> Elapsed Time: 0.02 seconds

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.