Likelihood-Free Parameter Estimation using Neural Networks

An 'R' interface to the 'Julia' package 'NeuralEstimators.jl'. The package facilitates the user-friendly development of neural Bayes estimators, which are neural networks that map data to a point summary of the posterior distribution (Sainsbury-Dale et al., 2024, ). These estimators are likelihood-free and amortised, in the sense that, once the neural networks are trained on simulated data, inference from observed data can be made in a fraction of the time required by conventional approaches. The package also supports amortised Bayesian or frequentist inference using neural networks that approximate the posterior or likelihood-to-evidence ratio (Zammit-Mangion et al., 2025, Sec. 3.2, 5.2, ). The package accommodates any model for which simulation is feasible by allowing users to define models implicitly through simulated data.


NeuralEstimators

R-CMD-check codecov

This repository contains the R interface to the Julia package NeuralEstimators. The package facilitates a suite of neural methods for parameter inference in scenarios where simulation from the model is feasible. These methods are likelihood-free and amortised, in the sense that, once the neural networks are trained on simulated data, they enable rapid inference across arbitrarily many observed data sets in a fraction of the time required by conventional approaches. 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!

Overview

graph LR

    %% --- Training phase ---
    subgraph Training["Offline training (one-time cost)"]
        A["Sample parameters\nθ ~ p(θ)"] --> B["Simulate data\nZ ~ p(Z | θ)"]
        B --> C["Train neural network"]
    end

    C --> NN(["Trained neural network"])

    %% --- Inference phase ---
    subgraph Inference["Online inference (fast)"]
        D["Observed data Zₒ"] --> NN
        NN --> E["Approximate posterior\np(θ | Zₒ)"]
    end

    %% --- Styling ---
    classDef process fill:#2d2d2d,stroke:#999,color:#fff;
    classDef data fill:#1f3b4d,stroke:#4aa3df,color:#fff;
    classDef model fill:#3b2d4d,stroke:#b388ff,color:#fff;

    class A,B,D,E data;
    class C process;
    class NN model;

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 current stable version, 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 encounter a bug or have a suggestion, please consider opening an issue or submitting a pull request. Instructions for developing vignettes can be found in vignettes/README.md.

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("NeuralEstimators")

0.2.2 by Matthew Sainsbury-Dale, a month ago


https://github.com/msainsburydale/NeuralEstimators, https://msainsburydale.github.io/NeuralEstimators.jl/dev/


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


Authors: Matthew Sainsbury-Dale [aut, cre]


Documentation:   PDF Manual  


GPL (>= 2) license


Imports JuliaConnectoR, magrittr

Suggests dplyr, ggplot2, ggplotify, ggpubr, gridExtra, knitr, rmarkdown, markdown, R.rsp, testthat

System requirements: Julia (>= 1.11)


Imported by eam.


See at CRAN