GithubHelp home page GithubHelp logo

lpk-py / bayes-hier Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mattdunlop/bayes-hier

0.0 1.0 0.0 25 KB

MATLAB MCMC for Bayesian hierarchical inversion

License: GNU General Public License v3.0

MATLAB 100.00%

bayes-hier's Introduction

bayes-hier

MATLAB code to run dimension robust MCMC for hierarchical Bayesian inversion, as outlined in the paper Hierarchical Bayesian Level Set Inversion by Dunlop, Iglesias and Stuart. Three example forward models are provided: direct point observations, a groundwater flow model and an electrical impedance tomography model.

The following files are provided:

run_mcmc.m Perform the MCMC, given the parameters (grid resolution, number of samples, prior smoothness, etc) defined at the start of the file. Optionally the output may be displayed as a figure. Saved in memory are the traces of the length scale parameter and a few Fourier modes.

gaussrnd.m Generate a 2D sample from the Gaussian prior outlined in the paper, given a smoothness parameter alpha, inverse length scale parameter tau, and grid size N. The sample is provided in Fourier space, reshaped into an N^2*1 vector.

make_lvl.m Take a square matrix representing a continuous function, and threshold at two levels, returning a matrix representing a piecewise constant function. The values that the thresholded function takes are defined in this file.

ell.m Select the appropriate forward model, mapping the thresholded function to the output measurements. The three models are contained in model_id.m, model_gwf.m and model_eit.m.

model_id.m Perform direct observations of the piecewise constant field. Observations are performed on a square grid of J points. J is defined in the file, and should be a perfect square.

model_gwf.m Solve using the steady state Darcy flow model, as outlined in the paper. Observations are performed on a square grid of J points. J is defined in the file, and should be a perfect square.

model_eit.m EIT forward model, using the complete electrode model. In the example provided, a a circular domain is used with 16 electrodes equally spaced around its boundary, and the maximum 15 linear independent current stimulation patterns are applied.

NOTE: Requires EIDORS software (http://eidors3d.sourceforge.net/). The path to the 
software must be defined at the start of the file.

display_figures.m Provide some visual output for the MCMC: the true field that generates the data, the current MCMC sample, and the trace of the length scale parameter. Note that, for the EIT example, output of the full sample on a square domain is shown, even though the simulation domain is circular. The code may be modified to use EIDORS built in image output tools (as was done in the paper).

bayes-hier's People

Contributors

mattdunlop avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.