Journal of Agriculture and Food Research (Dec 2021)
Using Hamiltonian Monte Carlo via Stan to estimate crop input response functions with stochastic plateaus
Abstract
Bayesian analysis provides a principled way to quantify uncertainty and incorporate data and prior knowledge into parameter estimates. This paper makes the latest in Bayesian methods easier for others to use with a focus on a stochastic plateau crop production function. Previous studies have used Bayesian techniques to model stochastic plateau functions. No published work provides computation guidelines to estimate stochastic plateau functions using Bayesian approaches using computationally efficient algorithms such as Hamiltonian Monte Carlo (HMC). HMC is the default choice in Stan software, but the learning curve to master the software is steep. We provide HMC estimation instructions for a univariate stochastic plateau function using the R environment's brms and RStan. We also compare HMC estimation results with those using Gibbs sampling via Just Another Gibbs Sampler (JAGS) software using the R Interface R2jags. The programs are relatively compact and are included in the paper. Simulation results from HMC are consistent across different priors and are similar to those generated by a Gibbs sampler. This paper serves as a tutorial on the use of HMC for estimating plateau-type production functions. The code, and method, can be extended to other nonlinear models.