This repo contains all of the code necessary to replicate the results and figures from the manuscript "A probabilistic diagnostic for Laplace approximations: Introduction and experimentation".
Users must first follow the instructions to set up the code from this repo in order for the MATLAB functionality to work.
Other than that, the code is fully self-contained: all data and functions used in the manuscript can be recovered simply by running it, and we have set the seeds such that the results should be identical. The code files here are as follows.
banana.m
: this code generates the results from Section 6.2 of the manuscript.curse_dim_demo.m
: this generates Figure 8.diag_calib.m
: a MATLAB function to heuristically calibrate the diagnostic. Users can supply a preliminary grid and candidate values for the free hyperparameters, and see how they affect the results on the chosen calibration function.fisheries_demo_figs.m
: generate the figures from Section 7.2. Users must runlaplace_diag_demo.R
first to generate the necessary data.fisheries_demo_timing.m
: compare the timing of the various methods applied to the fisheries data in Section 7. Users must runGH_stuff_timing.m
andlaplace_diag_demo.R
first.GH_stuff_timing.m
: timing of the computation of the Gauss-Hermite grids used on the fisheries data. This computation is done separately, so we time it separately.importace_sampling.R
: anciliary code used to check the validitity of the importance sampling done in Section 7.L2_minimization_2d.m
: this code allows users to find approximate L2-optimal hyperparameters in 2 dimensions, as described in Section 5.1.lap_diag.m
: the main function that actually contains the code to output the diagnostic values for a given integrand.laplace_diag_demo.R
: R code to run the experiments of Section 7 on the fisheries data (which is included in the relevant R package and automatically loaded in the code). Users must first runGH_stuff_timing.m
.laplace_diag_functions.R
: helper functions for the above.laplace_ingredients.m
: uses symbolic math to help calculate the Laplace approximation of a function.skew_bimodal.m
: this code generates the results from Section 6.1.visual_calibration_app.mlapp
: this app creates adjustable figures for use in low-dimensional diagnostic calibration, as explored in Section 5.1.