{"about":{"non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","site":"https://codewithpapers.app","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page","syntology":{"site":"https://syntology.ai","developers":"https://syntology.ai/developers","mcp":{"server":"https://syntology.ai/mcp","transport":"streamable-http","server_card":"https://syntology.ai/.well-known/mcp/server-card.json","auth":{"type":"trial token, no account","trial_token":"https://syntology.ai/api/oauth/trial/token","method":"POST","docs":"https://syntology.ai/developers"}},"have":"https://syntology.ai/api/graph/have?x=<method, arXiv id or title> (free, answers coverage only)","paper_base":"https://syntology.ai/paper/","atlas_base":"https://app.syntology.ai/?focus="},"machine_readable":[{"url":"https://codewithpapers.app/llms.txt","what":"the machine catalog: every machine-readable file, counted"},{"url":"https://codewithpapers.app/index/manifest.json","what":"paper-to-code index by arXiv id, with Syntology's counts"},{"url":"https://codewithpapers.app/search/manifest.json","what":"site search index (titles, authors) and its files"},{"url":"https://codewithpapers.app/download","what":"bulk files: Syntology's layer, described there"},{"url":"https://codewithpapers.app/build_manifest.json","what":"the build record: inputs, counts, exclusions, probes"}]},"url":"/method/metropolis-hastings","slug":"metropolis-hastings","name":"Metropolis Hastings","full_name":"Metropolis Hastings","full_name_withheld":false,"description_markdown":"**Metropolis-Hastings** is a Markov Chain Monte Carlo (MCMC) algorithm for approximate inference. It allows for sampling from a probability distribution where direct sampling is difficult - usually owing to the presence of an intractable integral.\r\n\r\nM-H consists of a proposal distribution $q\\left(\\theta^{'}\\mid\\theta\\right)$ to draw a parameter value. To decide whether $\\theta^{'}$ is accepted or rejected, we then calculate a ratio:\r\n\r\n$$ \\frac{p\\left(\\theta^{'}\\mid{D}\\right)}{p\\left(\\theta\\mid{D}\\right)} $$\r\n\r\nWe then draw a random number $r \\in \\left[0, 1\\right]$ and accept if it is under the ratio, reject otherwise. If we accept, we set $\\theta_{i} = \\theta^{'}$ and repeat.\r\n\r\nBy the end we have a sample of $\\theta$ values that we can use to form quantities over an approximate posterior, such as the expectation and uncertainty bounds. In practice, we typically have a period of tuning to achieve an acceptable acceptance ratio for the algorithm, as well as a warmup period to reduce bias towards initialization values.\r\n\r\nImage: [Samuel Hudec](https://static1.squarespace.com/static/52e69d46e4b05a145935f24d/t/5a7dbadcf9619a745c5b2513/1518189289690/Stan.pdf)","description_state":"present","introduced_year":null,"introduced_by":{"title":null,"paper":null,"first_author":null,"n_authors":0,"url_abs":null,"archive_paper_url":null},"source":{"url":null,"title":null,"url_on_a_paper_host":false},"code_snippet_url":null,"code_snippet_url_on_a_code_host":false,"categories":[{"area":"General","area_id":"general","collection":"Markov Chain Monte Carlo","url":"/methods/category/markov-chain-monte-carlo","pwc_aliases":[]}],"n_papers_tagged":10,"archive_num_papers":10,"papers_newest_first":[{"paper":null,"slug":"advnf-reducing-mode-collapse-in-conditional","title":"AdvNF: Reducing Mode Collapse in Conditional Normalising Flows using Adversarial Learning","date":"2024-01-29","arxiv_id":"2401.15948","n_code_links":0,"syntology":null},{"paper":null,"slug":"neural-classifiers-based-monte-carlo","title":"Binary classification based Monte Carlo simulation","date":"2023-07-29","arxiv_id":"2307.16035","n_code_links":0,"syntology":null},{"paper":"/paper/data-subsampling-for-bayesian-neural-networks","slug":"data-subsampling-for-bayesian-neural-networks","title":"Data Subsampling for Bayesian Neural Networks","date":"2022-10-17","arxiv_id":"2210.09141","n_code_links":1,"syntology":null},{"paper":null,"slug":"a-two-step-metropolis-hastings-method-for","title":"A Two-step Metropolis Hastings Method for Bayesian Empirical Likelihood Computation with Application to Bayesian Model Selection","date":"2022-09-02","arxiv_id":"2209.01269","n_code_links":0,"syntology":null},{"paper":null,"slug":"mix-and-match-learning-free-controllable-text","title":"Mix and Match: Learning-free Controllable Text Generationusing Energy Language Models","date":"2021-11-16","arxiv_id":null,"n_code_links":0,"syntology":null},{"paper":"/paper/subsampling-generative-adversarial-networks","slug":"subsampling-generative-adversarial-networks","title":"Subsampling Generative Adversarial Networks: Density Ratio Estimation in Feature Space with Softplus Loss","date":"2019-09-24","arxiv_id":"1909.10670","n_code_links":1,"syntology":{"ran":0,"of":1,"n_ran_checked":0,"n_instrument":0,"unverified":1,"pointer_only":0,"phrase":"0 ran · 1 unverified","official":{"repos":["UBCDingXin/DDRE_Sampling_GANs"],"state":"official: harvested, nothing ran","n_ran":0,"n_constructed":0,"n_ran_no_instrument_failure":0,"n_unverified":1,"ran_from_kinds":[]}}},{"paper":null,"slug":"hawkes-processes-with-stochastic-excitations","title":"Hawkes Processes with Stochastic Excitations","date":"2016-09-22","arxiv_id":"1609.06831","n_code_links":0,"syntology":null},{"paper":null,"slug":"c3-lightweight-incrementalized-mcmc-for","title":"C3: Lightweight Incrementalized MCMC for Probabilistic Programs using Continuations and Callsite Caching","date":"2015-09-07","arxiv_id":"1509.02151","n_code_links":0,"syntology":null},{"paper":null,"slug":"neural-adaptive-sequential-monte-carlo","title":"Neural Adaptive Sequential Monte Carlo","date":"2015-06-10","arxiv_id":"1506.03338","n_code_links":0,"syntology":null},{"paper":null,"slug":"gps-abc-gaussian-process-surrogate","title":"GPS-ABC: Gaussian Process Surrogate Approximate Bayesian Computation","date":"2014-01-13","arxiv_id":"1401.2838","n_code_links":0,"syntology":null}],"papers_shown":10,"papers_order":"date (newest first), then slug","paper_counts":{"archive_papers_tagged":10,"with_a_code_link":2,"where_syntology_ran_a_sample":0,"not_listed_spam_title":0,"listed":10,"listed_where_code_ran":0,"where_syntology_ran_a_sample_split":{"with_a_run_with_no_instrument_failure":0,"every_run_a_failure_of_syntologys_instrument":0,"listed_with_a_run_with_no_instrument_failure":0,"listed_every_run_a_failure_of_syntologys_instrument":0,"filter":{"states":["a run with no instrument failure","any run, instrument failures included"],"default":"a run with no instrument failure","note":"on the 'only where code ran' pages the default hides, in the browser, the rows where every run was a failure of Syntology's instrument; the second state shows them again. Rows are hidden, never re-ordered; these twins list every row"}},"definition":"distinct papers the archive tags; 'where Syntology ran a sample' counts papers with at least one harvested sample that ran, which is not a correctness claim"},"papers_where_code_ran":0,"papers_where_code_ran_first_page":null,"papers_where_code_ran_caption":"We ran code from the paper's repository; we did not isolate this method inside it.","pages":[],"tasks":[{"task":"/task/attribute","name":"Attribute","papers":1},{"task":"/task/bayesian-inference","name":"Bayesian Inference","papers":1},{"task":"/task/binary-classification","name":"Binary Classification","papers":1},{"task":"/task/classification-1","name":"Classification","papers":1},{"task":"/task/density-ratio-estimation","name":"Density Ratio Estimation","papers":1},{"task":"/task/federated-learning","name":"Federated Learning","papers":1},{"task":"/task/image-generation","name":"Image Generation","papers":1},{"task":"/task/language-modeling","name":"Language Modeling","papers":1},{"task":"/task/language-modelling","name":"Language Modelling","papers":1},{"task":"/task/model-selection","name":"Model Selection","papers":1},{"task":"/task/normalising-flows","name":"Normalising Flows","papers":1},{"task":"/task/probabilistic-programming","name":"Probabilistic Programming","papers":1},{"task":"/task/style-transfer","name":"Style Transfer","papers":1},{"task":"/task/text-generation","name":"Text Generation","papers":1},{"task":"/task/variational-inference","name":"Variational Inference","papers":1}],"tasks_shown":15,"n_tasks":15,"usage_by_year":[{"year":"2014","papers":1},{"year":"2015","papers":2},{"year":"2016","papers":1},{"year":"2019","papers":1},{"year":"2021","papers":1},{"year":"2022","papers":2},{"year":"2023","papers":1},{"year":"2024","papers":1}],"row_source":"methods_table","archive":{"source":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","archive_url":"https://paperswithcode.com/method/metropolis-hastings"},"syntology_read_at":"2026-10-05T00:36:11+00:00","syntology":{"source":"Syntology's have check for this name (the free coverage lookup), read from Syntology's graph","have_url":"https://syntology.ai/api/graph/have?x=Metropolis%20Hastings","read_at":"2026-10-05T00:59:05+00:00","query":"Metropolis Hastings","kind":"method","have":"unknown_name","tier":null,"verified_implementation":null,"level":null,"level_meaning":"the served verification level, per answer; never summed across methods","resolved_to":null,"resolution":null,"resolved_name_differs":false,"absence_asserted":false,"absence_unchecked":null,"no_code_is_about_this_method":false,"subject":null,"archive_paper_arxiv_id":null,"repositories":null,"retrieve_with":null,"name_competition":{"verdict":"none","may_be_wrong_sense":false,"bearers_found":0,"served":null,"leading_other_bearer":null,"n_other_bearers_listed":0,"note":"Nothing in this corpus is named 'Metropolis Hastings' -- no method node, no paper announcing it in its title, no expanded form declaring it as an acronym."},"name_competition_text":null,"near_matches":["Entropy-Cut Metropolis-Hastings","Metropolis-Hastings Diffusion Distance","Independent Metropolis-Hastings sampler","Metropolis-Hastings with Lévy Jumps (MHLJ)","Metropolis-Hastings through LLM Proposals (MHLP)","Propose-and-Project Metropolis-Hastings (PDL-PPMH) sampler","Metropolis-Hastings Sampling for 3D Gaussian Reconstruction","Metropolis-corrected samplers"],"code_nearby":[],"code_nearby_caption":null,"origin_paper":null,"line":"name not resolved (unknown_name). The lookup matched no method, paper or venue by this name; that asserts nothing about whether code exists.","level_legend":null},"syntology_have_state":"loaded","record_sha256":"8e18a2397051f7e98f5b5e02f34ed8e7280979ce68cc5b7141d454f30345b2e7","record_changed_at":"2026-10-05","record_changed_at_basis":"changed"}