mwlSource: Water Source Using Meteoric Water Line

Description Usage Arguments Details Value References Examples

View source: R/watercomp.R

Description

Given parameters describing a meteoric water line in H-O isotope space, generate a posterior sample of unevaporated source water values conditioned on one or more sample values.

Usage

1
2
mwlSource(obs, MWL=c(8.01, 9.57, -8.096, 2564532.2, 5.76, 80672), 
                     slope, stype = 1, ngens=1e4, ncores = 1)

Arguments

obs

iso object containing isotope values for one or more samples.

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.

Details

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 emperically-determined 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.

Value

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.

source_d2H

Hydrogen isotopic composition of unevaporated source.

source_d18O

Oxygen isotopic composition of unevaporated source.

S

Evaporation line slope.

E

Evaporation index, equal to the difference between the sample and unevaporated source mixture oxygen isotope values.

References

Bowen et al. (2019) Isotopes in the water cycle: Regional- to global-Scale patterns and applications. Annual Review of Earth and Planetary Sciences 47 453–479. doi: 10.1146/annurev-earth-053018-060220.

Examples

 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)

isoWater documentation built on July 21, 2021, 1:06 a.m.