A simple implentation of the signal-free chronology
ssf(rwl, method="AgeDepSpline",
nyrs = NULL, pos.slope = FALSE,
maxIterations = 25, madThreshold = 5e-4,
return.info = FALSE, verbose = TRUE)
An object of of class crn
and data.frame
with the signal-free chronology and the sample depth. The years are stored as row numbers.
If return.info
is TRUE
a list
containing at least the following components:
a list
with information on the arguments used in the function call.
the original naive chronology at iteration 0.
the signal-free chronology as above.
an array
of years by series by iterations that holds the signal free measurements.
an array
of years by series by iterations that holds the rescaled signal free measurements.
an array
of years by series by iterations that holds the rescaled signal free curve fits.
an array
of years by series by iterations that holds the detrended signal free measurements.
a matrix
of years by iterations that holds the calculated chronology.
a matrix
of years by iterations that holds the calculated high-frequency chronology.
a matrix
of years by iterations-1 that holds the differences between the kth and the kth-1 high frequency chronology residuals.
a vector
containing the median absolute difference between iteration k and k-1.
a rwl
object with series as columns and years as
rows such as that produced by read.rwl
. See ‘Details’.
a character
vector to determine the detrending
method. See ‘Details’ below. Possible values are
c("Spline", "AgeDepSpline")
.
a number controlling the smoothness of the fitted curve in methods. See ‘Details’.
a logical
flag. Allow for a positive
slope in method "AgeDepSpline"
?
a numeric
. The maximum number of iterations to be used in the fitting process. See ‘Details’.
a numeric
. The median absolute difference threshold used for a stopping criteria. See ‘Details’.
a logical
flag. If TRUE
, details
about models and data will be added to the return value. See
‘Value’.
a logical
flag. Write out details to the screen?
Ed Cook provided Fortran code that was ported to R by Andy Bunn.
This function creates a simple signal-free chronology that loosely follows the procedures laid out on p75 of Melvin and Briffa (2008). This function is a lighter version of that procedure and users who want more control and refinement should look to the CRUST program decried in Melvin and Briffa (2014). These steps are described in more detail in Learning to Love R.
Detrend each series using the selected method, calculate RWI by division, and create an initial mean-value chronology.
Create signal-free measurements by dividing each series of measurements by the chronology. If return.info
is invoked these are returned in sfRW_Array
.
Rescale the signal-free measurements to their original mean. If return.info
is invoked these are returned in sfRWRescaled_Array
.
If the sample depth is one, replace signal-free measurements with original measurements.
Fit curves to signal free measurements.If return.info
is invoked these are returned in sfRWRescaledCurves_Array
.
Get new growth indicies by dividing the original measurements by curves in the last step. If return.info
is invoked these are returned in sfRWI_Array
.
Create a mean-value chronology using the indicies from the prior step. If return.info
is invoked these are returned in sfCrn_Mat
.
Repeat steps two through seven up to maxIter
or until the madThreshold
is reached. The stopping criteria is determined using the absolute difference between filtered chronologies generated in interation k and k-1. This is done with the residuals of a high-pass filter on the chronology using a cubic smoothing spline (caps
) with the stiffness set as the median of the segment lengths of series contributing to the chronology. The stopping threshold is calculated as the median absolute difference of the kth and kth-1 chronologies weighted by the normalized sample depth. If return.info
is invoked the residual chronologies are returned in hfCrnResids_Mat
and the median absolute differences are returns in MAD_Vec
.
The input object (rwl
) should be of class
rwl
. If it not, the function will attempt to coerce it using as.rwl
and a warning will be issued. In general,
See the references below for further details on detrending. It's a dark art.
Melvin, TM, Briffa, KR (2008) A 'signal-free' approach to dendroclimatic standardisation. Dendrochronologia 26: 71–86 doi: 10.1016/j.dendro.2007.12.001
Melvin T. M. and Briffa K.R. (2014a) CRUST: Software for the implementation of Regional Chronology Standardisation: Part 1. Signal-Free RCS. Dendrochronologia 32, 7-20, doi: 10.1016/j.dendro.2013.06.002
Melvin T. M. and Briffa K.R. (2014b) CRUST: Software for the implementation of Regional Chronology Standardisation: Part 2. Further RCS options and recommendations. Dendrochronologia 32, 343-356, doi: 10.1016/j.dendro.2014.07.008
detrend
. chron
library(stats)
data(wa082)
wa082SSF <- ssf(wa082)
plot(wa082SSF,add.spline=TRUE,nyrs=20)
Run the code above in your browser using DataLab