Skip to main contentSkip to footer content
 

QUEST
Sample Code

Sample Code

An example Excel spreadsheet used to estimate uncertainty using a Monte Carlo approaching the N budget for Hubbard Brook W6.

  • Example N budget (Excel)
  • Used for: Yanai, R.D., J.J. Battles, A.D. Richardson, E.B. Rastetter, D.M. Wood, and C. Blodgett. 2010. Estimating uncertainty in ecosystem budget calculations. Ecosystems 13(2): 239-248. Link.

An example Excel spreadsheet used to estimate uncertainty using a Monte Carlo approach in forest biomass for Bartlett, Hubbard Brook and Jeffers Brook. Unlike Hubbard Brook W6, which is a census, this includes sampling uncertainty. It also includes a correction for the log-log transformation.

R code for Propagating Uncertainty in Plot-based Estimates of Forest Carbon Stock and Carbon Stock Change (Holdaway et al.)

  • Code R (in zipped file)| TXT
  • Used for: Holdaway, Robert J., Stephen J. McNeill, Norman W. H. Mason, and Fiona E. Carswell. 2014. Propagating Uncertainty in Plot-based Estimates of Forest Carbon Stock and Carbon Stock Change. Ecosystems 17(4): 627-640. DOI: 10.1007/s10021-014-9749-5 HTML| PDF

R code for Error Propagation (Breidenbach et al. 2014.)

  • biomass.f.r and boot.r
  • Used for: Breidenbach et al. 2014. Quantifying the Model-Related Variability of Biomass Stock and Change Estimates in the Norwegian National Forest inventory. Forest Science 60(1): 25-33  Link

Sample Monte Carlo using MS Excel with VB macros, courtesy of Pierre Bernier, Canadian Forest Service.

Sample R code for Monte Carlo simulation of aboveground biomass in W6 at Hubbard Brook, courtesy of Carrie Rose Levine, SUNY-ESF.

  • Monte Carlo R code (Rich Text Format)
  • Used for: Yanai, R.D., C.R. Levine, M.B. Green, and J.L. Campbell. 2012. Quantifying uncertainty in forest nutrient budgets. J. For. 110(8): 448-456. Link.

Zipped file containing Whittaker MC v3.sas and whittaker.csv, courtesy of Andrew Richardson, Harvard University

STATA code for estimating uncertainty in tree biomass, provided by Eiji Matsuzaki of the Univ. of Northern British Columbia.

Discharge data and codes for calculating uncertainty associated with gap filling, provided by Eiji Matsuzaki of the Univ. of Northern British Columbia.

  • Stata Code
  • Eiji also provided data and codes as a spreadsheet and text file.
  • Used for Yanai, R.D., N. Tokuchi, J.L. Campbell, M.B. Green, E. Matsuzaki, S.N. Laseter, C.L. Brown, A.S. Bailey, P. Lyons, C.R. Levine, D.C. Buso, G.E. Likens, J. Knoepp, K. Fukushima. 2015. Sources of uncertainty in estimating stream solute export from headwater catchments at three sites. Hydrological Processes. 29:1793-1805. DOI: 10.1002/hyp.10265 PDF

4th Dimension Code for bootstrapping (random selection of storm samples) that then drives the composite method calculation subroutines, provided by Brent Aulenbach, USGS