{"id":1137,"date":"2026-07-24T17:05:34","date_gmt":"2026-07-24T17:05:34","guid":{"rendered":"https:\/\/sites.rutgers.edu\/nawaf-bou-rabee\/software\/"},"modified":"2026-09-11T20:14:14","modified_gmt":"2026-09-11T20:14:14","slug":"software","status":"publish","type":"page","link":"https:\/\/sites.rutgers.edu\/nawaf-bou-rabee\/software\/","title":{"rendered":"Software"},"content":{"rendered":"<div class=\"reading-column\" style=\"max-width:760px;margin-left:auto;margin-right:auto\">\n<p>Open-source implementations, interactive demos, and reproducibility materials from my research on Markov chain Monte Carlo methods.<\/p>\n<h2>walnutpie<\/h2>\n<p>WALNUTS, the Within-Orbit Adaptive Leapfrog No-U-Turn Sampler, adapts the leapfrog step size <i>within<\/i> each trajectory, so one chain can follow a target whose scale changes from region to region. The reference implementation is <a href=\"https:\/\/github.com\/flatironinstitute\/walnutpie\"><b>walnutpie<\/b><\/a>, a Python package for Markov chain Monte Carlo sampling of differentiable target log densities, maintained at the Flatiron Institute. It takes models from Stan, PyMC, NumPyro, JAX and Numba, or a plain Python function that returns a log density and its gradient.<\/p>\n<pre style=\"background:#faf9f7;border:1px solid #e2e2e2;border-radius:6px;padding:1em 1.25em;font-size:.92em;line-height:1.5\">pip install walnutpie<\/pre>\n<pre style=\"background:#faf9f7;border:1px solid #e2e2e2;border-radius:6px;padding:1em 1.25em;font-size:.92em;line-height:1.5\">import walnutpie as wp\r\n\r\ndef logp(x):\r\n    # your code here\r\n    lp = ...\r\n    gradient = ...\r\n    return lp, gradient\r\n\r\ndraws = wp.walnuts_pyfunc(logp, num_params=10)\r\n\r\nprint(wp.ess(draws))<\/pre>\n<p><a href=\"https:\/\/flatironinstitute.github.io\/walnutpie\/latest\/\">Documentation<\/a> &middot; <a href=\"https:\/\/github.com\/flatironinstitute\/walnutpie\">Source<\/a> &middot; <a href=\"https:\/\/pypi.org\/project\/walnutpie\/\">PyPI<\/a><\/p>\n<p>The core is a header-only C++ library whose only dependency is Eigen. CMake projects can depend on the <code>walnutpie<\/code> target; otherwise add the <code>include\/<\/code> directory to your include paths and provide Eigen separately. Code is released under the MIT license, documentation under CC-BY 4.0.<\/p>\n<h2>How to cite<\/h2>\n<p>N. Bou-Rabee, B. Carpenter, T. S. Kleppe &amp; S. Liu, <a href=\"https:\/\/www.jmlr.org\/papers\/v27\/25-1452.html\">The Within-Orbit Adaptive Leapfrog No-U-Turn Sampler<\/a>, Journal of Machine Learning Research, Vol. 27, No. 113, pp. 1-64, 2026.<\/p>\n<pre style=\"background:#faf9f7;border:1px solid #e2e2e2;border-radius:6px;padding:1em 1.25em;font-size:.92em;line-height:1.5\">@article{JMLR:v27:25-1452,\r\n  author  = {Nawaf Bou-Rabee and Bob Carpenter and Tore Selland Kleppe and Sifan Liu},\r\n  title   = {The Within-Orbit Adaptive Leapfrog No-U-Turn Sampler},\r\n  journal = {Journal of Machine Learning Research},\r\n  year    = {2026},\r\n  volume  = {27},\r\n  number  = {113},\r\n  pages   = {1--64},\r\n  url     = {http:\/\/jmlr.org\/papers\/v27\/25-1452.html}\r\n}<\/pre>\n<h2>Demonstrations and reproducibility<\/h2>\n<ul>\n<li><a href=\"https:\/\/concept-collection.github.io\/walnuts-interactive\"><b>WALNUTS interactive demo<\/b><\/a><br \/>\nWatch adaptive step-size sampling explore a ring, funnel, banana or Gaussian, live in the browser. Built by Jeremy Magland.<\/li>\n<li><a href=\"https:\/\/github.com\/nawafbourabee\/walnuts-split\"><b>NUTS vs WALNUTS animation<\/b><\/a><br \/>\nSplit-screen comparison of the two samplers on Neal&rsquo;s funnel, with code to reproduce it.<\/li>\n<li><a href=\"https:\/\/github.com\/nawafbourabee\"><b>github.com\/nawafbourabee<\/b><\/a><br \/>\nAdditional code and reproducibility materials.<\/li>\n<\/ul>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Open-source implementations, interactive demos, and reproducibility materials from my research on Markov chain Monte Carlo methods. walnutpie WALNUTS, the Within-Orbit Adaptive Leapfrog No-U-Turn Sampler, adapts the leapfrog step size within &hellip; <a href=\"https:\/\/sites.rutgers.edu\/nawaf-bou-rabee\/software\/\" class=\"\">Read More<\/a><\/p>\n","protected":false},"author":2614,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"template-custom.php","meta":{"_acf_changed":false,"footnotes":""},"class_list":["post-1137","page","type-page","status-publish","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Software - Nawaf Bou-Rabee<\/title>\n<meta name=\"description\" content=\"walnutpie, the reference implementation of the WALNUTS sampler, with install instructions, citation, interactive demos and reproducibility materials.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/sites.rutgers.edu\/nawaf-bou-rabee\/software\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Software - Nawaf Bou-Rabee\" \/>\n<meta property=\"og:description\" content=\"walnutpie, the reference implementation of the WALNUTS sampler, with install instructions, citation, interactive demos and reproducibility materials.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/sites.rutgers.edu\/nawaf-bou-rabee\/software\/\" \/>\n<meta property=\"og:site_name\" content=\"Nawaf Bou-Rabee\" \/>\n<meta property=\"article:modified_time\" content=\"2026-09-11T20:14:14+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/sites.rutgers.edu\/nawaf-bou-rabee\/software\/\",\"url\":\"https:\/\/sites.rutgers.edu\/nawaf-bou-rabee\/software\/\",\"name\":\"Software - Nawaf Bou-Rabee\",\"isPartOf\":{\"@id\":\"https:\/\/sites.rutgers.edu\/nawaf-bou-rabee\/#website\"},\"datePublished\":\"2026-07-24T17:05:34+00:00\",\"dateModified\":\"2026-09-11T20:14:14+00:00\",\"description\":\"walnutpie, the reference implementation of the WALNUTS sampler, with install instructions, citation, interactive demos and reproducibility materials.\",\"breadcrumb\":{\"@id\":\"https:\/\/sites.rutgers.edu\/nawaf-bou-rabee\/software\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/sites.rutgers.edu\/nawaf-bou-rabee\/software\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/sites.rutgers.edu\/nawaf-bou-rabee\/software\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/sites.rutgers.edu\/nawaf-bou-rabee\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Software\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/sites.rutgers.edu\/nawaf-bou-rabee\/#website\",\"url\":\"https:\/\/sites.rutgers.edu\/nawaf-bou-rabee\/\",\"name\":\"Nawaf Bou-Rabee\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/sites.rutgers.edu\/nawaf-bou-rabee\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Software - Nawaf Bou-Rabee","description":"walnutpie, the reference implementation of the WALNUTS sampler, with install instructions, citation, interactive demos and reproducibility materials.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/sites.rutgers.edu\/nawaf-bou-rabee\/software\/","og_locale":"en_US","og_type":"article","og_title":"Software - Nawaf Bou-Rabee","og_description":"walnutpie, the reference implementation of the WALNUTS sampler, with install instructions, citation, interactive demos and reproducibility materials.","og_url":"https:\/\/sites.rutgers.edu\/nawaf-bou-rabee\/software\/","og_site_name":"Nawaf Bou-Rabee","article_modified_time":"2026-09-11T20:14:14+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/sites.rutgers.edu\/nawaf-bou-rabee\/software\/","url":"https:\/\/sites.rutgers.edu\/nawaf-bou-rabee\/software\/","name":"Software - Nawaf Bou-Rabee","isPartOf":{"@id":"https:\/\/sites.rutgers.edu\/nawaf-bou-rabee\/#website"},"datePublished":"2026-07-24T17:05:34+00:00","dateModified":"2026-09-11T20:14:14+00:00","description":"walnutpie, the reference implementation of the WALNUTS sampler, with install instructions, citation, interactive demos and reproducibility materials.","breadcrumb":{"@id":"https:\/\/sites.rutgers.edu\/nawaf-bou-rabee\/software\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/sites.rutgers.edu\/nawaf-bou-rabee\/software\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/sites.rutgers.edu\/nawaf-bou-rabee\/software\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/sites.rutgers.edu\/nawaf-bou-rabee\/"},{"@type":"ListItem","position":2,"name":"Software"}]},{"@type":"WebSite","@id":"https:\/\/sites.rutgers.edu\/nawaf-bou-rabee\/#website","url":"https:\/\/sites.rutgers.edu\/nawaf-bou-rabee\/","name":"Nawaf Bou-Rabee","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/sites.rutgers.edu\/nawaf-bou-rabee\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/sites.rutgers.edu\/nawaf-bou-rabee\/wp-json\/wp\/v2\/pages\/1137"}],"collection":[{"href":"https:\/\/sites.rutgers.edu\/nawaf-bou-rabee\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/sites.rutgers.edu\/nawaf-bou-rabee\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/sites.rutgers.edu\/nawaf-bou-rabee\/wp-json\/wp\/v2\/users\/2614"}],"replies":[{"embeddable":true,"href":"https:\/\/sites.rutgers.edu\/nawaf-bou-rabee\/wp-json\/wp\/v2\/comments?post=1137"}],"version-history":[{"count":3,"href":"https:\/\/sites.rutgers.edu\/nawaf-bou-rabee\/wp-json\/wp\/v2\/pages\/1137\/revisions"}],"predecessor-version":[{"id":1230,"href":"https:\/\/sites.rutgers.edu\/nawaf-bou-rabee\/wp-json\/wp\/v2\/pages\/1137\/revisions\/1230"}],"wp:attachment":[{"href":"https:\/\/sites.rutgers.edu\/nawaf-bou-rabee\/wp-json\/wp\/v2\/media?parent=1137"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}