Learn R Programming

Bclim (version 2.2)

BclimRun: Run all stages of Bclim together

Description

This function is intended for beggining/light users of Bclim who wish to create palaeoclimate reconstructions from their own pollen data. It collects together the functions BclimLayer, BclimMixSer, BclimMCMC, BclimInterp and BclimCompile.

Usage

BclimRun(pollen.loc, chron.loc, core.name = "Core", time.grid = seq(0, 14, length = 100), required.data3D = NULL, nchrons = 10000, parallel = FALSE, save.as.you.go = TRUE)

Arguments

pollen.loc
A character string detailing the location of the 28 taxa pollen file. The 28 taxa should be in the following order: Abies Alnus Betula Carpinus Castanea Cedrus Corylus Ephedra Fagus Juniperus Larix Olea Ostrya Phillyrea Picea Pinus.D Pinus.H Pistacia Quer
chron.loc
A character string detailing the location of the chronologies file. This file should contain a matrix with the same number of columns as the number of slices in the core (i.e. the number of rows of the pollen data) and at least 2000 rows. Such a file can
core.name
A character string giving the name of the core. Defaults to 'Core'.
time.grid
A sequence of values of the time variable over which climates and volatilities are to be predicted. Defaults to 0 to 14ka BP with centurial time steps.
required.data3D
A list object of response surfaces. A suitable list object can be downloaded as in the example below. You need to load this in before this part of Bclim can be run.
nchrons
The number of chronologies in the chronologies file. When using output from Bchron this can be safely left at 10,000.
parallel
Whether to run the model using parallel processing technology. To set this as true you must have installed the doMC and foreach R packages.
save.as.you.go
Whether to save output from the differing stages. You should probably keep this set to TRUE in case any of them fail for some reason.

Value

  • A list of class Bclim is returned with the following components:
  • time.gridThe time grid used for interpolation
  • core.nameThe name of the core
  • clim.interpThe interpolated values of climate for the 3 climate dimensions
  • vol.interpThe interpolated volatilities for the 3 climate dimensions
  • MDPThe marginal data posteriors for each layer in the core
  • ScMeanThe raw climate means (used for standardisation purposes)
  • ScVarThe raw climate variances (used for standardisation purposes)
  • clim.dimsThe names of the different climate dimensions
  • nThe number of layers in the core
  • mThe number of climate dimensions (always 3)
  • n.sampThe number of samples created for the MDPs
  • ChronsfileThe location of the chronologies file
  • nchronThe number of chronologies
  • chron.storeThe chronologies used for creating the posterior distributions of climate

Details

A Bclim run can be separated into 4 stages: 1 - Turning each individual pollen layer into climate marginal data posteriors, 2 - Approximating the marginal data posteriors as mixtures of Gaussians, 3 - Running an MCMC stage to estimate climates and climate volatalities, 4 - Interpolating the climates and volatilities onto a regular grid. This function calls all of these stages in turn and will tidy them up for presentation or use in further analysis, such as for plotting using plotBclim. Climate is always 3 dimensional and represented as Growing Degree Days Above 5C (GDD5), The Mean Temperature of the Coldest Month (MTCO) and the ratio of Actual to Potential Evapotranspiration (AET/PET).

References

See Arxiv paper at http://arxiv.org/abs/1206.5009.

See Also

The output here can be used as an input to plotBclim and plotBclimVol. For advanced use of Bclim, see the functions referenced at the top of this file.

Examples

Run this code
# First set the working directory using the setwd command (not shown)

# Download and load in the response surfaces:
url1 <- 'http://mathsci.ucd.ie/~parnell_a/required.data3D.RData'
download.file(url1,'required_data3D.RData')

# and now the pollen
url2 <- 'http://mathsci.ucd.ie/~parnell_a/SlugganPollen.txt'
download.file(url2,'SlugganPollen.txt')

# and finally the chronologies
url3 <- 'http://mathsci.ucd.ie/~parnell_a/Sluggan_2chrons.txt'
download.file(url3,'Slugganchrons.txt')

# Create variables which state the locations of the pollen and chronologies
pollen.loc <- paste(getwd(),'/SlugganPollen.txt',sep='')
chron.loc <- paste(getwd(),'/Slugganchrons.txt',sep='')

# Load in the response surfaces
load('required.data3D.RData')

# Now run Bclim the simple way
RunSluggan <- BclimRun(pollen.loc,chron.loc,core.name="Sluggan Moss",time.grid=seq(0,14,length=100),nchrons=10000,required.data3D=required.data3D,parallel=FALSE)

# Create some plots of climate
plotBclim(RunSluggan,dim=1)

# Create some plots of the volatilities
plotBclimVol(RunSluggan,dim=3)

Run the code above in your browser using DataLab