Ensemble regression and calibration-in-time

Nick McKay

2018-08-27

#Ensemble Regression and Calibration-in-time

Here, we replicate the analysis of Boldt et al. (2015), performing age-uncertain calibration-in-time on a chlorophyll reflectance record from northern Alaska, using geoChronR.

The challenge of age-uncertain calibration-in-time is that age uncertainty affects both the calibration model (the relation between the proxy data and instrumental data) and the reconstruction (the timing of events in the reconstruction). geoChronR simplifies handling these issues.

Let’s start by loading the packages we’ll need.

library(lipdR) #to read and write LiPD files
library(geoChronR) #of course
library(readr) #to load in the instrumetnal data we need
## 
## Attaching package: 'readr'
## The following object is masked from 'package:scales':
## 
##     col_factor
library(ggplot2) #for plotting

##Load the LiPD file OK, we’ll begin by loading in the Kurupa Lake record from Boldt et al., 2015. The system.file(...) part of this pulls the example file from the package directory. You’d like just enter the path as a string for typical use.

K <- readLipd(system.file("extdata","Kurupa.Boldt.2015.lpd", package = "geoChronR")) 
## [1] "reading: Kurupa.Boldt.2015.lpd"

##Check out the contents

plotSummary(K,paleo.data.var = "RABD",summary.font.size = 6)
## converting bounding box to center/zoom specification. (experimental)
## Map from URL : http://maps.googleapis.com/maps/api/staticmap?center=68.35,-154.61&zoom=5&size=640x640&scale=2&maptype=terrain&language=en-EN&sensor=false
## Scale for 'x' is already present. Adding another scale for 'x', which
## will replace the existing scale.
## Scale for 'y' is already present. Adding another scale for 'y', which
## will replace the existing scale.
## [1] "Found it! Moving on..."
## [1] "Found it! Moving on..."
## [1] "Found it! Moving on..."
## [1] "Found it! Moving on..."
## [1] "Found it! Moving on..."

## TableGrob (4 x 4) "arrange": 4 grobs
##   z     cells    name                   grob
## 1 1 (1-1,1-2) arrange gTree[GRID.gTree.3149]
## 2 2 (1-2,3-4) arrange         gtable[layout]
## 3 3 (2-4,1-2) arrange         gtable[layout]
## 4 4 (3-4,3-4) arrange         gtable[layout]

##Create an age model with Bacon

K <- runBacon(K,labIDVar = 'labID', age14CVar = 'age14C', age14CuncertaintyVar = 'age14CUncertainty', ageVar = 'age', ageUncertaintyVar = 'ageUncertainty', depthVar = 'depth', reservoirAge14CVar = NULL, reservoirAge14CUncertaintyVar = NULL, rejectedAgesVar = NULL,baconAccMean = 10,baconThick = 6,BaconAsk = FALSE,baconDir = "~/Dropbox/MacBacon/Cores",BaconSuggest = FALSE)