Title: | Global Bayesian Foraminifera Core Top Calibration |
Version: | 0.0.1 |
Description: | A Bayesian, global planktic foraminifera core top calibration to modern sea-surface temperatures. Includes four calibration models, considering species-specific calibration parameters and seasonality. |
URL: | https://github.com/brews/bayfoxr/ |
BugReports: | https://github.com/brews/bayfoxr/issues |
Depends: | R (≥ 3.4) |
License: | GPL (≥ 3) |
Encoding: | UTF-8 |
LazyData: | true |
Suggests: | testthat, knitr, rmarkdown |
RoxygenNote: | 6.1.1 |
VignetteBuilder: | knitr |
NeedsCompilation: | no |
Packaged: | 2019-02-01 21:15:18 UTC; sbm |
Author: | Steven Malevich [aut, cre] |
Maintainer: | Steven Malevich <malevich@email.arizona.edu> |
Repository: | CRAN |
Date/Publication: | 2019-02-06 15:53:33 UTC |
Bass River planktic foraminiferal calcite d18O.
Description
A data set containing marine sediment core samples from the Paleocene-Eocene Thermal Maximum (PETM) section with well preservedforaminifera calcite d18O.
Usage
bassriver
Format
A data frame with 62 rows and 2 column variables:
- depth
marine sediment down-core sample depth, in m
- d18o
Morozovella spp. shell calcite d18O, in ‰ VPDB
Source
John, C. M., S. M. Bohaty, J. C. Zachos, A. Sulijs, S. Gibbs, H. Brinkhuis, and T. J. Bralower (2008), North American continental margin records of the Paleocene-Eocene thermal maximum: Implications for global carbon and hydrological cycling, Paleoceanography, 23(2), doi:10.1029/2007PA001465.
Parse trace dataframe column names to get vector of available forams.
Description
Parse trace dataframe column names to get vector of available forams.
Usage
get_available_forams(d)
Arguments
d |
Data frame containing MCMC trace draws. Column names are model parameters with foram group name separated from model parameters name by "__" |
Value
Character vector of available foram names.
Get MCMC trace draws.
Description
Get MCMC trace draws.
Usage
get_draws(foram = NULL, seasonal_seatemp = FALSE)
Arguments
foram |
Optional. String or |
seasonal_seatemp |
Optional boolean indicating whether to use the seasonal
sea-surface temperature calibrations. Default is |
Details
Four calibration models are available: an "annual pooled" model, a
"seasonal pooled" model, an "annual hierarchical" model, and a
"seasonal hierarchical" model. This function uses magic to determine which
"pooled annual" model is used. Which is the simplest case with potential use
for Deep Time reconstructions of nonexant foram species. Giving a valid string
for foram
will use a hierarchical model, which has foram-specific
variability in calibration model parameters. Passing TRUE
for
seasonal_seatemp
will use a model trained on season sea-surface
temperatures. See reference paper for further details.
Value
Data frame with columns "alpha", "beta", "tau". Which are equal-length vectors of model parameter draws.
Plot a prediction
object.
Description
Plot a prediction
object.
Usage
## S3 method for class 'prediction'
plot(...)
Arguments
... |
Arguments passed on to |
See Also
Examples
data(bassriver)
# Using the "pooled annual" calibration model:
sst <- predict_seatemp(bassriver$d18o, d18osw=0.0,
prior_mean=30.0, prior_std=20.0)
predictplot(x=bassriver$depth, y=sst, ylim=c(20, 40),
ylab="SST (°C)", xlab="Depth (m)")
Predict d18O of foram calcite given seawater temperature and seawater d18O.
Description
Predict d18O of foram calcite given seawater temperature and seawater d18O.
Usage
predict_d18oc(seatemp, d18osw, foram = NULL, seasonal_seatemp = FALSE,
drawsfun = get_draws)
Arguments
seatemp |
Numeric or vector of observed sea-surface temperatures (°C). |
d18osw |
Numeric or vector of observed seawater d18O (‰ VSMOW). |
foram |
Optional. String or |
seasonal_seatemp |
Optional boolean indicating whether to use the seasonal
sea-surface temperature calibrations. Default is |
drawsfun |
Optional function used to get get model parameter draws. Must
take arguments for "foram" and "seasonal_seatemp" and return a list with
members "alpha", "beta", "tau". This is for debugging and testing. See
|
Details
Four calibration models are available: an "annual pooled" model, a
"seasonal pooled" model, an "annual hierarchical" model, and a
"seasonal hierarchical" model. This function uses magic to determine which
"pooled annual" model is used. Which is the simplest case with potential use
for Deep Time reconstructions of nonexant foram species. Giving a valid string
for foram
will use a hierarchical model, which has foram-specific
variability in calibration model parameters. Passing TRUE
for
seasonal_seatemp
will use a model trained on season sea-surface
temperatures. See reference paper for further details.
Value
A prediction
instance for inferred foraminiferal calcite
d18O (‰ VPDB).
See Also
Examples
# Infer d18Oc for a G. bulloides core top sample using annual hierarchical model.
# The true, d18Oc for this sample is -2.16 (‰ VPDB).
delo_ann <- predict_d18oc(seatemp=28.6, d18osw=0.48, foram="G. bulloides")
head(quantile(delo_ann, probs=c(0.159, 0.5, 0.841))) # ± 1 standard deviation
# Now using seasonal hierarchical model:
delo_sea <- predict_d18oc(seatemp=28.6, d18osw=0.48, foram="G. bulloides",
seasonal_seatemp = TRUE)
head(quantile(delo_sea, probs=c(0.159, 0.5, 0.841))) # ± 1 standard deviation
Predict sea-surface temperature given d18O of foram calcite and seawater d18O.
Description
Predict sea-surface temperature given d18O of foram calcite and seawater d18O.
Usage
predict_seatemp(d18oc, d18osw, prior_mean, prior_std, foram = NULL,
seasonal_seatemp = FALSE, drawsfun = get_draws)
Arguments
d18oc |
Numeric or vector of observed foram calcite d18O (‰ VPDB). |
d18osw |
Numeric or vector of observed seawater d18O (‰ VSMOW). |
prior_mean |
Numeric indicating prior mean for sea-surface temperature (°C). |
prior_std |
Numeric indicating prior standard deviation for sea-surface temperature (°C). |
foram |
Optional. String or |
seasonal_seatemp |
Optional boolean indicating whether to use the seasonal
sea-surface temperature calibrations. Default is |
drawsfun |
Optional function used to get get model parameter draws. Must take arguments for "foram" and "seasonal_seatemp" and return a list with members "alpha", "beta", "tau". This is for debugging and testing. |
Details
Four calibration models are available: an "annual pooled" model, a
"seasonal pooled" model, an "annual hierarchical" model, and a
"seasonal hierarchical" model. This function uses magic to determine which
"pooled annual" model is used. Which is the simplest case with potential use
for Deep Time reconstructions of nonexant foram species. Giving a valid string
for foram
will use a hierarchical model, which has foram-specific
variability in calibration model parameters. Passing TRUE
for
seasonal_seatemp
will use a model trained on season sea-surface
temperatures. See reference paper for further details.
Value
A prediction
instance for inferred sea-surface temperature (°C).
See Also
Examples
data(bassriver)
# Using the "pooled annual" calibration model:
sst <- predict_seatemp(bassriver$d18o, d18osw=0.0,
prior_mean=30.0, prior_std=20.0)
head(quantile(sst)) # Show only the top few values
predictplot(x=bassriver$depth, y=sst, ylim=c(20, 40),
ylab="SST (°C)", xlab="Depth (m)")
Constructor for S3 prediction class.
Description
Constructor for S3 prediction class.
Usage
prediction(ensemble)
Arguments
ensemble |
A matrix (m x n) of the prediciton posteriors. Where m is the number of values inferred and n is the number of trace draws. |
Value
A prediction
object.
Simple plot of prediction
with intervals.
Description
Simple plot of prediction
with intervals.
Usage
predictplot(y, x = NULL, probs = c(0.05, 0.5, 0.95),
poly_col = grDevices::rgb(0, 0, 0, 0.1), ...)
Arguments
y |
A |
x |
Optional vector or NULL, indicating were |
probs |
Optional 3-member Vector of numerics indicating low, middle, and high probability intervals to plot. All must be <= 1. |
poly_col |
Optional color for interval polygon. |
... |
Additional arguments passed to |
Examples
data(bassriver)
# Using the "pooled annual" calibration model:
sst <- predict_seatemp(bassriver$d18o, d18osw=0.0,
prior_mean=30.0, prior_std=20.0)
predictplot(x=bassriver$depth, y=sst, ylim=c(20, 40),
ylab="SST (°C)", xlab="Depth (m)")
Quantiles for a prediction
.
Description
Quantiles for a prediction
.
Usage
## S3 method for class 'prediction'
quantile(x, ...)
Arguments
x |
A |
... |
Arguments to be passed on to |
Internal function for 'predict_seatemp()'.
Description
Internal function for 'predict_seatemp()'.
Usage
target_timeseries_pred(d18osw_now, alpha_now, beta_now, tau_now, proxy_ts,
prior_mu, prior_inv_cov)
Arguments
d18osw_now |
Numeric or vector giving seawater d18O. Note, should be in units (‰ VPDB). |
alpha_now |
Numeric, alpha model parameter. |
beta_now |
Numeric, beta model parameter. |
tau_now |
Numeric, tau model parameter. |
proxy_ts |
Numeric or vector of proxy time series (foram d18O). |
prior_mu |
Matrix (n X 1) giving prior mean. |
prior_inv_cov |
Matrix (n X x) giving prior inverse covariance matrix. |
Value
Sample of time time series vector conditional on the other args