detrend.series: Detrend a Ring-Width Series in dplR: Dendrochronology Program Library in R (2024)

detrend.seriesR Documentation

Detrend a Ring-Width Series

Description

Detrend a tree-ring series by one of two methods, a smoothing spline ora statistical model. The series and fits are plotted by default.

Usage

detrend.series(y, y.name = "", make.plot = TRUE, method = c("Spline", "ModNegExp", "Mean", "Ar", "Friedman", "ModHugershoff","AgeDepSpline"), nyrs = NULL, f = 0.5, pos.slope = FALSE, constrain.nls = c("never", "when.fail", "always"), verbose = FALSE, return.info = FALSE, wt, span = "cv", bass = 0, difference = FALSE)

Arguments

y

a numeric vector. Usually a tree-ring series.

y.name

an optional character vector to name the seriesfor plotting purposes.

make.plot

a logical flag. Makes plots of the raw dataand detrended data if TRUE.

method

a character vector to determine the detrendingmethods. See details below. Possible values are all subsets of
c("Spline", "ModNegExp", "Mean", "Ar", "Friedman", "ModHugershoff", "AgeDepSpline").Defaults to using all the available methods.

nyrs

a number controlling the smoothness of thefitted curve in methods. See Details.

f

a number between 0 and 1 giving the frequency response orwavelength cutoff in method "Spline". Defaults to 0.5. See caps.

pos.slope

a logical flag. Will allow for a positiveslope to be used in method "ModNegExp" or "AgeDepSpline". If FALSE theline will be horizontal.

constrain.nls

a character string which controlsthe constraints of the "ModNegExp" model and and the "ModHugershoff" model which are fit using nonlinear least-squares via nls. The value is ananswer to the question: When should the parameters of the nlsfunction be constrained? The options are"never": do not constrain (the default), "when.fail":only compute the constrained solution if the unconstrained fitcontains other than positive values, and "always": return theconstrained solution, even if the unconstrained one would have beenvalid. See ‘Details’.

verbose

a logical flag. Write out details to the screen?

return.info

a logical flag. If TRUE, detailsabout models and data will be added to the return value. See‘Value’.

wt

a numeric vector of case weights for method"Friedman". The default means equals weights.

span

a numeric value controlling method"Friedman", or "cv" (default) for automatic choice bycross-validation. See supsmu.

bass

a numeric value controlling the smoothness of thefitted curve in method "Friedman". See supsmu.

difference

a logical flag. Compute residuals by subtraction if TRUE, otherwise use division.

Details

This detrends and standardizes a tree-ring series. The detrending is the estimation and removal of the tree’s natural biological growth trend. The default standardization is done by dividing each series by the growth trend to produce units in the dimensionless ring-width index (RWI). If difference is TRUE, the index is calculated by subtraction. Values of zero (typically missing rings) in y are set to 0.001.

There are currently seven methods available fordetrending although more are certainly possible. The methodsimplemented are an age-dependent spline via ads (method = "AgeDepSpline"), the residuals of an AR model(method = "Ar"), Friedman's Super Smoother (method = "Friedman"), a simple horizontal line(method = "Mean"), or a modified Hugershoffcurve (method = "ModHugershoff"), a modified negative exponentialcurve (method = "ModNegExp"), and a smoothing spline via caps (method = "Spline").

The "AgeDepSpline" approach uses an age-dependent spline with an initialstiffness of 50 (nyrs=50). See ads. If some of the fitted values are not positive then method "Mean" is used. However, this isextremely unlikely.

The "Ar" approach is also known as prewhitening where the detrended series is the residuals of an ar model divided by themean of those residuals to yield a series with white noise and a mean of one.This method removes all but the high frequency variation in the seriesand should only be used as such.

The "Friedman" approach uses Friedman’s ‘supersmoother’ as implemented in supsmu. The parameterswt, span and bass can beadjusted, but periodic is always set to FALSE. If some of the fitted values are not positive then method "Mean" is used.

The "Mean" approach fits a horizontal line using the mean ofthe series. This method is the fallback solution in cases where the"Spline" or the linear fit (also a fallback solution itself)contains zeros or negative values, which would lead to invalidring-width indices.

The "ModHugershoff" approach attempts to fit a Hugershoffmodel of biological growth of the form f(t) = a t^b e^{-g t} + d, where the argument of the function is time, usingnls. See Fritts (2001) for details about theparameters. Option constrain.nls gives apossibility to constrain the parameters of the modified negativeexponential function. If the constraints are enabled, the nonlinearoptimization algorithm is instructed to keep the parameters in thefollowing ranges: a \ge 0, b \ge 0 andd \ge 0. The default is to not constrain the parameters(constrain.nls = "never") for nls butwarn the user when the parameters go out of range.

If a suitable nonlinear model cannot be fit(function is non-decreasing or some values are not positive) then alinear model is fit. That linear model can have a positive slopeunless pos.slope is FALSE in which case method"Mean" is used.

The "ModNegExp" approach attempts to fit a classic nonlinearmodel of biological growth of the form f(t) = a e^{b t} + k, where the argument of the function is time, usingnls. See Fritts (2001) for details about theparameters. Option constrain.nls gives apossibility to constrain the parameters of the modified negativeexponential function. If the constraints are enabled, the nonlinearoptimization algorithm is instructed to keep the parameters in thefollowing ranges: a \ge 0, b \le 0 andk \ge 0. The default is to not constrain the parameters(constrain.nls = "never") for nls butwarn the user when the parameters go out of range.

If a suitable nonlinear model cannot be fit(function is non-decreasing or some values are not positive) then alinear model is fit. That linear model can have a positive slopeunless pos.slope is FALSE in which case method"Mean" is used.

The "Spline" approach uses a spline where the frequencyresponse is 0.50 at a wavelength of 0.67 * “series length inyears”, unless specified differently using nyrs andf in the function caps. If some of the fitted values are not positive then method "Mean" is used.

These methods are chosen because they are commonly used indendrochronology. There is a rich literature on detrendingand many researchers are particularly skeptical of the use of the classic nonlinear model of biological growth (f(t) = a e^{b t} + k) for detrending. It is, of course, up to the user to determine the best detrending method for their data.

Note that the user receives a warning if a series has negative values in the fitted curve. This happens fairly commonly with with the ‘Ar’ method on high-order data. It happens less often with method ‘Spline’ butisn't unheard of (see ‘Examples’). If this happens, users should lookcarefully at their data before continuing. Automating detrending and not evaluating each series individually is folly. Remember, frustration over detrending is the number one cause of dendros going to live as hermits in the tallgrass prairie, where there are no trees to worry about.

See the references below for further details on detrending. It's a dark art.

Value

If several methods are used, returns a data.frame containingthe detrended series (y) according to the methods used.The columns are named and ordered to match method. Ifonly one method is selected, returns a vector.

If return.info is TRUE, the return value is alist with four parts:

series

the main result described above (data.frame orvector)

curves

the curve or line used to detrend series. Either a data.frame or vector.

model.info

Information about the models corresponding to eachoutput series. Whereas series may return a vector,model.info is always a list where each top levelelement corresponds to one selected method. Also these elements arenamed and arranged according to the methods selected. Each elementis a list with some of the following sub-elements, depending onwhich detrending method was actually used:

n.zeros

See "data.info" below. Always present.

zero.years

See "data.info". Always present.

method

The method actually used for detrending. One of"Mean", "Line", "ModNegExp","Spline" or "Ar". Always present.

mean

Mean of the input series, missing values removed.Only for method "Mean".

coefs

Coefficients of the model. Methods "Line"and "ModNegExp".

formula

The "ModNegExp" formula.

is.constrained

A logical flag indicating whetherthe parameters of the "ModNegExp" model wereconstrained. Only interesting when argumentconstrain.nls is set to "when.fail".

nyrs

The value of nyrs used forcaps. For methods "Spline" and"AgeDepSpline".

order

The order of the autoregressive model, selected byAIC (Akaike information criterion). Only for method"Ar".

ar

The autoregressive coefficients used by method"Ar". A numeric vector ordered by increasinglag.

data.info

Information about the input series: number("n.zeros") and location ("zero.years") of zerovalues. If the locations are in a character vector, they areyears. Otherwise they are indices to the input series.

dirtDog

A logical flag indicating whether the requested method resulted in neagtive values for the curve fit, what Cook's ARSTAN called a Dirty Dog.

Author(s)

Andy Bunn. Patched and improved by Mikko Korpela. A bug fixrelated to negative output values is based on work by Alice Cecile.

References

Cook, E. R. and Kairiukstis, L. A., editors (1990) Methods ofDendrochronology: Applications in the Environmental Sciences.Springer. ISBN-13: 978-0-7923-0586-6.

Fritts, H. C. (2001) Tree Rings and Climate.Blackburn. ISBN-13: 978-1-930665-39-2.

See Also

detrend

Examples

library(stats)library(utils)## Use series CAM011 from the Campito data setdata(ca533)series <- ca533[, "CAM011"]names(series) <- rownames(ca533)# defaults to all six methodsseries.rwi <- detrend.series(y = series, y.name = "CAM011", verbose=TRUE)# see plot with three methodsseries.rwi <- detrend.series(y = series, y.name = "CAM011", method=c("Spline", "ModNegExp","Friedman"), difference=TRUE)# see plot with two methods# interesting to note difference from ~200 to 250 years # in terms of what happens to low frequency growthseries.rwi <- detrend.series(y = series, y.name = "CAM011", method=c("Spline", "ModNegExp"))# see plot with just one method and change the spline# stiffness to 50 years (which is not neccesarily a good choice!)series.rwi <- detrend.series(y = series, y.name = "CAM011", method="Spline",nyrs=50) # note that method "Ar" doesn't get plotted in first panel# since this approach doesn't approximate a growth curve.series.rwi <- detrend.series(y = series, y.name = "CAM011", method="Ar") # note the difference between ModNegExp and ModHugershoff at the # start of the series. Also notice how curves, etc. are returned# via return.infodata(co021)series <- co021[, 4]names(series) <- rownames(co021)series.rwi <- detrend.series(y = series, y.name = names(co021)[4], method=c("ModNegExp", "ModHugershoff"), verbose = TRUE, return.info = TRUE, make.plot = TRUE) # A dirty dog.# In the case of method=="Spline" the function carries-on# and applies method=="Mean" as an alternative. data(nm046)series <- nm046[,8]names(series) <- rownames(nm046)series.rwi <- detrend.series(y = series, y.name = names(nm046)[8], method="Spline", make.plot = FALSE)
detrend.series: Detrend a Ring-Width Series in dplR: Dendrochronology Program Library in R (2024)

References

Top Articles
UPS Delivery Times - What Time Does UPS Deliver Until? - Consumer Advisory
Estragon South End
The Largest Banks - ​​How to Transfer Money With Only Card Number and CVV (2024)
Shoe Game Lit Svg
Combat level
Botw Royal Guard
Breaded Mushrooms
Fnv Turbo
Nikki Catsouras Head Cut In Half
Umn Biology
3656 Curlew St
C Spire Express Pay
Enderal:Ausrüstung – Sureai
Busty Bruce Lee
All Buttons In Blox Fruits
Shannon Dacombe
Northern Whooping Crane Festival highlights conservation and collaboration in Fort Smith, N.W.T. | CBC News
Grab this ice cream maker while it's discounted in Walmart's sale | Digital Trends
Dallas Cowboys On Sirius Xm Radio
Check From Po Box 1111 Charlotte Nc 28201
360 Tabc Answers
Pinellas Fire Active Calls
Hermitcraft Texture Pack
Is A Daytona Faster Than A Scat Pack
How to Download and Play Ultra Panda on PC ?
Craigslist Maryland Trucks - By Owner
The Listings Project New York
14 Top-Rated Attractions & Things to Do in Medford, OR
Ewg Eucerin
Bursar.okstate.edu
Was heißt AMK? » Bedeutung und Herkunft des Ausdrucks
Http://N14.Ultipro.com
Urban Blight Crossword Clue
Gas Prices In Henderson Kentucky
Amici Pizza Los Alamitos
Iban's staff
AP Microeconomics Score Calculator for 2023
Pillowtalk Podcast Interview Turns Into 3Some
Acadis Portal Missouri
Google Chrome-webbrowser
Culvers Lyons Flavor Of The Day
Daily Times-Advocate from Escondido, California
15 Best Things to Do in Roseville (CA) - The Crazy Tourist
How to Quickly Detect GI Stasis in Rabbits (and what to do about it) | The Bunny Lady
RECAP: Resilient Football rallies to claim rollercoaster 24-21 victory over Clarion - Shippensburg University Athletics
Craigslist Farm And Garden Reading Pa
Interminable Rooms
Theater X Orange Heights Florida
Willkommen an der Uni Würzburg | WueStart
300+ Unique Hair Salon Names 2024
Besoldungstabellen | Niedersächsisches Landesamt für Bezüge und Versorgung (NLBV)
WHAT WE CAN DO | Arizona Tile
Latest Posts
Article information

Author: Madonna Wisozk

Last Updated:

Views: 6452

Rating: 4.8 / 5 (68 voted)

Reviews: 91% of readers found this page helpful

Author information

Name: Madonna Wisozk

Birthday: 2001-02-23

Address: 656 Gerhold Summit, Sidneyberg, FL 78179-2512

Phone: +6742282696652

Job: Customer Banking Liaison

Hobby: Flower arranging, Yo-yoing, Tai chi, Rowing, Macrame, Urban exploration, Knife making

Introduction: My name is Madonna Wisozk, I am a attractive, healthy, thoughtful, faithful, open, vivacious, zany person who loves writing and wants to share my knowledge and understanding with you.