| Title: | Importance Sampling Inference for Censored Univariate Data |
|---|---|
| Description: | Distribution-independent framework for importance-sampling inference with univariate observations subject to censoring or truncation. Users provide probability functions and a proposal over model parameters. Constructs observed-data likelihood contributions, computes numerically stable importance weights, and supplies posterior, likelihood, predictive, diagnostic, and model-comparison summaries. Covers complete, right, left, interval, Type-I, Type-II, progressive Type-II, first-failure, progressive first-failure, doubly Type-II, middle-censored, and left/right-truncated data. Methods for importance sampling and censoring schemes are described in Geweke (1989) <doi:10.2307/2290062>, Hesterberg (1995) <doi:10.1080/00031305.1995.10476138>, Robert and Casella (2004, ISBN:978-0-387-21617-1), Kundu and Joarder (2006) <doi:10.1016/j.csda.2005.05.002>, Banerjee and Kundu (2008) <doi:10.1109/TR.2008.916890>, Iyer, Jammalamadaka, and Kundu (2008) <doi:10.1016/j.jspi.2007.03.062>, Wu and Kus (2009) <doi:10.1016/j.csda.2009.03.010>, Prajapati, Mitra, and Kundu (2019) <doi:10.1007/s13571-018-0167-0>, Mondal and Kundu (2020) <doi:10.1080/03610926.2018.1554128>, Balakrishnan and Aggarwala (2000, ISBN:980-1-4612-1334-5), Ding and Gui (2023) <doi:10.3390/math11092003>, Nagar, Kumar, and Krishna (2026) <doi:10.59467/IJASS.2026.22.1>, Goel and Krishna (2026) <doi:10.1007/s13198-026-03208-w>, Yadav, Jaiswal, and Yadav (2026) <doi:10.1007/s11135-026-02647-8>, and Goel, Kumar, and Krishna (2026, "Estimation in power Lindley distributions using balanced joint progressively Type-II censored data"). |
| Authors: | Shikhar Tyagi [aut, cre] (ORCID: <https://orcid.org/0000-0003-1606-0844>), Arvind Pandey [aut], Bhupendra Singh [aut], Vrijesh Tripathi [aut] |
| Maintainer: | Shikhar Tyagi <[email protected]> |
| License: | GPL-3 |
| Version: | 0.1.0 |
| Built: | 2026-10-06 10:24:23 UTC |
| Source: | https://github.com/cran/UniIS |
Control settings for importance sampling
is_control( n_draws = 10000L, method = c("self_normalized", "ordinary", "adaptive"), adapt_fraction = 0.25, min_ess = 50, truncate_weights = Inf, seed = NULL, optimize = TRUE, optim_control = list() )is_control( n_draws = 10000L, method = c("self_normalized", "ordinary", "adaptive"), adapt_fraction = 0.25, min_ess = 50, truncate_weights = Inf, seed = NULL, optimize = TRUE, optim_control = list() )
n_draws |
number of parameter draws. |
method |
one of |
adapt_fraction |
pilot fraction for adaptive deterministic-mixture IS. |
min_ess |
minimum ESS required before a warning is issued. |
truncate_weights |
optional positive cap on normalized weights, as a
multiple of |
seed |
optional integer seed. |
optimize |
whether to refine the maximum-likelihood draw using |
optim_control |
control list passed to |
A list of class is_control.
Importance-sampling diagnostics
is_diagnostics(object)is_diagnostics(object)
object |
an |
A list containing ESS, weight dispersion, entropy, and Monte Carlo standard errors for parameter means.
Define a distribution specification
is_dist( pdf, cdf = NULL, survival = NULL, support = c(-Inf, Inf), name = "custom" )is_dist( pdf, cdf = NULL, survival = NULL, support = c(-Inf, Inf), name = "custom" )
pdf |
function of |
cdf |
optional function of |
survival |
optional survival function of |
support |
numeric length-two support bounds for the observations. |
name |
descriptive label. |
An object of class is_dist.
is_fit() samples parameter values from a proposal distribution, evaluates
the observed-data likelihood for each draw, and computes stable normalized
importance weights. With prior (or log_prior) it returns a Bayesian
posterior approximation; without one, it approximates the normalized
likelihood under a flat reference measure. The reported par is an observed
likelihood maximum refined from the best importance draw when requested.
is_fit( data, pdf, cdf = NULL, survival = NULL, theta0, proposal = NULL, proposal_density = NULL, prior = NULL, log_prior = NULL, support = c(-Inf, Inf), scheme = "complete", status = NULL, time2 = NULL, censor_params = list(), control = is_control() )is_fit( data, pdf, cdf = NULL, survival = NULL, theta0, proposal = NULL, proposal_density = NULL, prior = NULL, log_prior = NULL, support = c(-Inf, Inf), scheme = "complete", status = NULL, time2 = NULL, censor_params = list(), control = is_control() )
data |
observed data, a numeric vector, data frame, or list. |
pdf |
density function |
cdf |
CDF function |
survival |
survival function |
theta0 |
initial parameter vector, used to validate dimension and make
a default normal proposal when |
proposal |
proposal object, or a function |
proposal_density |
density function for a function-valued proposal. |
prior |
prior density |
log_prior |
log prior function |
support |
observation support bounds retained in the fitted object. |
scheme |
censoring or truncation scheme. |
status |
event status indicator. |
time2 |
upper interval endpoints. |
censor_params |
scheme-specific parameters. |
control |
settings from |
An object of class isfit.
Geweke, J. (1989). Bayesian inference in econometric models using Monte Carlo integration. Econometrica, 57(6), 1317-1339. doi:10.2307/2290062
Hesterberg, T. (1995). Weighted average importance sampling and defensive mixture distributions. Technometrics, 37(2), 185-194. doi:10.1080/00031305.1995.10476138
Robert, C. P., & Casella, G. (2004). Monte Carlo Statistical Methods (2nd ed.). Springer. ISBN: 978-0-387-21617-1.
x <- rexp(40, 1.5) proposal <- is_proposal_normal(log(1.5), 0.5) fit <- is_fit(x, pdf = function(x, theta) dexp(x, rate = exp(theta[1])), cdf = function(x, theta) pexp(x, rate = exp(theta[1])), survival = function(x, theta) pexp(x, rate = exp(theta[1]), lower.tail = FALSE), theta0 = log(1), proposal = proposal, scheme = "complete", control = is_control(n_draws = 500) ) exp(coef(fit))x <- rexp(40, 1.5) proposal <- is_proposal_normal(log(1.5), 0.5) fit <- is_fit(x, pdf = function(x, theta) dexp(x, rate = exp(theta[1])), cdf = function(x, theta) pexp(x, rate = exp(theta[1])), survival = function(x, theta) pexp(x, rate = exp(theta[1]), lower.tail = FALSE), theta0 = log(1), proposal = proposal, scheme = "complete", control = is_control(n_draws = 500) ) exp(coef(fit))
Computes a log likelihood for an arbitrary univariate distribution. The
density, CDF, and survival functions all use the convention fun(x, theta).
is_loglik( data, theta, pdf, cdf = NULL, survival = NULL, scheme = "complete", status = NULL, time2 = NULL, censor_params = list() )is_loglik( data, theta, pdf, cdf = NULL, survival = NULL, scheme = "complete", status = NULL, time2 = NULL, censor_params = list() )
data |
observed data. |
theta |
numeric parameter vector. |
pdf |
density function. |
cdf |
CDF function; required for finite or left-censored intervals. |
survival |
survival function; an alternative to |
scheme |
censoring/truncation scheme. |
status |
event status. |
time2 |
interval upper endpoints. |
censor_params |
additional scheme parameters. |
A scalar log likelihood.
Balakrishnan, N., & Aggarwala, R. (2000). Progressive Censoring: Theory, Methods, and Applications. Birkhauser. ISBN: 978-1-4612-1334-5.
Banerjee, A., & Kundu, D. (2008). Inference based on Type-II hybrid censored data from Weibull distribution. IEEE Transactions on Reliability, 57(2), 369-378. doi:10.1109/TR.2008.916890
Ding, C., & Gui, W. (2023). Statistical inference of power Lindley distribution under progressive first-failure censoring. Mathematics, 11(9), 2003. doi:10.3390/math11092003
Goel, C., & Krishna, H. (2026). Reliability estimation in inverse Weibull distribution under progressive Type-II censoring. Journal of Reliability and Statistical Studies. doi:10.1007/s13198-026-03208-w
Goel, C., Kumar, M., & Krishna, H. (2026). Estimation in power Lindley distributions using balanced joint progressively Type-II censored data. Preprint.
Iyer, S. K., Jammalamadaka, S. R., & Kundu, D. (2008). Analysis of middle-censored data with exponential lifetime distribution. Journal of Statistical Planning and Inference, 138(11), 3550-3560. doi:10.1016/j.jspi.2007.03.062
Kundu, D., & Joarder, A. (2006). Analysis of Type-II progressively hybrid censored data. Computational Statistics & Data Analysis, 50(10), 2509-2528. doi:10.1016/j.csda.2005.05.002
Mondal, S., & Kundu, D. (2020). Point and interval estimation of parameters of Weibull distribution under middle censoring scheme. Communications in Statistics - Theory and Methods, 49(8), 1984-2003. doi:10.1080/03610926.2018.1554128
Nagar, S., Kumar, M., & Krishna, H. (2026). Bayesian estimation under censoring. International Journal of Agricultural and Statistical Sciences, 22(1). doi:10.59467/IJASS.2026.22.1
Prajapati, A., Mitra, S., & Kundu, D. (2019). On progressive first-failure censoring scheme. Journal of Statistical Theory and Practice, 13(1), 16. doi:10.1007/s13571-018-0167-0
Wu, S. J., & Kus, C. (2009). On estimation methods for the Weibull distribution under progressive first-failure censored data. Computational Statistics & Data Analysis, 53(10), 3617-3626. doi:10.1016/j.csda.2009.03.010
Yadav, A. S., Jaiswal, S., & Yadav, S. K. (2026). Statistical properties and inference for censoring schemes. Quality & Quantity. doi:10.1007/s11135-026-02647-8
Model comparison for multiple IS fits
is_model_comparison(...)is_model_comparison(...)
... |
one or more |
A data frame comparing logLik, AIC, AICc, BIC, CAIC, and HQIC.
Compute an expectation from an IS fit
is_posterior_expectation(object, fun)is_posterior_expectation(object, fun)
object |
an |
fun |
function mapping one parameter vector to a numeric scalar or fixed-length numeric vector. |
Weighted posterior or normalized-likelihood expectation.
Posterior predictive functionals
is_predictive(object, x, type = c("density", "cdf", "survival"))is_predictive(object, x, type = c("density", "cdf", "survival"))
object |
an |
x |
values at which to evaluate the predictive quantity. |
type |
|
A weighted predictive estimate at x.
Constructs a deterministic mixture of two proposals. The defensive component protects against under-dispersed initial proposals and is evaluated exactly in the resulting mixture density.
is_proposal_defensive(primary, defensive, epsilon = 0.1)is_proposal_defensive(primary, defensive, epsilon = 0.1)
primary |
proposal object. |
defensive |
proposal object of the same dimension. |
epsilon |
mixture weight assigned to the defensive proposal. |
A proposal object accepted by is_fit().
This base-R proposal is convenient for unconstrained parameters. For
constrained parameters, provide a proposal on a suitable transformed scale
and incorporate the Jacobian in proposal_density.
is_proposal_normal(mean, covariance)is_proposal_normal(mean, covariance)
mean |
proposal mean. |
covariance |
positive-definite covariance matrix, or positive variances. |
A proposal object accepted by is_fit().
Student t proposal for model parameters
is_proposal_t(mean, scale, df = 4)is_proposal_t(mean, scale, df = 4)
mean |
proposal location. |
scale |
positive-definite scale matrix or variances. |
df |
degrees of freedom. |
A proposal object accepted by is_fit().
Uniform proposal for model parameters
is_proposal_uniform(lower, upper)is_proposal_uniform(lower, upper)
lower |
lower bounds for parameters. |
upper |
upper bounds for parameters. |
A proposal object accepted by is_fit().
Simulate complete univariate data
simulate_complete(n, rfun, theta)simulate_complete(n, rfun, theta)
n |
sample size. |
rfun |
random-generation function |
theta |
parameter vector passed to |
A numeric sample.
Simulate hybrid-censored data
simulate_hybrid(n, rfun, theta, censor_time, m = NULL)simulate_hybrid(n, rfun, theta, censor_time, m = NULL)
n |
initial sample size. |
rfun |
random-generation function |
theta |
model parameters. |
censor_time |
fixed censoring time. |
m |
target failure count (1 <= m <= n). |
A data frame with x and event status.
Simulate interval-censored data
simulate_interval(n, rfun, theta, inspection_times)simulate_interval(n, rfun, theta, inspection_times)
n |
sample size. |
rfun |
random-generation function |
theta |
model parameters. |
inspection_times |
strictly increasing finite inspection times. |
A data frame with interval endpoints L and R.
Simulate left-censored data
simulate_left(n, rfun, theta, censoring)simulate_left(n, rfun, theta, censoring)
n |
sample size. |
rfun |
random-generation function |
theta |
model parameters. |
censoring |
either one censoring time or a function |
A data frame with x and event status.
Simulate progressively Type-II-censored data
simulate_progressive(rfun, theta, R)simulate_progressive(rfun, theta, R)
rfun |
random-generation function |
theta |
model parameters. |
R |
non-negative removals immediately after successive observed failures. |
A list suitable for scheme = "progressive_type2".
Simulate right-censored data
simulate_right(n, rfun, theta, censoring)simulate_right(n, rfun, theta, censoring)
n |
sample size. |
rfun |
random-generation function |
theta |
model parameters. |
censoring |
either one censoring time or a function |
A data frame with x and event status.