UniLindleyApprox

Bayesian Point Estimation Using Lindley’s Approximation Under Censoring Schemes

UniLindleyApprox is a CRAN-quality R package for performing Bayesian parameter estimation using Lindley’s Approximation (1980) for arbitrary univariate probability distributions under complete, censored, and truncated data.

Features

Installation

# Install from CRAN (when available)
install.packages("UniLindleyApprox")

# Install development version
devtools::install_github("username/UniLindleyApprox")

Quick Start

library(UniLindleyApprox)

# Define probability functions for exponential distribution
dexp_custom <- function(x, theta) dexp(x, rate = theta[1])
pexp_custom <- function(x, theta) pexp(x, rate = theta[1])
sexp_custom <- function(x, theta) 1 - pexp(x, rate = theta[1])

# Define log-prior (Gamma prior for rate)
logprior <- function(theta) {
  dgamma(theta[1], shape = 2, rate = 1, log = TRUE)
}

# Generate data
set.seed(123)
x <- rexp(50, rate = 2)

# Fit model using Lindley's approximation
fit <- lindley_fit(
  data = x,
  pdf = dexp_custom,
  cdf = pexp_custom,
  survival = sexp_custom,
  log_prior = logprior,
  theta0 = c(1),
  scheme = "complete",
  loss = "SELF"
)

# View results
print(fit)
summary(fit)

# Diagnostic plots
plot(fit)

# Goodness-of-fit statistics
gof_stats(fit)

Supported Censoring Schemes

  1. Complete data
  2. Right censoring
  3. Left censoring
  4. Interval censoring
  5. Random censoring
  6. Block random censoring
  7. Type-I censoring
  8. Type-II censoring
  9. Progressive Type-II censoring
  10. Progressive first failure censoring
  11. Joint Type-I censoring
  12. Joint Type-II censoring
  13. Balanced joint progressive Type-II censoring
  14. Hybrid censoring
  15. Hybrid Type-I censoring
  16. Hybrid Type-II censoring
  17. Type-I hybrid censoring
  18. Type-II progressively hybrid censoring
  19. Doubly Type-II censoring
  20. Middle censoring
  21. Right truncation
  22. Left truncation

Supported Loss Functions

Model Selection Criteria

Goodness-of-Fit Statistics

Residual Types

Citation

If you use UniLindleyApprox in your research, please cite:

Tyagi, S., Pandey, A., Singh, B., & Tripathi, V. (2024). UniLindleyApprox: 
Bayesian Point Estimation Using Lindley's Approximation Under Censoring Schemes. 
R package version 0.1.0.

References

License

GPL-3

Authors

These packages complement each other while sharing a consistent interface and design philosophy.

mirror server hosted at Truenetwork, Russian Federation.