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
- Generalized Framework: Works with any user-defined
univariate probability distribution
- Multiple Censoring Schemes: Supports 23 different
censoring and truncation schemes
- Loss Functions: Computes Bayes estimates under 8
different loss functions
- Automatic Derivatives: Numerical computation of
first, second, and third-order derivatives
- Comprehensive Diagnostics: Goodness-of-fit
statistics, residual analysis, model selection criteria
- Visualization: Diagnostic plots including posterior
surfaces, likelihood profiles, QQ plots
- Simulation Utilities: Functions for benchmarking
estimators under various censoring schemes
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
- Complete data
- Right censoring
- Left censoring
- Interval censoring
- Random censoring
- Block random censoring
- Type-I censoring
- Type-II censoring
- Progressive Type-II censoring
- Progressive first failure censoring
- Joint Type-I censoring
- Joint Type-II censoring
- Balanced joint progressive Type-II censoring
- Hybrid censoring
- Hybrid Type-I censoring
- Hybrid Type-II censoring
- Type-I hybrid censoring
- Type-II progressively hybrid censoring
- Doubly Type-II censoring
- Middle censoring
- Right truncation
- Left truncation
Supported Loss Functions
- SELF: Squared Error Loss Function
- WSELF: Weighted Squared Error Loss Function
- MQSELF: Modified Quadratic Squared Error Loss
Function
- PLF: Precautionary Loss Function
- ELF: Entropy Loss Function
- LINEX: Linear Exponential Loss Function
- GELF: General Entropy Loss Function
- K-Loss: K-Loss Function
Model Selection Criteria
- AIC (Akaike Information Criterion)
- AICc (Corrected AIC)
- BIC (Bayesian Information Criterion)
- HQIC (Hannan-Quinn Information Criterion)
- CAIC (Consistent AIC)
- KIC (Kullback Information Criterion)
Goodness-of-Fit Statistics
- Kolmogorov-Smirnov statistic
- Anderson-Darling statistic
- Cramér-von Mises statistic
- Watson statistic
- Chi-square statistic
- Mean Squared Error
- Mean Absolute Error
- Root Mean Squared Error
Residual Types
- Cox-Snell residuals
- Martingale residuals
- Deviance residuals
- Pearson residuals
- Generalized residuals
- Randomized quantile residuals
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
- Lindley, D. V. (1980). Approximate Bayesian methods. Trabajos de
Estadistica y de Investigacion Operativa, 31(1), 223-245.
- Tierney, L., & Kadane, J. B. (1986). Accurate approximations for
posterior moments and marginal densities. Journal of the American
Statistical Association, 81(393), 82-86.
- Tierney, L., Kass, R. E., & Kadane, J. B. (1989). Fully
exponential Laplace approximations to expectations and variances of
nonpositive functions. Journal of the American Statistical Association,
84(407), 710-716.
License
GPL-3
Authors
- Shikhar Tyagi [aut, cre]
- Arvind Pandey [aut]
- Bhupendra Singh [aut]
- Vrijesh Tripathi [aut]
- UniCensor: Generalized generation of censored and
truncated random samples
- UniCensorEM: Generalized maximum likelihood
estimation using the EM algorithm
- UniIS: Generalized Bayesian and likelihood
inference using importance sampling
These packages complement each other while sharing a consistent
interface and design philosophy.