Predicting User-Defined Event Recurrence under Exchangeability

Provides methods for predicting the recurrence of user-defined binary events; 'bruno' abbreviates Beta-Bernoulli Recurrence for Unobserved Next Outcomes. The analytical procedure, based on a Beta-Bernoulli specification under exchangeability, assigns a probability to event occurrence in the next comparable case and provides the exact predictive distribution of recurrence counts in a future sample. Predictions may be obtained separately for user-defined predictive classes. Two extensions allow researchers to examine the predictive implications of treating the event probability as fixed and to predict recurrence conditional on future covariate profiles through Bayesian logistic regression.


bruno

Beta–Bernoulli Recurrence for Unobserved Next Outcomes

bruno assigns predictive probabilities to the recurrence of a prespecified binary event in a subsequent comparable case or sample. The event may be defined from a measurement criterion, a logical indicator or paired measurements.

Installation

install.packages("bruno")

The logistic extension additionally requires rstanarm, which can be installed with install.packages("rstanarm").

Original analytical prediction

library(bruno)
fit <- bruno(event = c(1, 0, 1, 1, 0), mu0 = 0.5,
             tau = 2, future_n = 10)
summary(fit)
predict(fit)

The conditional beta interval describes uncertainty in the event probability; the beta-binomial interval describes the future event count. Exchangeability is a substantive predictive judgement, not a hypothesis tested by the package.

New in version 1.0.0

The original analytical workflow remains available with the same interface.

Comparing predictive distributions

fit <- bruno(event = c(1, 0, 1, 1, 0), mu0 = 0.5,
             tau = 2, future_n = 10)
cmp <- bruno_compare(fit)
summary(cmp)
plot(cmp)

The default binomial uses the observed event proportion. Set plug_in = "conditional" to compare distributions with the same predictive mean. An independently observed subsequent count may be supplied as observed_count.

Predicting recurrence conditional on covariates

dat <- data.frame(event = rep(c(0, 1, 1, 0), 10),
                  x = rep(0:3, 10))
fit <- bruno_logistic(event ~ x, data = dat, seed = 12)
summary(fit)
pred <- predict(fit, newdata = data.frame(x = c(1, 2, 2)))
pred$individual
summary(pred)
plot(pred)

For each posterior coefficient draw, the count has a Poisson-binomial distribution conditional on the supplied future profiles. The posterior predictive count distribution is the Monte Carlo average of these conditional distributions. Inspect the sampling diagnostics and justify the predictive relevance of the observed cases and future covariate profiles. Priors are defined on the supplied predictor scale; the intercept prior is on the internally centred intercept. The logistic prediction supports up to 1,000 future cases; the analytical count distribution supports up to 1,000,000 cases.

Vignettes

The three vignettes accompany researchers from event definition to the specification and interpretation of predictive analyses.

  • Getting Started with bruno: event definition, initial probability assessment and basic recurrence prediction.
  • bruno: Standard Applications: exchangeability, analytical prediction and planning subsequent data collection.
  • bruno: Advanced Applications: comparison of predictive distributions and recurrence prediction conditional on covariates.
vignette("bruno", package = "bruno")
vignette("bruno-standard", package = "bruno")
vignette("bruno-advanced", package = "bruno")

Reference

Gianeselli, I. (2026). How likely are your future participants to meet the same measurement criterion? The R package bruno. Applied Psychological Measurement. https://doi.org/10.1177/01466216261490071

Acknowledgements

The author gratefully acknowledges Giulio Costantini (Associate Professor, Department of Psychology, University of Milano-Bicocca) for the stimulating scientific discussions that inspired the development of the extended predictive framework of bruno, and Andrea Bosco (Full Professor of Psychometrics, Department of Education, Psychology and Communication Sciences, University of Bari Aldo Moro) for his methodological and pedagogical insights, which informed the conception and development of the package vignettes.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("bruno")

1.0.0 by Irene Gianeselli, 8 hours ago


Browse source code at https://github.com/cran/bruno


Authors: Irene Gianeselli [aut, cre] (ORCID:


Documentation:   PDF Manual  


GPL-3 license


Imports stats, graphics

Suggests testthat, rstanarm, knitr, rmarkdown, rstan


See at CRAN