Coder Social home page Coder Social logo

frbny-dsge / smc.jl Goto Github PK

View Code? Open in Web Editor NEW
68.0 13.0 20.0 116.97 MB

Sequential Monte Carlo algorithm for approximation of posterior distributions.

Home Page: https://frbny-dsge.github.io/SMC.jl/latest

License: BSD 3-Clause "New" or "Revised" License

Julia 100.00%
bayesian-inference sequential-monte-carlo adaptive-algorithm econometrics online-algorithms mcmc economics time-series

smc.jl's Introduction

SMC.jl

Build Status codecov

Sequential Monte Carlo

This package implements the Sequential Monte Carlo (SMC) sampling algorithm, an alternative to Metropolis Hastings Markov Chain Monte Carlo sampling for approximating posterior distributions. The SMC algorithm implemented here is based upon and extends Edward Herbst and Frank Schorfheide's paper "Sequential Monte Carlo Sampling for DSGE Models" and the code accompanying their book, Bayesian Estimation of DSGE Models. More information and the original MATLAB scripts from which this code was derived can be found at Frank Schorfheide's website.

Our implementation features an adaptive schedule and what we term generalized tempering for "online" estimation, as outlined in our recent paper, "Online Estimation of DSGE Models." For a broad overview of the algorithm, one may refer to the following Liberty Street Economics article.

Comments and suggestions are welcome, and best submitted as either an issue or a pull request. โ˜๏ธ

Installation and Versioning

SMC.jl is a registered Julia package in the General registry, compatible with Julia v1.x. To install it, open your Julia REPL, type ] to enter the package manager, and run

pkg> add SMC

Usage

The package requires our auxiliary package, ModelConstructors.jl, which contains useful data structures for creating custom models (e.g. Parameter, State, Observable, Setting types).

For examples of how to set up a model in the form SMC can estimate, see scripts in the examples/ folder.

Precompilation

The SMC.jl package is not precompiled by default because when running code in parallel, we want to re-compile the copy of SMC.jl on each processor to guarantee the right version of the code is being used. If users do not anticipate using parallelism, then users ought to change the first line of src/SMC.jl from

isdefined(Base, :__precompile__) && __precompile__(false)

to

isdefined(Base, :__precompile__) && __precompile__(true)

Disclaimer

Copyright Federal Reserve Bank of New York. You may reproduce, use, modify, make derivative works of, and distribute and this code in whole or in part so long as you keep this notice in the documentation associated with any distributed works. Neither the name of the Federal Reserve Bank of New York (FRBNY) nor the names of any of the authors may be used to endorse or promote works derived from this code without prior written permission. Portions of the code attributed to third parties are subject to applicable third party licenses and rights. By your use of this code you accept this license and any applicable third party license.

THIS CODE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT ANY WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, EXCEPT TO THE EXTENT THAT THESE DISCLAIMERS ARE HELD TO BE LEGALLY INVALID. FRBNY IS NOT, UNDER ANY CIRCUMSTANCES, LIABLE TO YOU FOR DAMAGES OF ANY KIND ARISING OUT OF OR IN CONNECTION WITH USE OF OR INABILITY TO USE THE CODE, INCLUDING, BUT NOT LIMITED TO DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, PUNITIVE, SPECIAL OR EXEMPLARY DAMAGES, WHETHER BASED ON BREACH OF CONTRACT, BREACH OF WARRANTY, TORT OR OTHER LEGAL OR EQUITABLE THEORY, EVEN IF FRBNY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES OR LOSS AND REGARDLESS OF WHETHER SUCH DAMAGES OR LOSS IS FORESEEABLE.

smc.jl's People

Contributors

aidan-cg avatar alissarjohnson avatar caimichael avatar chenwilliam77 avatar ethanmatlin avatar frbny-dsge-team avatar github-actions[bot] avatar juliatagbot avatar rsarfati avatar shlokg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

smc.jl's Issues

Info about upcoming removal of packages in the General registry

As described in https://discourse.julialang.org/t/ann-plans-for-removing-packages-that-do-not-yet-support-1-0-from-the-general-registry/ we are planning on removing packages that do not support 1.0 from the General registry. This package has been detected to not support 1.0 and is thus slated to be removed. The removal of packages from the registry will happen approximately a month after this issue is open.

To transition to the new Pkg system using Project.toml, see https://github.com/JuliaRegistries/Registrator.jl#transitioning-from-require-to-projecttoml.
To then tag a new version of the package, see https://github.com/JuliaRegistries/Registrator.jl#via-the-github-app.

If you believe this package has erroneously been detected as not supporting 1.0 or have any other questions, don't hesitate to discuss it here or in the thread linked at the top of this post.

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

error precompiling SMC

I get the following error when I'm trying to precompile the package. I get the same message in 0.7, 1.1, 1.2. Running instantiate doesn't help.

LoadError: ArgumentError: Package SMC [c6043b28-c053-11e9-348c-19d3cb73bbb3] is required but does not seem to be installed:

  • Run Pkg.instantiate() to install all recorded dependencies.

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.