Estimates the relationship of Calibrated age and depth for palaeorecords. The function uses a smooth spline of the mgcv library by Simon Wood. It produces predicted confidence interval for the relationship approximating a mixed effect model, as there are two levels of uncertainty, i.e. within dated object and between dated objects.
agelme(depup, depdo, bpup, bpdo, use, weights=c(1,rep(0,length(depup)-1)),
vspan=1, k=length(depup)-1, m=2, diagnostic=FALSE)
Degrees of freedom used by the cubic smooth spline, a vector with first value for constant variance and second vector for variance equal to mu.
A vector of the weights used by the cubic smooth spline
A vector of the Residual sum of squares
A list with the models from the cubic smooth spline, constant and mu variance, respectively
A data.frame including the data used for the estimation
The upper depths of the dated slides
The lower depths of the dated slides
The younger calibrated ages of the dated slides
The older calibrated ages of the dated slides
Logical vector of dates to include in the model. Default is to use all.
Weights to be used for the estimation, default is fixed top-layer followed by inverse variance of within dated object
The span to be used for the diagnostic plots, default span = 1
Number of base function to start the shrinkage in the gam estimation procedure
The order of penalty for the term, i.e. the degree of continuity at the knots (default, m = 2 gives cubic smooth spline)
Logical, should diagnostic plots be made.
Einar Heegaard <einar.heegaard@bio.uib.no>
Note that the fixation of the top layer is done by a weight = 1, whereas the other weights follows inverse variance within object.
The diagnostic plots is used to check the quality of the estimation and to see if there is a need for an assumption of between object variance proportional to mean. The latter however is rarely encountered for palaeodata.
Heegaard, E., Birks, HJB. & Telford, RJ. 2005. Relationships between calibrated ages and depth in stratigraphical sequences: an estimation procedure by mixed-effect regression. The Holocene 15: 612-618
data(STOR)
fit.mod <- with(STOR,agelme(depthup,depthdo,cageup,cagedo))
#Predicting using the constant variance model,
#for each cm between 70 and 400 cm.
fit.pre <- predict(fit.mod,1,70:400)
plot(fit.pre)
Run the code above in your browser using DataLab