Learn R Programming

[Looking for the R package "inferno"? you came to the right place! It's been renamed "Prova"]

"prova" /'prɔva/ (Italian)

  • (noun): test, trial, assessment, proof, evidence, sign, indication, try, attempt.
  • (verb): test!, try out!, assess!, attempt!, prove!, demonstrate!, show!

Prova: probabilistic-statistical variate analysis, nonparametric and with automated Markov-chain Monte Carlo

This repository provides an R package and some theoretical background to perform probabilistic and statistical data analysis and inference. These are its main features:

  • Any combination of binary, nominal, ordinal, continuous variates. Continuous variates can be bounded or unbounded, and also rounded or discretized.
  • No modelling assumptions such as gaussianity, linearity, or any other kind of model. The analysis and inferences are fully non-parametric.
  • No assumptions about functional dependence between variates. The analysis and inferences are therefore more general than those by neural networks, random forests, or similar machine-learning algorithms.
  • Automatic imputation of missing data: all sample data are used, even those that lacks some variate values. The imputation is done with a principled method (the marginalization rule of probability theory), rather than ad-hoc procedures.
  • Easy and straightforward subgroup analyses and stratified analyses, for any division of variates, with full statistical details.
  • Quantification of generalizability beyond the finite sample size. In other words, quantification of uncertainty of results regarding the whole, unsampled, population.
  • Straightforward use within decision theory, such as clinical decision-making. Users can immediately combine the probabilistic results with any measures of utilities, such as quality-adjusted life years.
  • Quantification of associations between any kinds of variates, without modelling assumptions (gaussianity, linearity, etc.), thanks to the use of mutual information.
  • Base-rate correction for inferences about out-of-population data, by means of Bayes's theorem.
  • Automated Markov-chain Monte Carlo computation. Users unfamiliar with Monte Carlo methods don't have to worry, because the computations are handled automatically.

The package at bottom does Bayesian nonparametric inference (also called "density inference" or "inference under exchangeability"), which makes all features above possible.

The introductory vignette explains, with a guided example, most of the features above, as well as the main ideas and functions. It can be particularly useful for researchers who are more familiar with traditional "frequentist" statistics but would like to try the Bayesian approach. See the post by Barbara W. Sarnecka, frequentist statistician turned Bayesian, for a brilliant overview of the Bayesian advantages. The vignette about mutual information explains the use of this powerful measure of association.

The package is under continuous development, but the core functionalities work and have been tested in concrete research questions; see example applications below.

The package internally does the computations necessary for Bayesian inference by means of Monte Carlo methods thanks to the R package Nimble. As already mentioned, this computation is automated. Users familiar with Monte Carlo methods can still access computational details and can even change some of the computation hyperparameters.

Installation

You need to have installed the package Nimble, at least version 1.4.2. Please follow its installation instructions for your operating system.

Newer versions of Prova can be installed with

remotes::install_github('pglpm/prova')

Documentation

The vignette An introduction to probabilistic-statistical variate analysis is a step-by-step introduction to Prova and also to Bayesian nonparametrics. It guides you through a concrete example with various kinds of inferences. You may also try to follow it using a dataset of your own.

Other tutorials are available at pglpm.github.io/prova, or can be accessed in an R session with browseVignettes('prova').

A summary of the theoretical foundations, including further references, is available in this draft. The main idea for the internal mathematical representation comes from Dunson & Bhattacharya and Ishwaran & Zarepour.

For a low-level course on Bayesian nonparametric inference and Decision Theory see Data Science and AI Prototyping.

Example applications

binary classification models*](https://doi.org/10.1088/2632-2153/ae45ed)

Projects using Prova:

  • InfernoCalibNet: uncertainty-aware predictions for medical AI using CNN and Bayesian nonparametrics framework
  • parkinsonbayes: Examples of Bayesian nonparametric inference for studies of Parkinson's Disease
  • Inferno-App: PySide6 application that integrates Python and R functionality using the Inferno (old version of Prova) R package.

Contact

Please report bugs and request features or specific documentation on GitHub Issues. If you have other questions about application, theory, technical implementation, feel free to contact Luca pglXYZ@portamanaXYZ.org (remove 'XYZ' for anti-spam purposes).

Disclaimer

No large language models were used in the production of this software and of its documents.

Copy Link

Version

Install

install.packages('prova')

Version

1.0.0

License

AGPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

PierGianLuca Porta Mana

Last Published

July 16th, 2026

Functions in prova (1.0.0)

metadatatemplate

Metadata and helper function for metadata
mutualinfo

Calculate mutual information between groups of joint variates
metadataExample

Example metadata file
learn

Monte Carlo computation of posterior probability distribution
learnbind

Bind 3D arrays by first dimension
learntExample

Example learnt object produced by learn()
mcsubset

Eliminate samples from mcsamples object
mcjoin

Concatenate mcsample objects
plot.probability

Plot an object of class "probability"
plotFsamples

Plot one-dimensional posterior probabilities
rPr

Generate datapoints
util_Pcheckpoints

Calculate joint frequencies for MCMC-monitoring checkpoints
rowinvcumsum

Inverse cumulative sum along first dimension
rowcumsum

Cumulative sum along first dimension
qPr

Calculate quantiles
prsubset

Subset variates of an object of class "probability"
util_lprobsargsyx

Prepare arguments for util_lprobsyx from data
util_cleanup

Cleanup a learn()-output directory
util_qYXcont

Calculate quantiles for continuous Y by bisection
util_qYXdiscr

Calculate quantiles for discrete Y by bisection
util_lprobsbase

Calculate collection of log-probabilities for different components and samples
util_combineYX

Calculate probabilities, quantiles, etc, for all Y and X combinations
util_lprobsmi

Calculate pairs of log-probabilities for mutualinfo()
workerfun

Worker function called by learn()
prova.data

Write and read CSV files in Prova
prova-package

prova: Nonparametric Probabilistic-Statistical Variate Analysis with Automated Markov-Chain Monte Carlo
util_prepPcheckpoints

Format datapoints used for MCMC monitoring
vrtgrid

Create a grid of values for a variate
vtransform

Transforms variates to different representations
print.probability

Print an object of class "probability"
plotquantiles

Plot pairs of quantiles
util_denorm

Utility function to avoid finite-precision accuracys
util_joinPtraces

Join '____tempPtraces-' files
Pr

Calculate posterior probabilities
flexiplot

Plot numeric or character values
funMCEQ

Calculate credibility quantiles on estimated quantile
hist.probability

Plot the variability of an object of class "probability" as a histogram
fftNGS

Find optimal FFT size
funESS3

Compute ESS
funMCSELD

Calculate MC standard error using LaplacesDemon's batch means
funAC

Compute autocovariance
buildauxmetadata

Build augmented metadata file
createQfunction

Calculate and save transformation function for ordinal variates