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.
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.
install.packages("bruno")
The logistic extension additionally requires rstanarm, which can be installed with install.packages("rstanarm").
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.
The original analytical workflow remains available with the same interface.
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.
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.
The three vignettes accompany researchers from event definition to the specification and interpretation of predictive analyses.
vignette("bruno", package = "bruno")
vignette("bruno-standard", package = "bruno")
vignette("bruno-advanced", package = "bruno")
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
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.