Demystifying Monte Carlo methods in R: A guide from Metropolis–Hastings to Hamiltonian Monte Carlo with biological growth equation examples

IF 2.6 3区 环境科学与生态学 Q2 ECOLOGY
Dipali Vasudev Mestry, Amiya Ranjan Bhowmick
{"title":"Demystifying Monte Carlo methods in R: A guide from Metropolis–Hastings to Hamiltonian Monte Carlo with biological growth equation examples","authors":"Dipali Vasudev Mestry,&nbsp;Amiya Ranjan Bhowmick","doi":"10.1016/j.ecolmodel.2024.110922","DOIUrl":null,"url":null,"abstract":"<div><div>Hamiltonian Monte Carlo (HMC) has emerged as a cutting-edge and versatile Markov Chain Monte Carlo (MCMC) method, widely adopted across various disciplines due to its superior computational efficiency compared to other MCMC techniques. Over the past few decades, HMC has gained significant traction. However, its implementation can pose challenges for practitioners, as it relies on concepts rooted in Hamiltonian dynamics from classical mechanics. Despite the development of modern Bayesian computation tools like <span><math><mstyle><mi>S</mi><mi>t</mi><mi>a</mi><mi>n</mi></mstyle></math></span>, which facilitate the application of HMC, the underlying mechanics may remain opaque to beginners. This article seeks to provide a clear and accessible introduction to HMC. We begin by reviewing the Metropolis–Hastings (MH) algorithm and its limitations, illustrated with simulated data. We then methodically explain the HMC algorithm through step-by-step simulation examples, showcasing its implementation in <span><math><mstyle><mi>R</mi></mstyle></math></span> software. Finally, we present a series of ecological case studies spanning a broad range of applications, including both single-species and multispecies dynamics. These studies demonstrate the implementation of HMC using the <span><math><mstyle><mi>r</mi><mi>s</mi><mi>t</mi><mi>a</mi><mi>n</mi></mstyle></math></span> package in <span><math><mstyle><mi>R</mi></mstyle></math></span>, applied to both simulated and real-world data. By adopting this pedagogical approach, we aim to help newcomers better understand and apply HMC to their research domains with confidence.</div></div>","PeriodicalId":51043,"journal":{"name":"Ecological Modelling","volume":"501 ","pages":"Article 110922"},"PeriodicalIF":2.6000,"publicationDate":"2025-02-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Ecological Modelling","FirstCategoryId":"93","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S0304380024003107","RegionNum":3,"RegionCategory":"环境科学与生态学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q2","JCRName":"ECOLOGY","Score":null,"Total":0}
引用次数: 0

Abstract

Hamiltonian Monte Carlo (HMC) has emerged as a cutting-edge and versatile Markov Chain Monte Carlo (MCMC) method, widely adopted across various disciplines due to its superior computational efficiency compared to other MCMC techniques. Over the past few decades, HMC has gained significant traction. However, its implementation can pose challenges for practitioners, as it relies on concepts rooted in Hamiltonian dynamics from classical mechanics. Despite the development of modern Bayesian computation tools like Stan, which facilitate the application of HMC, the underlying mechanics may remain opaque to beginners. This article seeks to provide a clear and accessible introduction to HMC. We begin by reviewing the Metropolis–Hastings (MH) algorithm and its limitations, illustrated with simulated data. We then methodically explain the HMC algorithm through step-by-step simulation examples, showcasing its implementation in R software. Finally, we present a series of ecological case studies spanning a broad range of applications, including both single-species and multispecies dynamics. These studies demonstrate the implementation of HMC using the rstan package in R, applied to both simulated and real-world data. By adopting this pedagogical approach, we aim to help newcomers better understand and apply HMC to their research domains with confidence.
求助全文
约1分钟内获得全文 求助全文
来源期刊
Ecological Modelling
Ecological Modelling 环境科学-生态学
CiteScore
5.60
自引率
6.50%
发文量
259
审稿时长
69 days
期刊介绍: The journal is concerned with the use of mathematical models and systems analysis for the description of ecological processes and for the sustainable management of resources. Human activity and well-being are dependent on and integrated with the functioning of ecosystems and the services they provide. We aim to understand these basic ecosystem functions using mathematical and conceptual modelling, systems analysis, thermodynamics, computer simulations, and ecological theory. This leads to a preference for process-based models embedded in theory with explicit causative agents as opposed to strictly statistical or correlative descriptions. These modelling methods can be applied to a wide spectrum of issues ranging from basic ecology to human ecology to socio-ecological systems. The journal welcomes research articles, short communications, review articles, letters to the editor, book reviews, and other communications. The journal also supports the activities of the [International Society of Ecological Modelling (ISEM)](http://www.isemna.org/).
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信