Description Usage Arguments Details Value References Examples
Given parameters describing a meteoric water line in HO isotope space, generate a posterior sample of unevaporated source water values conditioned on one or more sample values.
1 2 
obs 

MWL 
numeric. Vector of length 6 containing parameters describing a meteoric water line (see Details). 
slope 
numeric. Vector of length two specifying prior parameters for the evaporation line slope (mean, standard deviation). 
stype 
integer. Line statistic used to constrain the source prior: 1 = confidence interval, 2 = prediction interval (see Details). 
ngens 
integer. Number of posterior samples to obtain (per chain). 
ncores 
integer. Number of cores to use for parallel processing. 
The prior distribution of source values is constrained by MWL
, which contains the parameters: slope, intercept, average d18O, sum of squares in d18O, root mean square error, and number of samples for an empericallydetermined meteoric water line. This object can be created from a H and O isotope dataset using the fuction mwl
. The default values reflect the Global Meteoric Water Line estimated from a global precipitation compilation in Bowen, et al. (2019). stype
determines how the source uncertainty about the MWL is calculated; the default (1, confidence interval) is appropriate if the source is best represented as an integrated mixture of the samples defining the MWL, whereas option 2 (prediction interval) is appropriate if the source is best represented as a single sample.
If ncores
= 1, three chains will be run on a single core. If ncores
> 1, ncores
chains will be run in parallel on ncores
cores.
Returns an object of class “mwlSource”, a list containing:
summary 
matrix. Summary table of JAGS MCMC results, including parameter posterior distributions and convergence statistics. 
results 
data.frame. Posterior samples of model parameters.

Bowen et al. (2019) Isotopes in the water cycle: Regional to globalScale patterns and applications. Annual Review of Earth and Planetary Sciences 47 453–479. doi: 10.1146/annurevearth053018060220.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19  #Prep MWL
O = runif(10, 15, 2)
H = O * 8 + 10 + rnorm(10, 0, 6)
MWL = mwl(data.frame(H, O), plot = FALSE)
#Sample data
obs = iso(60, 6, 0.5, 0.1, 0)
#Evaporation slope
slope = c(5, 0.3)
#Run and report...likely not converged!
ws = mwlSource(obs, MWL, slope, ngens = 1e3)
ws$summary
#A traceplot
plot(ws$results$source_d18O[1:1000], type = "l")
lines(ws$results$source_d18O[1001:2000], col = 2)
lines(ws$results$source_d18O[2001:3000], col = 3)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.