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,
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!
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;
To install the package, please:
Install required software
Ensure you have both Julia and R installed on your system.
Install the Julia version of NeuralEstimators
julia -e 'using Pkg; Pkg.add("NeuralEstimators")'
julia -e 'using Pkg; Pkg.add(url="https://github.com/msainsburydale/NeuralEstimators.jl")'
Install the R interface to NeuralEstimators
install.packages("NeuralEstimators")
devtools installed, then run:devtools::install_github("msainsburydale/NeuralEstimators")
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")
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.