Learn R Programming

⚠️There's a newer version (0.2.0) of this package.Take me there.

NeuralEstimators

This repository contains the R interface to the Julia package NeuralEstimators. The package facilitates the user-friendly development of neural point estimators, which are neural networks that map data to a point summary of the posterior distribution. These estimators are likelihood-free and amortised, in the sense that, after an initial setup cost, inference from observed data can be made in a fraction of the time required by conventional approaches. It also facilitates the construction of neural networks that approximate the likelihood-to-evidence ratio in an amortised fashion, which allows for making inference based on the likelihood function or the entire posterior distribution. The package caters for any model for which simulation is feasible by allowing the user to implicitly define their model via simulated data. See the Julia documentation or the vignette to get started!

Installation

To install the package, please:

  1. Install required software
    Ensure you have both Julia and R installed on your system.

  2. Install the Julia version of NeuralEstimators

    • To install the stable version of the package, run the following command in your terminal:
      julia -e 'using Pkg; Pkg.add("NeuralEstimators")'
    • To install the development version, run:
      julia -e 'using Pkg; Pkg.add(url="https://github.com/msainsburydale/NeuralEstimators.jl")'
  3. Install the R interface to NeuralEstimators

    • To install from CRAN, run the following command in R:

      install.packages("NeuralEstimators")
    • To install the development version, first ensure you have devtools installed, then run:

      devtools::install_github("msainsburydale/NeuralEstimators")

Supporting and citing

This software was developed as part of academic research. If you would like to support it, please star the repository. If you use the software in your research or other activities, please use the citation information accessible with the command:

citation("NeuralEstimators")

Contributing

If you find a bug or have a suggestion, please open an issue. For instructions for developing vignettes, see vignettes/README.md.

Papers using NeuralEstimators

  • Likelihood-free parameter estimation with neural Bayes estimators [paper] [code]

  • Neural Bayes estimators for censored inference with peaks-over-threshold models [paper]

  • Neural Bayes estimators for irregular spatial data using graph neural networks [paper][code]

  • Neural Methods for Amortized Inference [paper][code]

  • Neural parameter estimation with incomplete data [paper][code]

Copy Link

Version

Install

install.packages('NeuralEstimators')

Monthly Downloads

186

Version

0.1.3

License

GPL (>= 2)

Maintainer

Matthew Sainsbury-Dale

Last Published

January 14th, 2025

Functions in NeuralEstimators (0.1.3)

plotdistribution

Plot the empirical sampling distribution of an estimator.
risk

computes a Monte Carlo approximation of an estimator's Bayes risk
train

Train a neural estimator
loadweights

load a collection of saved weights of a neural estimator
bootstrap

bootstrap
NeuralEstimators-package

NeuralEstimators: Likelihood-Free Parameter Estimation using Neural Networks
encodedata

encodedata
initialise_estimator

Initialise a neural estimator
bias

computes a Monte Carlo approximation of an estimator's bias
assess

assess a neural estimator
estimate

estimate
loadstate

load a saved state of a neural estimator
mapestimate

Maximum a posteriori estimation
spatialgraph

spatialgraph
spatialgraphlist

spatialgraphlist
mlestimate

Maximum likelihood estimation
savestate

save the state of a neural estimator
rmse

computes a Monte Carlo approximation of an estimator's root-mean-square error (RMSE)
sampleposterior

sampleposterior
tanhloss

tanhloss
plotestimates

Plot estimates vs. true values.