Title: | A Computational Tool for Astrochronology |
---|---|
Description: | Routines for astrochronologic testing, astronomical time scale construction, and time series analysis <doi:10.1016/j.earscirev.2018.11.015>. Also included are a range of statistical analysis and modeling routines that are relevant to time scale development and paleoclimate analysis. |
Authors: | Stephen Meyers [aut, cre], Alberto Malinverno [ctb], Linda Hinnov [ctb], Christian Zeeden [ctb], Huaran Liu [ctb], Vincent Moron [ctb], Michel Crucifix [ctb] |
Maintainer: | Stephen Meyers <[email protected]> |
License: | GPL-3 |
Version: | 1.4 |
Built: | 2024-11-17 06:27:39 UTC |
Source: | CRAN |
This software provides routines for astrochronologic testing, astronomical time scale construction, and time series analysis <doi:10.1016/j.earscirev.2018.11.015>. Also included are a range of statistical analysis and modeling routines that are relevant to time scale development and paleoclimate analysis.
Package: | astrochron |
Type: | Package |
Version: | 1.4 |
Date: | 2024-09-17 |
License: | GPL-3 |
Development of the 'astrochron' package is partially supported by the U.S. National Science Foundation and the Heising-Simons Foundation:
Leveraging the Geologic Record to Constrain Solar System Evolution, Earth-Moon Dynamics, Paleoclimate Change and Geological Time (Heising-Simons Foundation Award 2021-2797)
Collaborative Research: Improving the Late Cretaceous-Eocene geomagnetic polarity time scale by integrating the global magnetic anomaly record and astrochronology (U.S. National Science Foundation Award OCE 2051616)
CAREER: Deciphering the Beat of a Timeless Rhythm - The Future of Astrochronology (U.S. National Science Foundation Award EAR 1151438)
Collaborative Research: Evolution of the Climate Continuum - Late Paleogene to Present (U.S. National Science Foundation Award OCE 1003603)
TO CITE THIS PACKAGE IN PUBLICATIONS, PLEASE USE:
Meyers, S.R. (2014). Astrochron: An R Package for Astrochronology. https://cran.r-project.org/package=astrochron
Also cite the original research papers that document the relevant algorithms, as referenced on the help pages for specific functions.
Some examples (including R scripts) demonstrating the application of the astrochron package can be found in Meyers (2019), Ma et al. (2017), and Crampton et al. (2018), among numerous other scientific publications. Please also see examples in the help pages for specific functions.
Stephen Meyers
Maintainer: Stephen Meyers <[email protected]>
J.S. Campton, S.R. Meyers, R.A. Cooper, P.M Sadler, M. Foote, D. Harte, 2018, Pacing of Paleozoic macroevolutionary rates by Milankovitch grand cycles: Proceedings of the National Academy of Sciences, doi:10.1073/pnas.1714342115.
C. Ma, S.R. Meyers, B.B. Sageman, 2017 Theory of chaotic orbital variations confirmed by Cretaceous geological evidence: Nature v.542, 468-470, doi:10.1038/nature21402.
S.R. Meyers, 2019, Cyclostratigraphy and the problem of astrochronologic testing: Earth-Science Reviews v.190, 190-223, doi:10.1016/j.earscirev.2018.11.015.
Calculate geochemical proxy accumulation rates using defined sedimentation rate and dry bulk density. Sedimentation rate and dry bulk density data are piecewise linearly interpolated to data locations, to estimate bulk accumulation rate.
accum(dat,sedrate=NULL,density=NULL,genplot=T,verbose=T)
accum(dat,sedrate=NULL,density=NULL,genplot=T,verbose=T)
dat |
Stratigraphic series containing geochemical proxy data. First column should be location (e.g., depth), second column should be geochemical concentration in weight percent (0-100). |
sedrate |
Sedimentation rate. First column should be location (e.g., depth), second column should be sedimentation rate (cm/ka). Alternatively, if a single value is given, a constant sedimentation rate is applied. |
density |
Dry bulk density. First column should be location (e.g., depth), second column should be dry bulk density (g/cm3/ka). Alternatively, if a single value is given, a constant bulk density is applied. |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
# Generate an example geochemical data set, using a stochastic model ex=ar1(npts=1001) # the first column in 'ex' is depth (m), and we will take the second column to be CaCO3 # rescale second column to range from 0-100% CaCO3 m=100/(max(ex[2])-min(ex[2])) b=100-(m*max(ex[2])) ex[2]= m*ex[2] +b autoPlot(ex) # generate example sedimentation rate history, with a stepwise tripling # from 1m/kyr to 3m/kyr at 500 m sr=ex sr[1:500,2]=1 sr[501:1001,2]=3 autoPlot(sr) # calculate accumulation rates res=accum(dat=ex,sedrate=sr,density=2.65)
# Generate an example geochemical data set, using a stochastic model ex=ar1(npts=1001) # the first column in 'ex' is depth (m), and we will take the second column to be CaCO3 # rescale second column to range from 0-100% CaCO3 m=100/(max(ex[2])-min(ex[2])) b=100-(m*max(ex[2])) ex[2]= m*ex[2] +b autoPlot(ex) # generate example sedimentation rate history, with a stepwise tripling # from 1m/kyr to 3m/kyr at 500 m sr=ex sr[1:500,2]=1 sr[501:1001,2]=3 autoPlot(sr) # calculate accumulation rates res=accum(dat=ex,sedrate=sr,density=2.65)
Anchor a floating astrochronology to a radioisotopic age. The floating astrochronology is centered on a given ('floating') time datum and assigned the 'anchored' age.
anchorTime(dat,time,age,timeDir=1,flipOut=F,genplot=T,verbose=T)
anchorTime(dat,time,age,timeDir=1,flipOut=F,genplot=T,verbose=T)
dat |
Stratigraphic series. First column should be floating time scale, second column should be data value. |
time |
'Floating' time datum to center record on. Units should be ka. |
age |
Radioisotopic age (or othwerwise) for anchoring at floating 'time' datum. Units should be ka. |
timeDir |
Direction of 'floating' time in input record; 1 = elapsed time towards present; 2 = elapsed time away from present |
flipOut |
Flip the output (sort so the ages are presented in decreasing order)? (T or F) |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
Generate AR(1) surrogates. Implement shuffling algorithm of Meyers (2012) if desired.
ar1(npts=1024,dt=1,mean=0,sdev=1,rho=0.9,shuffle=F,nsim=1,genplot=T,verbose=T)
ar1(npts=1024,dt=1,mean=0,sdev=1,rho=0.9,shuffle=F,nsim=1,genplot=T,verbose=T)
npts |
number of time series data points |
dt |
sampling interval |
mean |
mean value for AR1 surrogate series |
sdev |
standard deviation for AR1 surrogate series |
rho |
AR(1) coefficient |
shuffle |
Apply secondary shuffle of Gaussian deviates before AR modeling |
nsim |
Number of AR1 surrogate series to generate |
genplot |
generate summary plots (T or F) |
verbose |
verbose output (T or F) |
These simulations use the random number generator of Matsumoto and Nishimura [1998]. If shuffle = T, the algorithm from Meyers (2012, pg. 11) is applied: (1) two sets of random sequences of the same length are generated, (2) the first random sequence is then sorted, and finally (3) the permutation vector of the sorted sequence is used to reorder the second random number sequence. This is done to guard against potential shortcomings in random number generation that are specific to spectral estimation.
S.R. Meyers, 2012, Seeing red in cyclic stratigraphy: Spectral noise estimation for astrochronology: Paleoceanography, v. 27, PA3328.
Simulate a combined AR(1) + ETP signal, plot spectrum and confidence levels
ar1etp(etpdat=NULL,nsim=100,rho=0.9,wtAR=1,sig=90,tbw=2,padfac=5,ftest=F,fmax=0.1, speed=0.5,pl=2,graphfile=0)
ar1etp(etpdat=NULL,nsim=100,rho=0.9,wtAR=1,sig=90,tbw=2,padfac=5,ftest=F,fmax=0.1, speed=0.5,pl=2,graphfile=0)
etpdat |
Eccentricity, tilt, precession astronmical series. First column = time, second column = ETP. If not entered will use default series from Laskar et al. (2004), spanning 0-1000 kyr. |
nsim |
Number of simulations. |
rho |
AR(1) coefficient for noise modeling. |
wtAR |
Multiplicative factor for AR1 noise (1= eqivalent to ETP variance). If < 0, etp signal will be excluded from the simulations (noise only) |
sig |
Demarcate what confidence level (percent) on plots? |
tbw |
MTM time-bandwidth product. |
padfac |
Pad with zeros to (padfac*npts) points, where npts is the number of data points. |
ftest |
Include MTM harmonic f-test results? (T or F) |
fmax |
Maximum frequency for plotting. |
speed |
Set the amount of time to pause before plotting new graph, in seconds. |
pl |
Plot (1) log frequency-log power or (2) linear frequency-linear power? |
graphfile |
Output a pdf or jpg image of each plot? 0 = no, 1 = pdf, 2 = jpeg. If yes, there will be no output to screen. Individual graphic files will be produced for each simluation, for assembling into a movie. |
Note: Setting wtAR=1 will provide equal variance contributions from the etp model and the ar1 model. More generally, set wtAR to the square root of the desired variance contribution (wtAR=0.5 will generate an AR1 model with variance that is 25% of the etp model). If you would like to exclusively evaluate the noise (no etp), set wtAR < 0.
Note: You may use the function etp to generate eccentricity-tilt-precession models.
Laskar, J., Robutel, P., Joutel, F., Gastineau, M., Correia, A.C.M., Levrard, B., 2004, A long term numerical solution for the insolation quantities of the Earth: Astron. Astrophys., Volume 428, 261-285.
## Not run: # run simulations using the default settings ar1etp() # compare with a second model: # generate etp model spanning 0-2000 ka, with sampling interval of 5 ka. ex1=etp(tmin=0,tmax=2000,dt=5) # run simulations, with rho=-.7, and scaling noise to have 50 ar1etp(etpdat=ex1,rho=0.7,wtAR=sqrt(0.5)) ## End(Not run)
## Not run: # run simulations using the default settings ar1etp() # compare with a second model: # generate etp model spanning 0-2000 ka, with sampling interval of 5 ka. ex1=etp(tmin=0,tmax=2000,dt=5) # run simulations, with rho=-.7, and scaling noise to have 50 ar1etp(etpdat=ex1,rho=0.7,wtAR=sqrt(0.5)) ## End(Not run)
Arcsine transformation of stratigraphic series
arcsinT(dat,genplot=T,verbose=T)
arcsinT(dat,genplot=T,verbose=T)
dat |
Stratigraphic series for arcsine transformation. Input can have any number of columns desired. If two or more columns are input, the first column must be location (e.g., depth), while remaining columns are data values for transformation. |
genplot |
Generate summary plots? (T or F). This is automatically deactivated if more than one variable is transformed. |
verbose |
Verbose output? (T or F) |
demean
, detrend
, divTrend
, logT
, prewhiteAR
, and prewhiteAR1
Generate an autoregressive moving-average time series model
armaGen(npts=1024,dt=1,m=0,std=1,rhos=c(0.9),thetas=c(0),genplot=T,verbose=T)
armaGen(npts=1024,dt=1,m=0,std=1,rhos=c(0.9),thetas=c(0),genplot=T,verbose=T)
npts |
Number of time series data points. |
dt |
Sampling interval. |
m |
Mean value of final time series. |
std |
Standard deviation of final time series. |
rhos |
Vector of AR coefficients for each order. |
thetas |
Vector of MA coefficients for each order. |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
Calculate Average Spectral Misfit with Monte Carlo spectra simulations, as updated in Meyers et al. (2012).
asm(freq,target,fper=NULL,rayleigh,nyquist,sedmin=1,sedmax=5,numsed=50, linLog=1,iter=100000,output=F,genplot=T)
asm(freq,target,fper=NULL,rayleigh,nyquist,sedmin=1,sedmax=5,numsed=50, linLog=1,iter=100000,output=F,genplot=T)
freq |
A vector of candidate astronomical cycles observed in your data spectrum (cycles/m). Maximum allowed is 500. |
target |
A vector of astronomical frequencies to evaluate (1/ka). These must be in order of increasing frequency (e.g., e1,e2,e3,o1,o2,p1,p2). Maximum allowed is 50 frequencies. |
fper |
A vector of uncertainties on each target frequency (1/ka). Values should be from 0-1, representing uncertainty as a percent of each target frequency. The order of the uncertainties must follow that of the target vector. By default, no uncertainty is assigned. |
rayleigh |
Rayleigh frequency (cycles/m). |
nyquist |
Nyquist frequency (cycles/m). |
sedmin |
Minimum sedimentation rate for investigation (cm/ka). |
sedmax |
Maximum sedimentation rate for investigation (cm/ka). |
numsed |
Number of sedimentation rates to investigate in ASM optimization grid. Maximum allowed is 500. |
linLog |
Use linear or logarithmic scaling for sedimentation rate grid spacing? (0=linear, 1=log) |
iter |
Number of Monte Carlo simulations for significance testing. Maximum allowed is 100,000. |
output |
Return output as a new data frame? (T or F) |
genplot |
Generate summary plots? (T or F) |
This function will caculate the Average Spectral Misfit between a data spectrum and astronomical target spectrum, following the approach outlined in Meyers and Sageman (2007), and the improvements of Meyers et al. (2012).
A data frame containing: Sedimentation rate (cm/ka), ASM (cycles/ka), Null hypothesis significance level (0-100 percent), Number of astronomical terms fit.
S.R. Meyers and B.B. Sageman, 2007, Quantification of Deep-Time Orbital Forcing by Average Spectral Misfit: American Journal of Science, v. 307, p. 773-792.
S.R. Meyers, B.B. Sageman and M.A. Arthur, 2012, Obliquity forcing of organic matter accumulation during Oceanic Anoxic Event 2: Paleoceanography, 27, PA3212, doi:10.1029/2012PA002286.
eAsm
, eAsmTrack
, testPrecession
, timeOpt
, and timeOptSim
## These frequencies are from modelA (type '?astrochron' for more information). ## They are for an 8 meter window, centered at 22 meters height. Units are cycles/m . freq <- c(0.1599833,0.5332776,1.5998329,2.6797201,3.2796575,3.8795948,5.5194235,6.5459830) freq <- data.frame(freq) ## Rayleigh frequency in cycles/m rayleigh <- 0.1245274 ## Nyquist frequency in cycles/m nyquist <- 6.66597 ## orbital target in 1/ky. Predicted periods for 94 Ma (see Meyers et al., 2012) target <- c(1/405.47,1/126.98,1/96.91,1/37.66,1/22.42,1/18.33) ## percent uncertainty in orbital target fper=c(0.023,0.046,0.042,0.008,0.035,0.004) asm(freq=freq,target=target,fper=fper,rayleigh=rayleigh,nyquist=nyquist,sedmin=0.5,sedmax=3, numsed=100,linLog=1,iter=100000,output=FALSE)
## These frequencies are from modelA (type '?astrochron' for more information). ## They are for an 8 meter window, centered at 22 meters height. Units are cycles/m . freq <- c(0.1599833,0.5332776,1.5998329,2.6797201,3.2796575,3.8795948,5.5194235,6.5459830) freq <- data.frame(freq) ## Rayleigh frequency in cycles/m rayleigh <- 0.1245274 ## Nyquist frequency in cycles/m nyquist <- 6.66597 ## orbital target in 1/ky. Predicted periods for 94 Ma (see Meyers et al., 2012) target <- c(1/405.47,1/126.98,1/96.91,1/37.66,1/22.42,1/18.33) ## percent uncertainty in orbital target fper=c(0.023,0.046,0.042,0.008,0.035,0.004) asm(freq=freq,target=target,fper=fper,rayleigh=rayleigh,nyquist=nyquist,sedmin=0.5,sedmax=3, numsed=100,linLog=1,iter=100000,output=FALSE)
Automatically plot and smooth specified stratigraphic data, versus location. Data are smoothed with a Gaussian kernel if desired.
autoPlot(dat,cols=NULL,dmin=NULL,dmax=NULL,vertical=T,ydir=NULL,nrows=NULL,plotype=1, smooth=0,xgrid=1,output=F,genplot=T,verbose=T)
autoPlot(dat,cols=NULL,dmin=NULL,dmax=NULL,vertical=T,ydir=NULL,nrows=NULL,plotype=1, smooth=0,xgrid=1,output=F,genplot=T,verbose=T)
dat |
Your data frame; first column should be location identifier (e.g., depth). |
cols |
A vector that identifies the columns to extract (first column automatically extracted). |
dmin |
Minimum depth/height/time for plotting. |
dmax |
Maximum depth/height/time for plotting. |
vertical |
Generate vertical stratigraphic plots? (T or F) If F, will generate horizontal plots. |
ydir |
Direction for stratigraphic axis in plots (depth,height,time). If vertical=T, then -1 results in values increasing downwards, while 1 results in values increasing upwards. If vertical=F, then -1 results in values increasing toward the left, while 1 results in values increasing toward the right. |
nrows |
Number of rows in figure (if vertical = T; otherwise this will be the number of columns). |
plotype |
Type of plot to generate: 1= points and lines, 2 = points, 3 = lines |
smooth |
Width (temporal or spatial dimension) for smoothing with a Gaussian kernel (0 = no smoothing); the Gaussian kernel is scaled so that its quartiles (viewed as probability densities, that is, containing 50 percent of the area) are at +/- 25 percent of this value. |
xgrid |
For kernal smoothing: (1) evaluate on ORIGINAL sample grid, or (2) evaluate on EVENLY SPACED grid covering range. |
output |
Output data frame of smoothed values? (T or F) |
genplot |
Generate summary plots (T or F) |
verbose |
Verbose output (T or F) |
Bandpass filter stratigraphic series using rectangular, Gaussian or tapered cosine (a.k.a. Tukey) window. This function can also be used to notch fiter a record (see examples).
bandpass(dat,padfac=2,flow=NULL,fhigh=NULL,win=0,alpha=3,p=0.25,demean=T, detrend=F,addmean=T,output=1,xmin=0,xmax=Nyq,genplot=T,verbose=T)
bandpass(dat,padfac=2,flow=NULL,fhigh=NULL,win=0,alpha=3,p=0.25,demean=T, detrend=F,addmean=T,output=1,xmin=0,xmax=Nyq,genplot=T,verbose=T)
dat |
Stratigraphic series for bandpass filtering. First column should be location (e.g., depth), second column should be data value. |
padfac |
Pad with zeros to (padfac*npts) points, where npts is the original number of data points. |
flow |
Lowest frequency to bandpass. |
fhigh |
Highest frequency to bandpass. |
win |
Window type for bandpass filter: 0 = rectangular , 1= Gaussian, 2= Cosine-tapered window (a.k.a. Tukey window). |
alpha |
Gaussian window parameter: alpha is 1/stdev, a measure of the width of the Dirichlet kernel. Choose alpha >= 2.5. |
p |
Cosine-tapered (Tukey) window parameter: p is the percent of the data series tapered (choose 0-1). |
demean |
Remove mean from data series? (T or F) |
detrend |
Remove linear trend from data series? (T or F) |
addmean |
Add mean value to bandpass result? (T or F) |
output |
Output: (1) filtered series, (2) bandpass filter window. |
xmin |
Smallest frequency for plotting. |
xmax |
Largest frequency for plotting. |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
bandpassed stratigraphic series.
lowpass
, noKernel
, noLow
, prewhiteAR
, prewhiteAR1
, and taner
# generate example series with periods of 405 ka, 100 ka, 40ka, and 20 ka, plus noise ex=cycles(freqs=c(1/405,1/100,1/40,1/20),end=1000,dt=5,noisevar=.1) # bandpass precession term using cosine-tapered window bandpass_ex <- bandpass(ex,flow=0.045,fhigh=0.055,win=2,p=.4) # notch filter (remove) obliquity term using cosine-tapered window # if you'd like the final notch filtered record to be centered on the mean proxy # value, set addmean=FALSE notch_ex <- bandpass(ex,flow=0.02,fhigh=0.03,win=2,p=.4,addmean=FALSE) notch_ex[2] <- ex[2]-notch_ex[2] pl(2) plot(ex,type="l",main="Eccentricity+Obliquity+Precession") plot(notch_ex,type="l",main="Following application of obliquity notch filter")
# generate example series with periods of 405 ka, 100 ka, 40ka, and 20 ka, plus noise ex=cycles(freqs=c(1/405,1/100,1/40,1/20),end=1000,dt=5,noisevar=.1) # bandpass precession term using cosine-tapered window bandpass_ex <- bandpass(ex,flow=0.045,fhigh=0.055,win=2,p=.4) # notch filter (remove) obliquity term using cosine-tapered window # if you'd like the final notch filtered record to be centered on the mean proxy # value, set addmean=FALSE notch_ex <- bandpass(ex,flow=0.02,fhigh=0.03,win=2,p=.4,addmean=FALSE) notch_ex[2] <- ex[2]-notch_ex[2] pl(2) plot(ex,type="l",main="Eccentricity+Obliquity+Precession") plot(notch_ex,type="l",main="Following application of obliquity notch filter")
Determine the predicted precession and obliquity periods based on Berger et al. (1992). Values are determined by piecewise linear interpolation.
bergerPeriods(age,genplot=T)
bergerPeriods(age,genplot=T)
age |
Age (millions of years before present) |
genplot |
Generate summary plots? (T or F) |
A. Berger, M.F. Loutre, and J. Laskar, 1992, Stability of the Astronomical Frequencies Over the Earth's History for Paleoclimate Studies: Science, v. 255, p. 560-566.
bicoherence: Calculate bispectrum and bicoherence using WOSA method as detailed in Choudhury et al. (2008). Kim and Powers (1979) bicoherence normalization is used, with a conditioning factor to reduce the potential for spurious bicoherence peaks.
bicoherence(dat,overlap=50,segments=8,CF=0,CL=95,padfac=2,demean=T,detrend=T, taper=T,maxF=Nyq,output=0,genplot=T,color=1,id=NULL,logpwr=F,logbis=F, check=T,verbose=T)
bicoherence(dat,overlap=50,segments=8,CF=0,CL=95,padfac=2,demean=T,detrend=T, taper=T,maxF=Nyq,output=0,genplot=T,color=1,id=NULL,logpwr=F,logbis=F, check=T,verbose=T)
dat |
Stratigraphic series to analyze. First column should be location (e.g., depth, time), second column should be data value. |
overlap |
Percent overlap for WOSA segments (use 0-50 percent). |
segments |
Number of segments for WOSA. |
CF |
Conditioning factor for bicoherence estimation (see pg. 70 of Choudhury et al., 2008). When CF=0, this will be automatically estimated as the 75th percentile of the magnitude-squared bicoherence denominator |
CL |
Confidence level to identify with a contour on the plots (0-100). |
padfac |
Pad with zeros to (padfac*npts) points, where npts is the original number of data points per segment. |
demean |
Remove mean from data series? (T or F) |
detrend |
Remove linear trend from data series? (T or F) |
taper |
Apply Hanning taper? (T or F) |
maxF |
Maximum frequency for analysis/plotting. |
output |
Return output as new data frame? 0 = none, 1 = magnitude-squared bispectrum, 2 = magnitude-squared bicoherence, 3 = magnitude-squared bicoherence confidence levels, 4 = everything. |
genplot |
Generate summary plots? (T or F) |
color |
Use (1) grayscale or (2) viridis color scale for 3D plots? |
id |
A vector listing frequencies to identify on the plots as diagonal lines. |
logpwr |
Use a log scale for power spectrum? (T or F) |
logbis |
Use a log scale for bispectrum? (T or F) |
check |
Conduct compliance checks before processing? (T or F) In general this should be activated; the option is included for Monte Carlo simulation. |
verbose |
Verbose output? (T or F) |
This function accompanies the publication Sullivan et al. (in press 2023, PNAS): "Bicoherence is a higher-order statistic, which quantifies coupling of individual frequencies (as combination and difference tones). For three frequencies, f1, f2 and f3, high bicoherence indicates that f1 + f2 = f3, with the additional property that their phases are also coupled in the data series. We employ the bicoherence approach of Choudhury, Shah and Thornhill (2008), which uses Welch Overlapping Spectral Analysis (WOSA), as this method includes improvements to the standard approach that reduce the potential for spurious bicoherence peaks. Note that reliable bicoherence estimates require a substantial increase in bandwidth resolution ("smoothing")".
Choudhury, A.A.S., Shah, S.L., and Thornhill, N.F. (2008), Diagnosis of Process Nonlinearities and Valve Stiction: Data Driven Approaches: Springer, 284 pp.
Kim, Y.C., and Powers, E.J. (1979), Digital Bispectral Analysis and Its Applications to Nonlinear Wave Interactions: IEEE Transactions on Plasma Science, v. PS-7, 120-131.
Sullivan, N.B., Meyers, S.R., Levy, R.H., McKay, R.M., Golledge, N.R., Cortese, G. (in press 2023), Millennial-scale variability of the Antarctic Ice Sheet during the Early Miocene: Proceedings of the National Academy of Sciences.
Welch, P.D. (1967), The use of Fast Fourier Tranform for the estimation of power spectra: A method based on time averaging over short, modified periodograms: IEEE Transactions on Audio and Electroacoustics, AU-5 (2): 70-73.
## Not run: # Generate an example quadratic phase-coupled signal as in Choudhury et al. (2008, pg. 79) n = rnorm(500) t=1:500 signal = sin(2*pi*0.12*t + pi/3) + sin(2*pi*0.18*t + pi/12) + sin(2*pi*0.3*t + 5*pi/12) + n ex=data.frame(cbind(t,signal)) bicoherence(ex) ## End(Not run)
## Not run: # Generate an example quadratic phase-coupled signal as in Choudhury et al. (2008, pg. 79) n = rnorm(500) t=1:500 signal = sin(2*pi*0.12*t + pi/3) + sin(2*pi*0.18*t + pi/12) + sin(2*pi*0.3*t + 5*pi/12) + n ex=data.frame(cbind(t,signal)) bicoherence(ex) ## End(Not run)
'bioturb' is a function for simulating the bioturbed time series when bioturbation is modeled as a diffusive process. It implements the methodology outlined in Liu et al. (2021), which builds on the approaches of (Guinasso and Schink, 1975), Goreau (1977), and Goreau (1980). Given the bioturbation parameters, an impulse response function is first calculated using function 'impulseResponse'. This function is then convolved with the input time series (true signal) to output the bioturbed time series. Note that the input true signal 'dat' and impulse response function are interpolated to the same resolution before convolution.
bioturb(dat, G, ML, v, output=1, genplot=TRUE, verbose=TRUE)
bioturb(dat, G, ML, v, output=1, genplot=TRUE, verbose=TRUE)
dat |
Stratigraphic series to be bioturbated. First column should be age (kyr), second column should be data value. |
G |
Control parameter in Guinasso and Schinck, 1975. G = D/ML/v |
ML |
Mix layer depth (cm) |
v |
Sedimentation rate (cm/kyr) |
output |
Which results would you like to return to the console? (0) no output; (1) return bioturbated series; (2) return impulse response |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
Guinasso, N.L. and Schinck, D.R., 1975, Quantitative estimates of biological mixing rates in abyssal sediments, J. Geophys. Res., 80, 3032-3043.
Goreau, T.J., 1977, Quantitative effects of sediment mixing on stratigraphy and biogeochemistry: a signal theory approach, Nature, 256, 730-732.
Goreau, T.J., 1980, Frequency sensitivity of the deep-sea climatic record, Nature, 287, 620-622.
Liu, H., Meyers, S.R., and Marcott, S.A., 2021, Unmixing dee-sea paleoclimate records: A study on bioturbation effects through convolution and deconvolution, Earth and Planetary Science Letters, 564, 116883.
# as a test series, use the three dominant precession terms from Berger et al. (1992) ex1=cycles() # mix it res1 <- bioturb(ex1, G=4, ML=10, v=1, genplot = TRUE) # un-mix it res2=unbioturb(res1, G=4, ML=10, v=1, genplot = TRUE) pl() plot(ex1,type="l",main="black=signal, blue=bioturbated, red=unbioturbated",lwd=3) lines(res2,col="red") lines(res1,col="blue")
# as a test series, use the three dominant precession terms from Berger et al. (1992) ex1=cycles() # mix it res1 <- bioturb(ex1, G=4, ML=10, v=1, genplot = TRUE) # un-mix it res2=unbioturb(res1, G=4, ML=10, v=1, genplot = TRUE) pl() plot(ex1,type="l",main="black=signal, blue=bioturbated, red=unbioturbated",lwd=3) lines(res2,col="red") lines(res1,col="blue")
Calculate eccentricity, obliquity and precession periods in ka, given g, s and k in arcsec/yr.
calcPeriods(g,s=NULL,k,output=1)
calcPeriods(g,s=NULL,k,output=1)
g |
Required Data frame or matrix with columns representing the fundamental frequencies: g1, g2, g3, g4, g5. Frequencies must be in arcsec/yr. |
s |
Optional data frame or matrix with columns representing the fundamental frequencies: s1, s2, s3, s4, s5, s6. Frequencies must be in arcsec/yr. This is only required if you want to calculate obliquity periods. |
k |
Required data frame or vector with precession constant (frequency). Frequencies must be in arcsec/yr. |
output |
(1) return results as data frame, (2) return results as a numeric vector. |
# calculate eccentricity and precession periods for one set of g's and k gVal= c(5.579378,7.456665,17.366595,17.910194,4.257564) kVal= 50.475838 calcPeriods(g=gVal, k=kVal) # calculate eccentricity and precession periods for three sets of g's and k gVal= matrix(c(5.579378,7.456665,17.366595,17.910194,4.257564,5.494302,7.452619, 17.480760,18.348310,4.257451,5.531285,7.456848,17.320480,17.912240,4.257456), nrow=3,ncol=5,byrow=TRUE) kVal= c(50.475838,51.280910,85.790450) calcPeriods(g=gVal, k=kVal)
# calculate eccentricity and precession periods for one set of g's and k gVal= c(5.579378,7.456665,17.366595,17.910194,4.257564) kVal= 50.475838 calcPeriods(g=gVal, k=kVal) # calculate eccentricity and precession periods for three sets of g's and k gVal= matrix(c(5.579378,7.456665,17.366595,17.910194,4.257564,5.494302,7.452619, 17.480760,18.348310,4.257451,5.531285,7.456848,17.320480,17.912240,4.257456), nrow=3,ncol=5,byrow=TRUE) kVal= c(50.475838,51.280910,85.790450) calcPeriods(g=gVal, k=kVal)
Bind two vectors together and return result as a data frame. Alternatively, extract specified columns from a data frame, bind them together, and return result as a data frame.
cb(a,b)
cb(a,b)
a |
first input vector OR a data frame with >1 column. |
b |
second input vector OR if a is a data frame with > 1 column, a list of columns to bind. |
# example dataset x<-rnorm(100) dim(x)<-c(10,10) x<-data.frame(x) # bind two columns cb(x[1],x[5]) # bind five columns cb(x,c(1,2,4,7,9))
# example dataset x<-rnorm(100) dim(x)<-c(10,10) x<-data.frame(x) # bind two columns cb(x[1],x[5]) # bind five columns cb(x,c(1,2,4,7,9))
Create non-linear response by clipping stratigraphic series below a threshold value. Alternatively, mute response below a threshold value using a contant divisor. Both approaches will enhance power in modulator (e.g., eccentricity) and diminish power the carrier (e.g., precession).
clipIt(dat,thresh=NULL,clipval=NULL,clipdiv=NULL,genplot=T,verbose=T)
clipIt(dat,thresh=NULL,clipval=NULL,clipdiv=NULL,genplot=T,verbose=T)
dat |
Stratigraphic series. First column should be location (e.g., depth), second column should be data value. |
thresh |
Clip below what theshold value? By default will clip at mean value. |
clipval |
What number should be assigned to the clipped values? By default, the value of thresh is used. |
clipdiv |
Clip using what divisor? A typical value is 2. By default, clipdiv is unity. |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
Adjust spectrum confidence levels for multiple comparisons, using the Bonferroni correction
confAdjust(spec,npts,dt,tbw=3,ntap=5,flow=NULL,fhigh=NULL,output=T, xmin=df,xmax=NULL,pl=1,genplot=T,verbose=T)
confAdjust(spec,npts,dt,tbw=3,ntap=5,flow=NULL,fhigh=NULL,output=T, xmin=df,xmax=NULL,pl=1,genplot=T,verbose=T)
spec |
A data frame with three columns: frequency, power, background power. If more than 3 columns are input, the results are assumed to come from periodogram, mtm, mtmML96, lowspec or mtmPL. |
npts |
Number of points in stratigraphic series. |
dt |
Sampling interval of stratigraphic series. |
tbw |
MTM time-bandwidth product. |
ntap |
Number of DPSS tapers to use. |
flow |
Vector of lower bounds for each frequency band of interest. Order must match fhigh. |
fhigh |
Vector of upper bounds for each frequency band of interest. Order must match flow. |
output |
Output data frame? (T or F) |
xmin |
Smallest frequency for plotting. |
xmax |
Largest frequency for plotting. |
pl |
Plotting option (1-4): 1=linear frequency & log power, 2=log frequency & power, 3=linear frequency & power, 4=log frequency & linear power. |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
Multiple testing is a common problem in the evaluation of power spectrum peaks (Vaughan et al., 2011; Crampton et al., PNAS). To address the issue of multiple testing, a range of approaches have been advocated. This function will conduct an assessment using the Bonferroni correction, which is the simplest, and also the most conservative, of the common approaches (it is overly pessimistic).
If one is exclusively concerned with particular frequency bands a priori (e.g., those associated with Milankovitch cycles), the statistical power of the method can be improved by restricting the analysis to those frequency bands (use options 'flow' and 'fhigh').
Application of multiple testing corrections does not guarantee that the spectral background is appropriate. To address this issue, carefully examine the fit of the spectral background, and also conduct simulations with the function testBackground.
J.S. Campton, S.R. Meyers, R.A. Cooper, P.M Sadler, M. Foote, D. Harte, 2018, Pacing of Paleozoic macroevolutionary rates by Milankovitch grand cycles: Proceedings of the National Academy of Sciences, doi:10.1073/pnas.1714342115.
S. Vaughan, R.J. Bailey, and D.G. Smith, 2011, Detecting cycles in stratigraphic data: Spectral analysis in the presence of red noise. Paleoceanography 26, PA4211, doi:10.1029/2011PA002195.
testBackground
,multiTest
, lowspec
, and periodogram
# generate example series with periods of 400 ka, 100 ka, 40 ka and 20 ka ex = cycles(freqs=c(1/400,1/100,1/40,1/20),start=1,end=1000,dt=5) # add AR1 noise noise = ar1(npts=200,dt=5,sd=.5) ex[2] = ex[2] + noise[2] # first, let's use mtm with conventional AR1 background spec=mtm(ex,padfac=1,ar1=TRUE,output=1) # when blindly prospecting for cycles, it is necessary to consider all of the # observed frequencies in the test confAdjust(spec,npts=200,dt=5,tbw=3,ntap=5,output=FALSE) # if, a priori, you are only concerned with the Milankovitch frequency bands, # restrict your analysis to those bands (as constrained by available sedimentation # rate estimates and the frequency resolution of the spectrum). in the example below, # the mtm bandwidth resolution is employed to search frequencies nearby the # Milankovitch-target periods. flow=c((1/400)-0.003,(1/100)-0.003,(1/41)-0.003,(1/20)-0.003) fhigh=c((1/400)+0.003,(1/100)+0.003,(1/41)+0.003,(1/20)+0.003) confAdjust(spec,npts=200,dt=5,tbw=3,ntap=5,flow=flow,fhigh=fhigh,output=FALSE) # now try with the lowspec method. this uses prewhitening, so it has one less data point. spec=lowspec(ex,padfac=1,output=1) flow=c((1/400)-0.003015075,(1/100)-0.003015075,(1/41)-0.003015075,(1/20)-0.003015075) fhigh=c((1/400)+0.003015075,(1/100)+0.003015075,(1/41)+0.003015075,(1/20)+0.003015075) confAdjust(spec,npts=199,dt=5,tbw=3,ntap=5,flow=flow,fhigh=fhigh,output=FALSE) # for comparison... confAdjust(spec,npts=199,dt=5,tbw=3,ntap=5,output=FALSE)
# generate example series with periods of 400 ka, 100 ka, 40 ka and 20 ka ex = cycles(freqs=c(1/400,1/100,1/40,1/20),start=1,end=1000,dt=5) # add AR1 noise noise = ar1(npts=200,dt=5,sd=.5) ex[2] = ex[2] + noise[2] # first, let's use mtm with conventional AR1 background spec=mtm(ex,padfac=1,ar1=TRUE,output=1) # when blindly prospecting for cycles, it is necessary to consider all of the # observed frequencies in the test confAdjust(spec,npts=200,dt=5,tbw=3,ntap=5,output=FALSE) # if, a priori, you are only concerned with the Milankovitch frequency bands, # restrict your analysis to those bands (as constrained by available sedimentation # rate estimates and the frequency resolution of the spectrum). in the example below, # the mtm bandwidth resolution is employed to search frequencies nearby the # Milankovitch-target periods. flow=c((1/400)-0.003,(1/100)-0.003,(1/41)-0.003,(1/20)-0.003) fhigh=c((1/400)+0.003,(1/100)+0.003,(1/41)+0.003,(1/20)+0.003) confAdjust(spec,npts=200,dt=5,tbw=3,ntap=5,flow=flow,fhigh=fhigh,output=FALSE) # now try with the lowspec method. this uses prewhitening, so it has one less data point. spec=lowspec(ex,padfac=1,output=1) flow=c((1/400)-0.003015075,(1/100)-0.003015075,(1/41)-0.003015075,(1/20)-0.003015075) fhigh=c((1/400)+0.003015075,(1/100)+0.003015075,(1/41)+0.003015075,(1/20)+0.003015075) confAdjust(spec,npts=199,dt=5,tbw=3,ntap=5,flow=flow,fhigh=fhigh,output=FALSE) # for comparison... confAdjust(spec,npts=199,dt=5,tbw=3,ntap=5,output=FALSE)
Apply a constant sedimentation rate model to transform a spatial series to temporal series.
constantSedrate(dat,sedrate,begin=0,timeDir=1,genplot=T,verbose=T)
constantSedrate(dat,sedrate,begin=0,timeDir=1,genplot=T,verbose=T)
dat |
Stratigraphic series. First column should be location (e.g., depth), second column should be data value. |
sedrate |
Sedimentation rate, in same spatial units as dat. |
begin |
Time value to assign to first datum. |
timeDir |
Direction of floating time in tuned record: 1 = elapsed time increases with depth/height; -1 = elapsed time decreases with depth/height) |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
Convolution through Fast Fourier Transform
conv_fft(x, y, index, dt)
conv_fft(x, y, index, dt)
x |
Input signal that needs to be convolved |
y |
Green's function; impulse response function |
index |
index in the impulse response function that corresponds to the deposition time |
dt |
time resolution for the input series |
Function 'conv_fft' is used by function 'bioturb'. x and y do not need to be of the same length.
z Convolved output series. length(z) = length(x)
Apply a "percent-tapered" cosine taper (a.k.a. Tukey window) to a stratigraphic series.
cosTaper(dat,p=.25,rms=T,demean=T,detrend=F,genplot=T,verbose=T)
cosTaper(dat,p=.25,rms=T,demean=T,detrend=F,genplot=T,verbose=T)
dat |
Stratigraphic series for tapering. First column should be location (e.g., depth), second column should be data value. If no data is identified, will output a 256 point taper to evaluate the spectral properties of the window. |
p |
Cosine-tapered window parameter: p is the percent of the data series tapered (choose 0-1). When p=1, this is equivalent to a Hann taper. |
rms |
Normalize taper to RMS=1 to preserve power for white process? (T or F) |
demean |
Remove mean from data series? (T or F) |
detrend |
Remove linear trend from data series? (T or F) |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
dpssTaper
, gausTaper
, and hannTaper
Make a time series with specified harmonic components and noise
cycles(freqs=NULL,phase=NULL,amp=NULL,start=0,end=499,dt=1,noisevar=0,genplot=T, verbose=T)
cycles(freqs=NULL,phase=NULL,amp=NULL,start=0,end=499,dt=1,noisevar=0,genplot=T, verbose=T)
freqs |
Vector with frequencies to model ('linear' frequencies). |
phase |
Vector with phases for each frequency (phase in radians). Phases are subtracted. |
amp |
Vector with amplitudes for each frequency. |
start |
First time/depth/height for output. |
end |
Last time/depth/height for output. |
dt |
Sampling interval. |
noisevar |
Variance of additive Gaussian noise. |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
modeled time series.
## test signal on pg 38 of Choudhury, Shah, and Thornhill (2008) freqs=c(0.12,0.18,0.30,0.42) phase=c(-pi/3,-pi/12,-pi/4,-3*pi/8) amp=c(1,1,1,1) cycles(freqs,phase,amp,start=0,end=4095,dt=1,noisevar=0.2)
## test signal on pg 38 of Choudhury, Shah, and Thornhill (2008) freqs=c(0.12,0.18,0.30,0.42) phase=c(-pi/3,-pi/12,-pi/4,-3*pi/8) amp=c(1,1,1,1) cycles(freqs,phase,amp,start=0,end=4095,dt=1,noisevar=0.2)
Wiener Deconvolution through Fast Fourier Transform.
deconv(x, y, index, dt, pt = 0.2, wiener = TRUE)
deconv(x, y, index, dt, pt = 0.2, wiener = TRUE)
x |
Time series that needs to be deconvolved. |
y |
Green function/Impulse response function. |
index |
index in the impulse response function that corresponds to the deposition time. |
dt |
time resolution for the input series. |
pt |
Cosine-tapered window parameter: pt is the percent of the data series tapered (choose 0-1). When pt=1, this is equivalent to a Hann taper. |
wiener |
Apply Wiener filter? (T or F) |
function 'deconv' is used by function 'unbioturb'. A cosine taper is applied to remove edge effects. The signal-to-noise ratio is chosen to be 0.05, and gamma is also chosen to be 0.05. x and y do not need to be of the same length. For additional information see Liu et al. (2021)
z deconvolved/un-bioturbed series. length(z) = length(x)
Liu, H., Meyers, S.R., and Marcott, S.A., 2021, Unmixing dee-sea paleoclimate records: A study on bioturbation effects through convolution and deconvolution, Earth and Planetary Science Letters, 564, 116883.
Interactively delete points in x,y plot.
delPts(dat,del=NULL,cols=c(1,2),ptsize=1,xmin=NULL,xmax=NULL,ymin=NULL,ymax=NULL, plotype=1,genplot=T,verbose=T)
delPts(dat,del=NULL,cols=c(1,2),ptsize=1,xmin=NULL,xmax=NULL,ymin=NULL,ymax=NULL, plotype=1,genplot=T,verbose=T)
dat |
Data frame containing stratigraphic variable(s) of interest. Any number of columns permitted. |
del |
A vector of indices indicating points to delete. If specified, the interactive plot is disabled. |
cols |
If you are using the graphical interface, which columns would you like to plot? (default = 1 & 2). |
ptsize |
Size of plotted points. |
xmin |
Minimum x-value (column 1) to plot |
xmax |
Maximum x-value (column 1) to plot |
ymin |
Minimum y-value (column 2) to plot |
ymax |
Maximum y-value (column 2) to plot |
plotype |
Type of plot to generate: 1= points and lines, 2 = points, 3 = lines |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
Remove mean value from stratigraphic series
demean(dat,genplot=T,verbose=T)
demean(dat,genplot=T,verbose=T)
dat |
Stratigraphic series for mean removal. First column should be location (e.g., depth), second column should be data value. |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
arcsinT
, detrend
, divTrend
, logT
, prewhiteAR
, and prewhiteAR1
Remove linear trend from stratigraphic series
detrend(dat,output=1,genplot=T,verbose=T)
detrend(dat,output=1,genplot=T,verbose=T)
dat |
Stratigraphic series for linear detrending. First column should be location (e.g., depth), second column should be data value. |
output |
1= output detrended signal; 2= output linear trend |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
arcsinT
, demean
, divTrend
, logT
, prewhiteAR
, and prewhiteAR1
Model differential accumulation. The input variable (e.g., insolation, proxy value) is rescaled to sedimentation rate curve varying from sedmin to sedmax. Input series must be evenly sampled in time.
diffAccum(dat,sedmin=0.01,sedmax=0.02,dir=1,genplot=T,verbose=T)
diffAccum(dat,sedmin=0.01,sedmax=0.02,dir=1,genplot=T,verbose=T)
dat |
Model input series with two columns. First column must be time in ka, second column should be data value. Data series must be evenly sampled in time. |
sedmin |
Minimum sedimentation rate (m/ka) |
sedmax |
Maximum sedimentation rate (m/ka) |
dir |
1=peaks have higher accumulation rate, -1=troughs have higher accumulation rate |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
# generate model with one 20 ka cycle ex <- cycles(1/20) diffAccum(ex)
# generate model with one 20 ka cycle ex <- cycles(1/20) diffAccum(ex)
Divide data series value by linear trend observed in stratigraphic series
divTrend(dat,genplot=T,verbose=T)
divTrend(dat,genplot=T,verbose=T)
dat |
Stratigraphic series for div-trending. First column should be location (e.g., depth), second column should be data value. |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
arcsinT
, demean
, detrend
, logT
, prewhiteAR
, and prewhiteAR1
Apply a single Discrete Prolate Spheroidal Sequence (DPSS) taper to a stratigraphic series
dpssTaper(dat,tbw=1,num=1,rms=T,demean=T,detrend=F,genplot=T,verbose=T)
dpssTaper(dat,tbw=1,num=1,rms=T,demean=T,detrend=F,genplot=T,verbose=T)
dat |
Stratigraphic series for tapering. First column should be location (e.g., depth), second column should be data value. If no data is identified, will output a 256 point taper to evaluate the spectral properties of the window. |
tbw |
Time-bandwidth product for the DPSS |
num |
Which one of the DPSS would you like to use? |
rms |
Normalize taper to RMS=1 to preserve power for white process? (T or F) |
demean |
Remove mean from data series? (T or F) |
detrend |
Remove linear trend from data series? (T or F) |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
cosTaper
, gausTaper
, and hannTaper
Calculate Evolutive Average Spectral Misfit with Monte Carlo spectra simulations, as updated in Meyers et al. (2012).
eAsm(spec,siglevel=0.9,target,fper=NULL,rayleigh,nyquist,sedmin=1,sedmax=5, numsed=50,linLog=1,iter=100000,ydir=1,palette=2,output=4,genplot=F)
eAsm(spec,siglevel=0.9,target,fper=NULL,rayleigh,nyquist,sedmin=1,sedmax=5, numsed=50,linLog=1,iter=100000,ydir=1,palette=2,output=4,genplot=F)
spec |
Time-frequency spectral results to evaluate. Must have the following format: column 1=frequency; remaining columns (2 to n)=probability; titles for columns 2 to n must be the location (depth or height). Note that this format is ouput by function eha. |
siglevel |
Threshold level for filtering peaks. |
target |
A vector of astronomical frequencies to evaluate (1/ka). These must be in order of increasing frequency (e.g., e1,e2,e3,o1,o2,p1,p2). Maximum allowed is 50 frequencies. |
fper |
A vector of uncertainties on each target frequency (1/ka). Values should be from 0-1, representing uncertainty as a percent of each target frequency. The order of the uncertainties must follow that of the target vector. By default, no uncertainty is assigned. |
rayleigh |
Rayleigh frequency (cycles/m). |
nyquist |
Nyquist frequency (cycles/m). |
sedmin |
Minimum sedimentation rate for investigation (cm/ka). |
sedmax |
Maximum sedimentation rate for investigation (cm/ka). |
numsed |
Number of sedimentation rates to investigate in ASM optimization grid. Maximum allowed is 500. |
linLog |
Use linear or logarithmic scaling for sedimentation rate grid spacing? (0=linear, 1=log) |
iter |
Number of Monte Carlo simulations for significance testing. Maximum allowed is 100,000. |
ydir |
Direction for y-axis in plots (depth or height). -1 = values increase downwards (slower plotting!), 1 = values increase upwards. |
palette |
What color palette would you like to use? (1) rainbow, (2) viridis |
output |
Return output as a new data frame? (0 = nothing, 1 = Ho-SL, 2 = ASM, 3 = # astronomical terms, 4 = everything) |
genplot |
Generate summary plots? (T or F) |
Please see function asm for details.
S.R. Meyers and B.B. Sageman, 2007, Quantification of Deep-Time Orbital Forcing by Average Spectral Misfit: American Journal of Science, v. 307, p. 773-792.
S.R. Meyers, 2012, Seeing Red in Cyclic Stratigraphy: Spectral Noise Estimation for Astrochronology: Paleoceanography, 27, PA3228, doi:10.1029/2012PA002307.
S.R. Meyers, B.B. Sageman and M.A. Arthur, 2012, Obliquity forcing of organic matter accumulation during Oceanic Anoxic Event 2: Paleoceanography, 27, PA3212, doi:10.1029/2012PA002286.
asm
, eAsmTrack
, eha
, testPrecession
, timeOpt
, and timeOptSim
## Not run: # use modelA as an example data(modelA) # interpolate to even sampling interval modelAInterp=linterp(modelA) # perform EHA analysis, save harmonic F-test confidence level results to 'spec' spec=eha(modelAInterp,win=8,step=2,pad=1000,output=4) # perform Evolutive Average Spectral Misfit analysis, save results to 'res' res=eAsm(spec,target=c(1/405.47,1/126.98,1/96.91,1/37.66,1/22.42,1/18.33),rayleigh=0.1245274, nyquist=6.66597,sedmin=0.5,sedmax=3,numsed=100,siglevel=0.8,iter=10000,output=4) # identify minimum Ho-SL in each record and plot pl(1) eAsmTrack(res[1],threshold=0.05) # extract Ho-SL result at 18.23 m HoSL18.23=extract(res[1],get=18.23,pl=1) # extract ASM result at 18.23 m asm18.23=extract(res[2],get=18.23,pl=0) ## End(Not run)
## Not run: # use modelA as an example data(modelA) # interpolate to even sampling interval modelAInterp=linterp(modelA) # perform EHA analysis, save harmonic F-test confidence level results to 'spec' spec=eha(modelAInterp,win=8,step=2,pad=1000,output=4) # perform Evolutive Average Spectral Misfit analysis, save results to 'res' res=eAsm(spec,target=c(1/405.47,1/126.98,1/96.91,1/37.66,1/22.42,1/18.33),rayleigh=0.1245274, nyquist=6.66597,sedmin=0.5,sedmax=3,numsed=100,siglevel=0.8,iter=10000,output=4) # identify minimum Ho-SL in each record and plot pl(1) eAsmTrack(res[1],threshold=0.05) # extract Ho-SL result at 18.23 m HoSL18.23=extract(res[1],get=18.23,pl=1) # extract ASM result at 18.23 m asm18.23=extract(res[2],get=18.23,pl=0) ## End(Not run)
Track ASM null hypothesis significance level minima in eASM results.
eAsmTrack(res,threshold=.5,ydir=-1,genplot=T,verbose=T)
eAsmTrack(res,threshold=.5,ydir=-1,genplot=T,verbose=T)
res |
eAsm results. Must have the following format: column 1=sedimentation rate; remaining columns (2 to n)=Ho-SL; titles for columns 2 to n must be the location (depth or height). Note that this format is ouput by function eAsm. |
threshold |
Threshold Ho-SL value for analysis and plotting. |
ydir |
Direction for y-axis in plots (depth or height). -1 = values increase downwards (slower plotting!), 1 = values increase upwards. |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
Please see function eAsm for details.
Evolutive Harmonic Analysis & Evolutive Power Spectral Analysis using the Thomson multitaper method (Thomson, 1982)
eha(dat,tbw=2,pad,fmin,fmax,step,win,demean=T,detrend=T,siglevel=0.90, sigID=F,ydir=1,output=0,pl=1,palette=6,centerZero=T,ncolors=100,xlab,ylab, genplot=2,verbose=T)
eha(dat,tbw=2,pad,fmin,fmax,step,win,demean=T,detrend=T,siglevel=0.90, sigID=F,ydir=1,output=0,pl=1,palette=6,centerZero=T,ncolors=100,xlab,ylab, genplot=2,verbose=T)
dat |
Stratigraphic series to analyze. First column should be location (e.g., depth), second column should be data value. |
tbw |
MTM time-bandwidth product (<=10) |
pad |
Pad with zeros to how many points? Must not factor into a prime number >23. Maximum number of points is 200,000. |
fmin |
Smallest frequency for analysis and plotting. |
fmax |
Largest frequency for analysis and plotting. |
step |
Step size for EHA window, in units of space or time. |
win |
Window size for EHA, in units of space or time. |
demean |
Remove mean from data series? (T or F) |
detrend |
Remove linear trend from data series? (T or F) |
siglevel |
Significance level for peak identification/filtering (0-1) |
sigID |
Identify signficant frequencies on power, amplitude, and probabilty plots. Only applies when one spectrum is calculated. (T or F) |
ydir |
Direction for y-axis in EHA plots (depth,height,time). -1 = values increase downwards (slower plotting), 1 = values increase upwards |
output |
Return output as new data frame? 0=no; 1=all results; 2=power; 3=amplitude; 4=probability; 5=significant frequencies (only for one spectrum); 6=significant frequencies and their probabilities (only for one spectrum) |
pl |
Plot logarithm of spectral power (1) or linear spectral power (2)? |
palette |
What color palette would you like to use? (1) rainbow, (2) grayscale, (3) blue, (4) red, (5) blue-white-red (if values are negative and positive, white is centered on zero), (6) viridis |
centerZero |
Center color scale on zero (use an equal number of postive and negative color divisions)? (T or F) |
ncolors |
Number of colors steps to use in palette. |
xlab |
Label for x-axis. Default = "Frequency" |
ylab |
Label for y-axis. Default = "Location" |
genplot |
Plotting options. 0= no plots; 1= power, amplitude, f-test, probability; 2=data series, power, amplitude, probability; 3= data series, power, normalized amplitude (maximum in each window normalized to unity), normalized amplitude filtered at specified siglevel; 4= data series, normalized power (maximum in each window normalized to unity), normalized amplitude (maximum in each window normalized to unity), normalized amplitude filtered at specified siglevel |
verbose |
Verbose output? (T or F) |
The power spectrum normalization approach applied here divides the Fourier coefficients by the number of points (npts) in the stratigraphic series, which is equivalent to dividing the power by (npts*npts). The (npts*npts) normalization has the convenient property whereby – for an unpadded series – the sum of the power in the positive frequencies is equivalent to half of variance; the other half of the variance is in the negative frequencies.
Note that the 'spec.mtm' function in package 'multitaper' (Rahim et al., 2014) is used for MTM spectrum estimation.
Thomson, D. J., 1982, Spectrum estimation and harmonic analysis, Proc. IEEE, 70, 1055-1096, doi:10.1109/PROC.1982.12433.
extract
, lowspec
, mtmAR
, mtmML96
, periodogram
, trackFreq
and traceFreq
## as an example, evaluate the modelA data(modelA) ## interpolate to even sampling interval of 0.075 m ex1=linterp(modelA, dt=0.075) ## perform EHA with a time-bandwidth parameter of 2, using an 7.95 meter window, 0.15 m step, ## and pad to 1000 points ## set labels for plots (optional) eha(ex1,tbw=2,win=7.95,step=0.15,pad=1000,xlab="Frequency (cycles/m)",ylab="Height (m)") ## for comparison generate spectrum for entire record, using time-bandwidth parameter of 3, and ## pad to 5000 points ## start by making a new plot pl(1) eha(ex1,tbw=3,win=38,pad=5000,xlab="Frequency (cycles/m)")
## as an example, evaluate the modelA data(modelA) ## interpolate to even sampling interval of 0.075 m ex1=linterp(modelA, dt=0.075) ## perform EHA with a time-bandwidth parameter of 2, using an 7.95 meter window, 0.15 m step, ## and pad to 1000 points ## set labels for plots (optional) eha(ex1,tbw=2,win=7.95,step=0.15,pad=1000,xlab="Frequency (cycles/m)",ylab="Height (m)") ## for comparison generate spectrum for entire record, using time-bandwidth parameter of 3, and ## pad to 5000 points ## start by making a new plot pl(1) eha(ex1,tbw=3,win=38,pad=5000,xlab="Frequency (cycles/m)")
eTimeOpt: Evolutive implementation of TimeOpt (Meyers, 2015; Meyers, 2019).
eTimeOpt(dat,win=dt*100,step=dt*10,sedmin=0.5,sedmax=5,numsed=100,linLog=1, limit=T,fit=1,fitModPwr=T,flow=NULL,fhigh=NULL,roll=NULL,targetE=NULL,targetP=NULL, detrend=T,ydir=1,palette=6,ncolors=100,output=1,genplot=T,check=T,verbose=1)
eTimeOpt(dat,win=dt*100,step=dt*10,sedmin=0.5,sedmax=5,numsed=100,linLog=1, limit=T,fit=1,fitModPwr=T,flow=NULL,fhigh=NULL,roll=NULL,targetE=NULL,targetP=NULL, detrend=T,ydir=1,palette=6,ncolors=100,output=1,genplot=T,check=T,verbose=1)
dat |
Stratigraphic series for astrochronologic assessment. First column should be depth or height (in meters), second column should be data value. |
win |
Window size, in meters. |
step |
Step size for moving window, in meters. |
sedmin |
Minimum sedimentation rate for investigation (cm/ka). |
sedmax |
Maximum sedimentation rate for investigation (cm/ka). |
numsed |
Number of sedimentation rates to investigate in optimization grid. |
linLog |
Use linear or logarithmic scaling for sedimentation rate grid spacing? (0=linear, 1=log; default value is 1) |
limit |
Limit evaluated sedimentation rates to region in which full target signal can be recovered? (T or F). |
fit |
Test for (1) precession amplitude modulation or (2) short eccentricity amplitude modulation? |
fitModPwr |
Include the modulation periods in the spectral fit? (T or F) |
flow |
Low frequency cut-off for Taner bandpass (half power point; in cycles/ka) |
fhigh |
High frequency cut-off for Taner bandpass (half power point; in cycles/ka) |
roll |
Taner filter roll-off rate, in dB/octave. |
targetE |
A vector of eccentricity periods to evaluate (in ka). These must be in order of decreasing period, with a first value of 405 ka. |
targetP |
A vector of precession periods to evaluate (in ka). These must be in order of decreasing period. |
detrend |
Remove linear trend from data series? (T or F) |
ydir |
Direction for y-axis in plots (depth,height,time). -1 = values increase downwards (slower plotting), 1 = values increase upwards |
palette |
What color palette would you like to use? (1) rainbow, (2) grayscale, (3) blue, (4) red, (5) blue-white-red (if values are negative and positive, white is centered on zero), (6) viridis |
ncolors |
Number of colors steps to use in palette. |
output |
Which results would you like to return to the console? (0) no output; (1) everything, (2) r^2_envelope, (3) r^2_power, (4) r^2_opt |
genplot |
Generate summary plots? (T or F) |
check |
Conduct compliance checks before processing? (T or F) In general this should be activated; the option is included for Monte Carlo simulation. |
verbose |
Verbose output? (0=nothing, 1=minimal, 2=a little more, 3=everything!) |
S.R. Meyers, 2015, The evaluation of eccentricity-related amplitude modulations and bundling in paleoclimate data: An inverse approach for astrochronologic testing and time scale optimization: Paleoceanography, v.30, 1625-1640.
S.R. Meyers, 2019, Cyclostratigraphy and the problem of astrochronologic testing: Earth-Science Reviews v.190, 190-223.
tracePeak
,trackPeak
,timeOpt
,timeOptSim
, and eTimeOptTrack
## Not run: # generate a test signal with precession and eccentricity ex=cycles(freqs=c(1/405.6795,1/130.719,1/123.839,1/98.86307,1/94.87666,1/23.62069, 1/22.31868,1/19.06768,1/18.91979),end=4000,dt=5) # convert to meters with a linearly increasing sedimentation rate from 0.01 m/kyr to 0.03 m/kyr ex=sedRamp(ex,srstart=0.01,srend=0.03) # interpolate to median sampling interval ex=linterp(ex) # evaluate precession & eccentricity power, and precession modulations res=eTimeOpt(ex,win=20,step=1,fit=1,output=1) # extract the optimal fits for the power optimization sedrates=eTimeOptTrack(res[2]) # extract the optimal fits for the envelope*power optimization sedrates=eTimeOptTrack(res[3]) # you can also interactively track the results using functions 'trackPeak' and 'tracePeak' # evaluate the results from the power optimization sedrates=tracePeak(res[2]) sedrates=trackPeak(res[2]) # evaluate the results from the envelope*power optimization sedrates=tracePeak(res[3]) sedrates=trackPeak(res[3]) # evaluate precession & eccentricity power, and short-eccentricity modulations eTimeOpt(ex,win=20,step=1,fit=2,output=0) ## End(Not run)
## Not run: # generate a test signal with precession and eccentricity ex=cycles(freqs=c(1/405.6795,1/130.719,1/123.839,1/98.86307,1/94.87666,1/23.62069, 1/22.31868,1/19.06768,1/18.91979),end=4000,dt=5) # convert to meters with a linearly increasing sedimentation rate from 0.01 m/kyr to 0.03 m/kyr ex=sedRamp(ex,srstart=0.01,srend=0.03) # interpolate to median sampling interval ex=linterp(ex) # evaluate precession & eccentricity power, and precession modulations res=eTimeOpt(ex,win=20,step=1,fit=1,output=1) # extract the optimal fits for the power optimization sedrates=eTimeOptTrack(res[2]) # extract the optimal fits for the envelope*power optimization sedrates=eTimeOptTrack(res[3]) # you can also interactively track the results using functions 'trackPeak' and 'tracePeak' # evaluate the results from the power optimization sedrates=tracePeak(res[2]) sedrates=trackPeak(res[2]) # evaluate the results from the envelope*power optimization sedrates=tracePeak(res[3]) sedrates=trackPeak(res[3]) # evaluate precession & eccentricity power, and short-eccentricity modulations eTimeOpt(ex,win=20,step=1,fit=2,output=0) ## End(Not run)
Track eTimeOpt r2 maxima.
eTimeOptTrack(res,threshold=0,ydir=-1,genplot=T,verbose=T)
eTimeOptTrack(res,threshold=0,ydir=-1,genplot=T,verbose=T)
res |
eTimeOpt r2 results. Must have the following format: column 1=sedimentation rate; remaining columns (2 to n)=r2; titles for columns 2 to n must be the location (depth or height). Note that this format is ouput by function eTimeOpt. |
threshold |
Threshold r2-value for analysis and plotting. |
ydir |
Direction for y-axis in plots (depth or height). -1 = values increase downwards (slower plotting!), 1 = values increase upwards. |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
Please see function eTimeOpt for details.
S.R. Meyers, 2015, The evaluation of eccentricity-related amplitude modulations and bundling in paleoclimate data: An inverse approach for astrochronologic testing and time scale optimization: Paleoceanography, v.30, 1625-1640.
S.R. Meyers, 2019, Cyclostratigraphy and the problem of astrochronologic testing: Earth-Science Reviews v.190, 190-223.
## Not run: # generate a test signal with precession and eccentricity ex=cycles(freqs=c(1/405.6795,1/130.719,1/123.839,1/98.86307,1/94.87666,1/23.62069, 1/22.31868,1/19.06768,1/18.91979),end=4000,dt=5) # convert to meters with a linearly increasing sedimentation rate from 0.01 m/kyr to 0.03 m/kyr ex=sedRamp(ex,srstart=0.01,srend=0.03) # interpolate to median sampling interval ex=linterp(ex) # evaluate precession & eccentricity power, and precession modulations res=eTimeOpt(ex,win=20,step=1,fit=1,output=1) # extract the optimal fits for the power optimization sedrates=eTimeOptTrack(res[2]) # extract the optimal fits for the envelope*power optimization sedrates=eTimeOptTrack(res[3]) # you can also interactively track the results using functions 'trackPeak' and 'tracePeak' # evaluate the results from the power optimization sedrates=trackPeak(res[2]) sedrates=tracePeak(res[2]) # evaluate the results from the envelope*power optimization optimization sedrates=trackPeak(res[3]) sedrates=tracePeak(res[3]) ## End(Not run)
## Not run: # generate a test signal with precession and eccentricity ex=cycles(freqs=c(1/405.6795,1/130.719,1/123.839,1/98.86307,1/94.87666,1/23.62069, 1/22.31868,1/19.06768,1/18.91979),end=4000,dt=5) # convert to meters with a linearly increasing sedimentation rate from 0.01 m/kyr to 0.03 m/kyr ex=sedRamp(ex,srstart=0.01,srend=0.03) # interpolate to median sampling interval ex=linterp(ex) # evaluate precession & eccentricity power, and precession modulations res=eTimeOpt(ex,win=20,step=1,fit=1,output=1) # extract the optimal fits for the power optimization sedrates=eTimeOptTrack(res[2]) # extract the optimal fits for the envelope*power optimization sedrates=eTimeOptTrack(res[3]) # you can also interactively track the results using functions 'trackPeak' and 'tracePeak' # evaluate the results from the power optimization sedrates=trackPeak(res[2]) sedrates=tracePeak(res[2]) # evaluate the results from the envelope*power optimization optimization sedrates=trackPeak(res[3]) sedrates=tracePeak(res[3]) ## End(Not run)
Calculate eccentricity-tilt-precession time series using the theoretical astronomical solutions. By default, the Laskar et al. (2004) solutions will be downloaded. Alternatively, one can specify the astronomical solution.
etp(tmin=NULL,tmax=NULL,dt=1,eWt=1,oWt=1,pWt=1,esinw=T,solution=NULL,standardize=T, genplot=T,verbose=T)
etp(tmin=NULL,tmax=NULL,dt=1,eWt=1,oWt=1,pWt=1,esinw=T,solution=NULL,standardize=T, genplot=T,verbose=T)
tmin |
Start time (ka before present, J2000) for ETP. Default value is 0 ka, unless the data frame 'solution' is specified, in which case the first time datum is used. |
tmax |
End time (ka before present, J2000) for ETP. Default value is 1000 ka, unless the data frame 'solution' is specified, in which case the last time datum is used. |
dt |
Sample interval for ETP (ka). Minimum = 1 ka. |
eWt |
Relative weight applied to eccentricity solution. |
oWt |
Relative weight applied to obliquity solution. |
pWt |
Relative weight applied to precession solution. |
esinw |
Use e*sinw in ETP calculation? (T or F). If set to false, sinw is used. |
solution |
A data frame containing the astronomical solution to use. The data frame must have four columns: Time (ka, positive and increasing), Precession Angle, Obliquity, Eccentricity. |
standardize |
Standardize (subtract mean, divide by standard deviation) precession, obliquity and eccentricity series before applying weight and combining? (T or F) |
genplot |
Generate summary plots? (T or F). |
verbose |
Verbose output? (T or F). |
Note: If you plan to repeatedly execute the etp function, it is advisable to download the astronomical solution once using the function getLaskar.
Note: It is common practice to construct ETP models that have specified variance ratios (e.g., 1:1:1 or 1:0.5:0.5) for eccentricity, obliquity and precession. In order to construct such models, it is necessary to choose 'standardize=T', and to set the individual weights (eWt, oWt, pWt) to the square root of the desired variance contribution.
Eccentricity + tilt + precession.
Laskar, J., Robutel, P., Joutel, F., Gastineau, M., Correia, A.C.M., Levrard, B., 2004, A long term numerical solution for the insolation quantities of the Earth: Astron. Astrophys., Volume 428, 261-285.
Laskar, J., Fienga, A., Gastineau, M., Manche, H., 2011, La2010: A new orbital solution for the long-term motion of the Earth: Astron. Astrophys., Volume 532, A89.
Laskar, J., Gastineau, M., Delisle, J.-B., Farres, A., Fienga, A.: 2011, Strong chaos induced by close encounters with Ceres and Vesta: Astron. Astrophys., Volume 532, L4.
## Not run: # create an ETP model from 10000 ka to 20000 ka, with a 5 ka sampling interval # this will automatically download the astronomical solution ex=etp(tmin=10000,tmax=20000,dt=5) # alternatively, download the astronomical solution first ex2=getLaskar() ex=etp(tmin=10000,tmax=20000,dt=5,solution=ex2) ## End(Not run)
## Not run: # create an ETP model from 10000 ka to 20000 ka, with a 5 ka sampling interval # this will automatically download the astronomical solution ex=etp(tmin=10000,tmax=20000,dt=5) # alternatively, download the astronomical solution first ex2=getLaskar() ex=etp(tmin=10000,tmax=20000,dt=5,solution=ex2) ## End(Not run)
Extract record from EHA time-frequency output or eAsm output: Use interactive graphical interface to identify record.
extract(spec,get=NULL,xmin=NULL,xmax=NULL,ymin=NULL,ymax=NULL,h=6,w=4,ydir=1,pl=0, ncolors=100,genplot=T,verbose=T)
extract(spec,get=NULL,xmin=NULL,xmax=NULL,ymin=NULL,ymax=NULL,h=6,w=4,ydir=1,pl=0, ncolors=100,genplot=T,verbose=T)
spec |
Time-frequency spectral results to evaluate, or alternatively, eAsm results to evaluate. For time-frequency results, must have the following format: column 1=frequency; remaining columns (2 to n)=power, amplitude or probability; titles for columns 2 to n must be the location (depth or height). Note that this format is ouput by function eha. For eAsm results, must have the following format: column 1=sedimentation rate; remaining columns (2 to n)=Ho-SL or ASM; titles for columns 2 to n must be the location (depth or height). |
get |
Record to extract (height/depth/time). If no value given, graphical interface is activated. |
xmin |
Minimum frequency or sedimentation rate for PLOTTING. |
xmax |
Maximum frequency or sedimentation rate for PLOTTING. |
ymin |
Minimum depth/height for PLOTTING. |
ymax |
Maximum depth/height for PLOTTING. |
h |
Height of plot in inches. |
w |
Width of plot in inches. |
ydir |
Direction for y-axis in plots (depth or height). -1 = values increase downwards (slower plotting!), 1 = values increase upwards. |
pl |
An option for the color plots (0=do nothing; 1=plot log of value [useful for plotting power], 2=normalize to maximum value [useful for plotting amplitude]). |
ncolors |
Number of colors to use in plot. |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
Flip the stratigraphic order of your data series (e.g., convert stratigraphic depth series to height series, relative to a defined datum.)
flip(dat,begin=0,genplot=T,verbose=T)
flip(dat,begin=0,genplot=T,verbose=T)
dat |
Stratigraphic series. First column should be location (e.g., depth), second column should be data value. |
begin |
Depth/height value to assign to (new) first stratigraphic datum. |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
Convert record of local spatial frequency (from EHA) to sedimentation rate curve
freq2sedrate(freqs,period=NULL,ydir=1,genplot=T,verbose=T)
freq2sedrate(freqs,period=NULL,ydir=1,genplot=T,verbose=T)
freqs |
Data frame containing depth/height in first column (meters) and spatial frequencies in second column (cycles/m) |
period |
Temporal period of spatial frequency (ka) |
ydir |
Direction for y-axis in plots (depth,height). -1 = values increase downwards (slower), 1 = values increase upwards |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
Apply a Gaussian taper to a stratigraphic series
gausTaper(dat,alpha=3,rms=T,demean=T,detrend=F,genplot=T,verbose=T)
gausTaper(dat,alpha=3,rms=T,demean=T,detrend=F,genplot=T,verbose=T)
dat |
Stratigraphic series for tapering. First column should be location (e.g., depth), second column should be data value. If no data is identified, will output a 256 point taper to evaluate the spectral properties of the window. |
alpha |
Gaussian window parameter: alpha is 1/stdev, a measure of the width of the Dirichlet kernel. Larger values decrease the width of data window, reduce discontinuities, and increase width of the transform. Choose alpha >= 2.5. |
rms |
Normalize taper to RMS=1 to preserve power for white process? (T or F) |
demean |
Remove mean from data series? (T or F) |
detrend |
Remove linear trend from data series? (T or F) |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
Harris, 1978, On the use of windows for harmonic analysis with the discrete Fourier transform: Proceedings of the IEEE, v. 66, p. 51-83.
cosTaper
, dpssTaper
, and hannTaper
Query R for color information.
getColor(color)
getColor(color)
color |
The name of the color you are interested in, in quotes. |
Download data file from astrochron server.
getData(dat="1262-a*")
getData(dat="1262-a*")
dat |
A character string that specifies the data file to download. At present there are ten options: "1262-a*" , "926B-18O", "graptolite", "Xiamaling-CuAl", "607-18O" , "AEB-18O" , "Newark-rank", "CDL-rank", "DVCP2017-18O", "AND2A-clast" |
Download Laskar et al. (2004, 2011a, 2011b) astronomical solutions.
getLaskar(sol="la04",verbose=T)
getLaskar(sol="la04",verbose=T)
sol |
A character string that specifies the astronomical solution to download: "la04","la10a","la10b","la10c","la10d","la11","insolation" |
verbose |
Verbose output? (T or F) |
la04 : three columns containing precession angle, obliquity, and eccentricity of Laskar et al. (2004)
la10a : one column containing the la10a eccentricity solution of Laskar et al. (2011a)
la10b : one column containing the la10b eccentricity solution of Laskar et al. (2011a)
la10c : one column containing the la10c eccentricity solution of Laskar et al. (2011a)
la10d : one column containing the la10d eccentricity solution of Laskar et al. (2011a)
la11 : one column containing the la11 eccentricity solution of Laskar et al. (2011b; please also cite 2011a)
insolation : one column containing insolation at 65 deg North (W/m^2) during summer solstice, from Laskar et al. (2004)
J. Laskar, P. Robutel, F. Joutel, M. Gastineau, A.C.M. Correia, and B. Levrard, B., 2004, A long term numerical solution for the insolation quantities of the Earth: Astron. Astrophys., Volume 428, 261-285.
Laskar, J., Fienga, A., Gastineau, M., Manche, H., 2011a, La2010: A new orbital solution for the long-term motion of the Earth: Astron. Astrophys., Volume 532, A89.
Laskar, J., Gastineau, M., Delisle, J.-B., Farres, A., Fienga, A.: 2011b, Strong chaos induced by close encounters with Ceres and Vesta, Astron: Astrophys., Volume 532, L4.
Apply a Hann (Hanning) taper to a stratigraphic series
hannTaper(dat,rms=T,demean=T,detrend=F,genplot=T,verbose=T)
hannTaper(dat,rms=T,demean=T,detrend=F,genplot=T,verbose=T)
dat |
Stratigraphic series for tapering. First column should be location (e.g., depth), second column should be data value. If no data is identified, will output a 256 point taper to evaluate the spectral properties of the window. |
rms |
Normalize taper to RMS=1 to preserve power for white process? (T or F) |
demean |
Remove mean from data series? (T or F) |
detrend |
Remove linear trend from data series? (T or F) |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
cosTaper
, dpssTaper
, and gausTaper
Execute 'head' function, with column numbers indicated for each variable. (useful for functions such as 'autopl')
headn(dat)
headn(dat)
dat |
Your data frame. |
Calculate instantaneous amplitude (envelope) and phase via Hilbert Transform of stratigraphic series
hilbert(dat,phase=F,padfac=2,demean=T,detrend=F,output=T,addmean=F,genplot=T,check=T, verbose=T)
hilbert(dat,phase=F,padfac=2,demean=T,detrend=F,output=T,addmean=F,genplot=T,check=T, verbose=T)
dat |
Stratigraphic series to Hilbert Transform. First column should be location (e.g., depth), second column should be data value. |
phase |
Calculate instantaneous phase? (T or F) |
padfac |
Pad with zeros to (padfac*npts) points, where npts is the original number of data points. |
demean |
Remove mean from data series? (T or F) |
detrend |
Remove linear trend from data series? (T or F) |
output |
Return results as new data frame? (T or F) |
addmean |
Add mean value to instantaneous amplitude? (T or F) |
genplot |
Generate summary plots? (T or F) |
check |
Conduct compliance checks before processing? (T or F) In general this should be activated; the option is included for Monte Carlo simulation. |
verbose |
Verbose output? (T or F) |
# generate example series with 3 precession terms and noise ex <- cycles(noisevar=.0004,dt=5) # bandpass precession terms using cosine-tapered window res_ex <- bandpass(ex,flow=0.038,fhigh=0.057,win=2,p=.4) # hilbert transform hil_ex <- hilbert(res_ex)
# generate example series with 3 precession terms and noise ex <- cycles(noisevar=.0004,dt=5) # bandpass precession terms using cosine-tapered window res_ex <- bandpass(ex,flow=0.038,fhigh=0.057,win=2,p=.4) # hilbert transform hil_ex <- hilbert(res_ex)
Interactively identify points in x,y plot.
idPts(dat1,dat2=NULL,ptsize=0.5,xmin=NULL,xmax=NULL,ymin=NULL,ymax=NULL, logx=F,logy=F,plotype=1,annotate=1,iso=F,output=1,verbose=T)
idPts(dat1,dat2=NULL,ptsize=0.5,xmin=NULL,xmax=NULL,ymin=NULL,ymax=NULL, logx=F,logy=F,plotype=1,annotate=1,iso=F,output=1,verbose=T)
dat1 |
Data frame with one, two or three columns. If one column, dat2 must also be specified. If three columns, the data frame is assumed to represent a stratigraphic series, and the first column should be depth, height or time. |
dat2 |
Data frame with one column. |
ptsize |
Size of plotted points. |
xmin |
Minimum x-value (column 1) to plot |
xmax |
Maximum x-value (column 1) to plot |
ymin |
Minimum y-value (column 2) to plot |
ymax |
Maximum y-value (column 2) to plot |
logx |
Plot x-axis using logarithmic scaling? (T or F) |
logy |
Plot y-axis using logarithmic scaling? (T or F) |
plotype |
Type of plot to generate: 1= points and lines, 2 = points, 3 = lines |
annotate |
Annotate plot with text indicating coordinates?: 0=none, 1=annotate above point, 2=annotate below point |
iso |
Isolate data between minimum and maximum x-values selected? (T or F) This option requires that both dat1 and dat2 have one column each, or if dat2 is null, dat1 has only two columns. |
output |
Return identified points as a data frame? (0) no, (1) return x and y, (2) return index, x and y. If dat1 contains three columns, option 2 will return index, location, x and y. |
verbose |
Verbose output? (T or F) |
An implementation of the Imbrie and Imbrie (1980) ice sheet model
imbrie(insolation=NULL,Tm=17,b=0.6,times=NULL,initial=0,burnin=100,standardize=T, output=T,genplot=1,verbose=T)
imbrie(insolation=NULL,Tm=17,b=0.6,times=NULL,initial=0,burnin=100,standardize=T, output=T,genplot=1,verbose=T)
insolation |
Insolation, in ka (negative for future, positive for past). Default is insolation over the past 1000 ka from 65 deg. North, 21 June. |
Tm |
Vector of mean time constants in ka. Default is 17 ka. The order of the Tm values should match vectors b and times. |
b |
Vector of nonlinearity coefficient (a value ranging from 0 to 1). Default is 0.6. The order of the b values should match vectors Tm and times. |
times |
Vector of start times for each Tm and b listed above. Leave as NULL if you only need to model one Tm and b value. |
initial |
Initial value for ice volume, relative to centered record. Default is 0. |
burnin |
Number of points for model burn-in. This is required to achieve stable model results. Default is 100 points. |
standardize |
Standardize model output to maximum value of one and minimum value of zero? (T or F) |
output |
Output model results? (T or F) |
genplot |
Generate summary plots? (1) plot insolation and ice volume series, (2) plot animated insolation, ice volume and phase portrait.) |
verbose |
Verbose output? (T or F) |
This function will implement the ice volume model of Imbrie and Imbrie (1980), following the conventions of Paillard et al. (1996).
When using the 'times' vector, consider the following example:
times= c(500,1000)
Tm=c(15,5)
b=c(0.6,0.3)
In this case, a Tm of 15 (b of 0.6) will be applied to model from 0-500 ka, and a Tm of 5 (b of 0.3) will be applied to model 500-1000 ka.
Imbrie, J., and Imbrie, J.Z., (1980), Modeling the Climatic Response to Orbital Variations: Science, v. 207, p. 943-953.
Lisiecki, L. E., and M. E. Raymo, 2005, A Pliocene-Pleistocene stack of 57 globally distributed benthic d18O records, Paleoceanography, 20, PA1003, doi:10.1029/2004PA001071.
Paillard, D., L. Labeyrie and P. Yiou, (1996), Macintosh program performs time-series analysis: Eos Trans. AGU, v. 77, p. 379.
## Not run: # make a very simple forcing (on/off) forcing=cycles(0,end=300) forcing[50:150,2]=1 plot(forcing,type="l") # use this forcing to drive the imbrie ice model # set b=0, Tm = 1 imbrie(forcing,b=0,Tm=1,output=F) # let's view the evolution of the ice sheet imbrie(forcing,b=0,Tm=1,output=F,genplot=2) # now increase the response time imbrie(forcing,b=0,Tm=10,output=F,genplot=2) # now model slow growth, fast decay imbrie(forcing,b=0.5,Tm=10,output=F,genplot=2) # now make a 100 ka cyclic forcing forcing=cycles(1/100,end=300) imbrie(forcing,b=0,Tm=1,output=F,genplot=2) imbrie(forcing,b=0,Tm=10,output=F,genplot=2) imbrie(forcing,b=0.5,Tm=10,output=F,genplot=2) # show burn-in imbrie(forcing,b=0.5,Tm=10,output=F,genplot=2,burnin=0) # now examine Malutin Milankovitch's hypothesis: 65 deg N, summer solstice imbrie(b=0.5,Tm=10,output=F,genplot=2,burnin=900) # use the ice model output to make a synthetic stratigraphic section res=imbrie(b=0.5,T=10,output=T,genplot=1,burnin=100) synthStrat(res,clip=F) # generate ice model for last 5300 ka, using 65 deg. N insolation, 21 June # allow b and Tm values to change as in Lisiecki and Raymo (2005): insolation=getLaskar("insolation") insolation=iso(insolation,xmin=0,xmax=5300) # b is 0.3 from 5300 to 3000 ka, then linearly increases to 0.6 between 3000 and 1500 ka. # b is 0.6 from 1500 ka to present. set_b=linterp(cb(c(1500,3000),c(0.6,0.3)),dt=1) set_b=rbind(set_b,c(5400,0.3)) # Tm is 5 ka from 5300 to 3000 ka, then linearly increases to 15 ka between 3000 and 1500 ka. # Tm is 15 ka from 1500 ka to present. set_Tm=linterp(cb(c(1500,3000),c(15,5)),dt=1) set_Tm=rbind(set_Tm,c(5400,5)) # now run model ex=imbrie(insolation=insolation,Tm=set_Tm[,2],b=set_b[,2],times=set_b[,1]) # time-frequency analysis of model result eha(ex,fmax=0.1,win=500,step=10,pad=5000,genplot=4,pl=2) ## End(Not run)
## Not run: # make a very simple forcing (on/off) forcing=cycles(0,end=300) forcing[50:150,2]=1 plot(forcing,type="l") # use this forcing to drive the imbrie ice model # set b=0, Tm = 1 imbrie(forcing,b=0,Tm=1,output=F) # let's view the evolution of the ice sheet imbrie(forcing,b=0,Tm=1,output=F,genplot=2) # now increase the response time imbrie(forcing,b=0,Tm=10,output=F,genplot=2) # now model slow growth, fast decay imbrie(forcing,b=0.5,Tm=10,output=F,genplot=2) # now make a 100 ka cyclic forcing forcing=cycles(1/100,end=300) imbrie(forcing,b=0,Tm=1,output=F,genplot=2) imbrie(forcing,b=0,Tm=10,output=F,genplot=2) imbrie(forcing,b=0.5,Tm=10,output=F,genplot=2) # show burn-in imbrie(forcing,b=0.5,Tm=10,output=F,genplot=2,burnin=0) # now examine Malutin Milankovitch's hypothesis: 65 deg N, summer solstice imbrie(b=0.5,Tm=10,output=F,genplot=2,burnin=900) # use the ice model output to make a synthetic stratigraphic section res=imbrie(b=0.5,T=10,output=T,genplot=1,burnin=100) synthStrat(res,clip=F) # generate ice model for last 5300 ka, using 65 deg. N insolation, 21 June # allow b and Tm values to change as in Lisiecki and Raymo (2005): insolation=getLaskar("insolation") insolation=iso(insolation,xmin=0,xmax=5300) # b is 0.3 from 5300 to 3000 ka, then linearly increases to 0.6 between 3000 and 1500 ka. # b is 0.6 from 1500 ka to present. set_b=linterp(cb(c(1500,3000),c(0.6,0.3)),dt=1) set_b=rbind(set_b,c(5400,0.3)) # Tm is 5 ka from 5300 to 3000 ka, then linearly increases to 15 ka between 3000 and 1500 ka. # Tm is 15 ka from 1500 ka to present. set_Tm=linterp(cb(c(1500,3000),c(15,5)),dt=1) set_Tm=rbind(set_Tm,c(5400,5)) # now run model ex=imbrie(insolation=insolation,Tm=set_Tm[,2],b=set_b[,2],times=set_b[,1]) # time-frequency analysis of model result eha(ex,fmax=0.1,win=500,step=10,pad=5000,genplot=4,pl=2) ## End(Not run)
Calculate the analytical response function from an impulse forcing using the 1-D advection diffusion model proposed in Schink and Guinasso (1975) to model the bioturbation impact on climate time series.
impulseResponse(G, ML = NULL, v = NULL, nt = 500, genplot = FALSE, verbose = FALSE)
impulseResponse(G, ML = NULL, v = NULL, nt = 500, genplot = FALSE, verbose = FALSE)
G |
Bioturbation parameter. G = D/ML/v |
ML |
Mix layer depth (cm) |
v |
Sedimentation rate (cm/kyr) |
nt |
Number of steps after the signal is deposited. |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
fc Impulse response function
Guinasso, N.L. and Schinck, D.R., 1975, Quantitative estimates of biological mixing rates in abyssal sediments, J. Geophys. Res., 80, 3032-3043.
Goreau, T.J., 1977, Quantitative effects of sediment mixing on stratigraphy and biogeochemistry: a signal theory approach, Nature, 256, 730-732.
Goreau, T.J., 1980, Frequency sensitivity of the deep-sea climatic record, Nature, 287, 620-622.
Liu, H., Meyers, S.R., and Marcott, S.A., 2021, Unmixing dee-sea paleoclimate records: A study on bioturbation effects through convolution and deconvolution, Earth and Planetary Science Letters, 564, 116883.
G <- 4 ML <- 10 v <- 1 # take a look at the IRF impulseResponse(G=4, ML = 10, v = 1, genplot = TRUE)
G <- 4 ML <- 10 v <- 1 # take a look at the IRF impulseResponse(G=4, ML = 10, v = 1, genplot = TRUE)
Generate map that show difference in insolation between two times using Laskar et al. (2004) insolation calculations. This is a wrapper function to calculate insolation using the palinsol package, following astrochron syntax.
insoDiff(t1,t2,S0=1365,verbose=T)
insoDiff(t1,t2,S0=1365,verbose=T)
t1 |
Time 1, in kyr (negative for future, positive for past; valid from -21000 to 51000) |
t2 |
Time 2, in kyr (negative for future, positive for past; valid from -21000 to 51000) |
S0 |
Solar constant, W/m^2 |
verbose |
Verbose output? (T or F) |
This wrapper function generates maps with insolation calculations based on the Laskar et al. (2004) astronomical parameters, using the 'palinsol' package (Crucifix, 2016).
Crucifix, M., 2016, palinsol: Insolation for Palaeoclimate Studies. R package version 0.93: https://CRAN.R-project.org/package=palinsol
J. Laskar, P. Robutel, F. Joutel, M. Gastineau, A.C.M. Correia, and B. Levrard, B., 2004, A long term numerical solution for the insolation quantities of the Earth: Astron. Astrophys., Volume 428, 261-285.
Generate insolation maps using Laskar et al. (2004) insolation calculations. This is a wrapper function to calculate insolation using the palinsol package, following astrochron syntax.
insoMap(t=0,pick=0,S0=1365,output=F,verbose=T)
insoMap(t=0,pick=0,S0=1365,output=F,verbose=T)
t |
Time for evaluation, in kyr (negative for future, positive for past; valid from -21000 to 51000) |
pick |
Interactively pick (1) latitude to examine seasonal insolation at that latitude, or (2) day to examine insolation across latitude |
S0 |
Solar constant, W/m^2 |
output |
Output insolation matrix (if pick=0) or selected insolation transect (if pick = 1 or 2)? (T or F) |
verbose |
Verbose output? (T or F) |
This wrapper function generates maps with insolation calculations based on the Laskar et al. (2004) astronomical parameters, using the 'palinsol' package (Crucifix, 2016).
Option 'pick' will allow you to extract insolation by (1) latitude or (2) season.
Crucifix, M., 2016, palinsol: Insolation for Palaeoclimate Studies. R package version 0.93: https://CRAN.R-project.org/package=palinsol
J. Laskar, P. Robutel, F. Joutel, M. Gastineau, A.C.M. Correia, and B. Levrard, B., 2004, A long term numerical solution for the insolation quantities of the Earth: Astron. Astrophys., Volume 428, 261-285.
Laskar et al. (2004) insolation calculations. This is a wrapper function to calculate insolation using the palinsol package, following astrochron syntax.
insoSeries(tmin=0,tmax=1000,dt=1,opt=1,long=90,lat=65,threshold=400,l1=0,l2=70,S0=1365, genplot=TRUE,verbose=TRUE)
insoSeries(tmin=0,tmax=1000,dt=1,opt=1,long=90,lat=65,threshold=400,l1=0,l2=70,S0=1365, genplot=TRUE,verbose=TRUE)
tmin |
Minimum time for evaluation, in kyr (negative for future, positive for past; valid from -21000 to 51000) |
tmax |
Maximum time for evaluation, in kyr (negative for future, positive for past; valid from -21000 to 51000) |
dt |
Sampling interval in kyr. Must be >= 1 |
opt |
1=Calculate daily mean insolation for given day and latitude; 2=calculate caloric insolation for given latitude; 3=calculate integrated insolation for given latitude; 4=calculating integrated insolation for given latitude, with threshold |
long |
True solar longitude, in degrees, 0-360 |
lat |
Latitude on the Earth for evaluation, in degrees, -90 to 90 |
threshold |
Threshold insolation, in W/m^2 |
l1 |
Lower true solar longitude bound of the time-integral, in degrees, 0-360 |
l2 |
Upper true solar longitude bound of the time-integral, in degrees, 0-360 |
S0 |
Solar constant, W/m^2 |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
This wrapper function performs four different types of insolation calculations based on the Laskar et al. (2004) astronomical parameters, using the 'palinsol' package (Crucifix, 2016).
The following 'palinsol' functions are used:
opt 1: Insol - Calculate Mean Insolation for Given Day and Latitude
opt 2: calins - Calculate Caloric Insolation for Given Latitude (Milankovitch; Berger, 1978)
opt 3: Insol_l1l2 - Calculate Integrated Insolation for Given Latitude (Berger et al., 2010)
opt 4: thrins - Calculate Integrated Insolation for Given Latitude, with Threshold (Huybers and Tziperman, 2008)
la04 - Calculate astronomical parameters (Laskar et al., 2004)
Please see those functions for further details.
If opt 1 is selected: specify 'long' and 'lat'
If opt 2 is selected: specify 'lat'
If opt 3 is selected: specify 'lat', 'l1' and 'l2'
If opt 4 is selected: specify 'lat' and 'threshold'
APPROXIMATE CONVENTIONAL DATES FOR A GIVEN MEAN LONGITUDE (long):
0: 21 March (equinox)
30: 21 April
60: 21 May
90: 21 June (solstice)
120: 21 July
150: 21 August
180: 21 September (equinox)
210: 21 October
240: 21 November
270: 21 December (solstice)
300: 21 January
330: 21 February
Berger, A., 1978, Long-term variations of caloric insolation resulting from the earth's orbital elements: Quaternary Research, 9, 139 - 167.
Berger, A., Loutre, M.F., Yin Q., 2010, Total irradiation during any time interval of the year using elliptic integrals: Quaternary Science Reviews, 29, 1968 - 1982, doi:10.1016/j.quascirev.2010.05.007
Crucifix, M., 2016, palinsol: Insolation for Palaeoclimate Studies. R package version 0.93: https://CRAN.R-project.org/package=palinsol
Huybers, P., Tziperman, E., 2008, Integrated summer insolation forcing and 40,000-year glacial cycles: The perspective from an ice-sheet/energy-balance model: Paleoceanography, 23.
J. Laskar, P. Robutel, F. Joutel, M. Gastineau, A.C.M. Correia, and B. Levrard, B., 2004, A long term numerical solution for the insolation quantities of the Earth: Astron. Astrophys., Volume 428, 261-285.
Determine the total power within a given bandwidth, and also the ratio of this power to the total power in the spectrum (or up to a specified frequency). If bandwidth is not specified, generate interactive plots for bandwidth selection. For use with the function eha, integratePower can process spectrograms (time-frequency) or single spectra.
integratePower(spec,flow=NULL,fhigh=NULL,fmax=NULL,unity=F,f0=T,xmin=NULL, xmax=NULL,ymin=NULL,ymax=NULL,npts=NULL,pad=NULL,ydir=1, palette=6,ncolors=100,h=6,w=9,ln=F,genplot=T,verbose=T)
integratePower(spec,flow=NULL,fhigh=NULL,fmax=NULL,unity=F,f0=T,xmin=NULL, xmax=NULL,ymin=NULL,ymax=NULL,npts=NULL,pad=NULL,ydir=1, palette=6,ncolors=100,h=6,w=9,ln=F,genplot=T,verbose=T)
spec |
Spectral results to evaluate. If the data frame contains time-frequency results, it must have the following format: column 1=frequency; remaining columns (2 to n)=power; titles for columns 2 to n must be the location (depth or height). Note that this format is ouput by function eha. If the data frame contains one spectrum, it must have the following format: column 1=frequency, column 2=power. |
flow |
Low frequency cutoff for integration. If flow or fhigh are not specified, interactive plotting is activated. |
fhigh |
High frequency cutoff for integration. If flow or fhigh are not specified, interactive plotting is activated. |
fmax |
Integrate total power up to this frequency. |
unity |
Normalize spectra such that total variance (up to fmax) is unity. (T of F) |
f0 |
Is f(0) included in the spectra? (T or F) |
xmin |
Minimum frequency for PLOTTING. |
xmax |
Maximum frequency for PLOTTING. |
ymin |
Minimum depth/height/time for PLOTTING. Only used if processing time-frequency results. |
ymax |
Maximum depth/height/time for PLOTTING. Only used if processing time-frequency results. |
npts |
The number of points in the processed time series window. This is needed for proper spectrum normalization. |
pad |
The total padded length of the processed time series window. This is needed for proper spectrum normalization. |
ydir |
Direction for y-axis in plots (depth or height). -1 = values increase downwards (slower plotting!), 1 = values increase upwards. Only used if processing time-frequency results. |
palette |
What color palette would you like to use? (1) rainbow, (2) grayscale, (3) blue, (4) red, (5) blue-white-red, (6) viridis |
ncolors |
Number of colors to use in plot. Only used if processing time-frequency results. |
h |
Height of plot in inches. |
w |
Width of plot in inches. |
ln |
Plot natural log of spectral results? (T or F) |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
Depending on the normalization used, you may want to preprocess the power spectra prior to integration.
# generate etp signal over past 10 Ma ex=etp(tmax=10000) # evolutive power pwr=eha(ex,win=500,fmax=.1,pad=2000,output=2,pl=2) # integrate power from main obliquity term integratePower(pwr,flow=0.02,fhigh=0.029,npts=501,pad=2000)
# generate etp signal over past 10 Ma ex=etp(tmax=10000) # evolutive power pwr=eha(ex,win=500,fmax=.1,pad=2000,output=2,pl=2) # integrate power from main obliquity term integratePower(pwr,flow=0.02,fhigh=0.029,npts=501,pad=2000)
Isolate a section of a uni- or multi-variate stratigraphic data set for further analysis
iso(dat,xmin,xmax,col=2,logx=F,logy=F,genplot=T,verbose=T)
iso(dat,xmin,xmax,col=2,logx=F,logy=F,genplot=T,verbose=T)
dat |
Data frame containing stratigraphic variable(s) of interest. First column must be location (e.g., depth). |
xmin |
Minimum depth/height/time for isolation. If xmin is not specified, it will be selected using a graphical interface. |
xmax |
Maximum depth/height/time for isolation. If xmax is not specified, it will be selected using a graphical interface. |
col |
If you are using the graphical interface to select xmin/xmax, which column would you like to plot? (default = 2). |
logx |
Plot x-axis using logarithmic scaling? (T or F) |
logy |
Plot y-axis using logarithmic scaling? (T or F) |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
delPts
, idPts
, trim
and trimAT
Tune stratigraphic series to an astronomical target using graphical interface similar to Analyseries 'Linage' routine (Paillard et al, 1996).
linage(dat,target,extrapolate=F,xmin=NULL,xmax=NULL,tmin=NULL,tmax=NULL,size=1,plotype=1, output=1,genplot=T)
linage(dat,target,extrapolate=F,xmin=NULL,xmax=NULL,tmin=NULL,tmax=NULL,size=1,plotype=1, output=1,genplot=T)
dat |
Stratigraphic series for tuning, with two columns. First column is depth/height. |
target |
Astronomical tuning target series. First column is time. |
extrapolate |
Extrapolate sedimentation rates above and below 'tuned' interval? (T or F) |
xmin |
Minimum height/depth to plot. |
xmax |
Maximum height/depth to plot. |
tmin |
Minimum time value to plot. |
tmax |
Maximum time value to plot. |
size |
Multiplicative factor to increase or decrease size of symbols and fonts. |
plotype |
Type of plot to generate: 1= points and lines, 2 = points, 3 = lines |
output |
Return which of the following? 1 = tuned stratigraphic series; 2 = age control points; 3 = tuned stratigraphic series and age control points |
genplot |
Generate additional summary plots (tuned record, time-space map, sedimentation rates)? (T or F) |
Paillard, D., L. Labeyrie and P. Yiou, 1996), Macintosh program performs time-series analysis: Eos Trans. AGU, v. 77, p. 379.
## Not run: # Check to see if this is an interactive R session, for compliance with CRAN standards. # YOU CAN SKIP THE FOLLOWING LINE IF YOU ARE USING AN INTERACTIVE SESSION. if(interactive()) { # generate example series with 3 precession terms and noise using function 'cycles' # then convert from time to space using sedimentation rate that increases from 1 to 7 cm/ka ex=sedRamp(cycles(start=1,end=400, dt=2,noisevar=.00005),srstart=0.01,srend=0.07) # create astronomical target series targ=cycles(start=1,end=400,dt=2) ## manually tune tuned=linage(ex,targ) ## should you need to flip the direction of the astronomical target series, use function 'cb': tuned=linage(ex,cb(targ[1]*-1,targ[2])) } ## End(Not run)
## Not run: # Check to see if this is an interactive R session, for compliance with CRAN standards. # YOU CAN SKIP THE FOLLOWING LINE IF YOU ARE USING AN INTERACTIVE SESSION. if(interactive()) { # generate example series with 3 precession terms and noise using function 'cycles' # then convert from time to space using sedimentation rate that increases from 1 to 7 cm/ka ex=sedRamp(cycles(start=1,end=400, dt=2,noisevar=.00005),srstart=0.01,srend=0.07) # create astronomical target series targ=cycles(start=1,end=400,dt=2) ## manually tune tuned=linage(ex,targ) ## should you need to flip the direction of the astronomical target series, use function 'cb': tuned=linage(ex,cb(targ[1]*-1,targ[2])) } ## End(Not run)
Interpolate stratigraphic series onto a evenly sampled grid, using piecewise linear interpolation
linterp(dat,dt,start,genplot=T,check=T,verbose=T)
linterp(dat,dt,start,genplot=T,check=T,verbose=T)
dat |
Stratigraphic series for piecewise linear interpolation. First column should be location (e.g., depth), second column should be data value. |
dt |
New sampling interval. |
start |
Start interpolating at what time/depth/height value? By default, the first value of the stratigraphic series will be used. |
genplot |
Generate summary plots? (T or F) |
check |
Conduct compliance checks before processing? (T or F) In general this should be activated; the option is included for Monte Carlo simulation. |
verbose |
Verbose output? (T or F) |
Linearly interpolate stratigraphic series using the approach of Laepple and Huybers (2013), including anti-alias filtering.
linterpLH13(dat,dt=NULL,start=NULL,dtMin=NULL,thresh=0.7,beta=1,tbw=20,smooth=0.05, logF=F, antialias=T,roll=10^10,nsim=1,ncores=2,output=T,maxF=NULL,pl=1, genplot=T,verbose=1)
linterpLH13(dat,dt=NULL,start=NULL,dtMin=NULL,thresh=0.7,beta=1,tbw=20,smooth=0.05, logF=F, antialias=T,roll=10^10,nsim=1,ncores=2,output=T,maxF=NULL,pl=1, genplot=T,verbose=1)
dat |
Stratigraphic series for piecewise linear interpolation. First column should be location (e.g., depth), second column should be data value. |
dt |
New optimal sampling interval. If dt is not specified, it will be estimated using the approach of Laepple and Huybers (2013). |
start |
Start interpolating at what time/depth/height value? By default, the first value of the stratigraphic series will be used. |
dtMin |
Very fine sampling interval for noise generation. If dt is not specified, the finest sample spacing of dat is used. |
thresh |
Threshold value for R2 (see details). Default value is 0.7 as in Laepple and Huybers (2013) |
beta |
Power law coefficient for stochastic surrogates, >=0. |
tbw |
MTM time-bandwidth product. |
smooth |
Smoothing parameter for spectral ratio R (see details). |
logF |
Smooth ratio R using log10 transformed frequency? (T or F) |
antialias |
Apply anti-alias filter? (T or F) |
roll |
Taner filter roll-off rate for anti-alias filter, in dB/octave. |
nsim |
Number of Monte Carlo simulations. |
ncores |
Number of cores to use for parallel processing. |
maxF |
Maximum frequency for spectrum plotting. |
pl |
Plot logarithm of spectral power (1) or linear spectral power (2)? |
output |
Return interpolated series as new data frame? (T or F) |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (0=none, 1=some reporting, 2=extensive reporting) |
This function seeks to estimate the optimal sampling interval for piecewise linear interpolation of an unevenly sampled stratigraphic series ("D"), so as to reduce bias when reconstructing the spectral background. The algorithm is slightly modified from Laepple and Huybers (2013), and consists of the following steps:
(1) Generate a 1/f stochastic noise signal, N. A sampling interval equivalent to the finest step of data set D is used for the noise model if dtMin is NULL.
(2) Subsample the 1/f noise (N) on the actual data set D sampling grid, yielding N2.
(3) Interpolate the subsampled 1/f noise (N2) to dtMin, yielding N3.
(4) Calculate the MTM power spectra for N (Spec_N) and N3 (Spec_N3), using a low resolution spectrum to provide a relatively smooth estimate of the continuum.
(5) Divide the resampled power spectrum (Spec_N3) by unresampled spectrum (Spec_N), yielding the ratio R.
(6) Smooth the ratio R using a Gaussian kernel, yielding R2.
(7) Estimate the highest reliable frequency (F) as the lowest frequency at which the ratio R2 < 0.7 (or specified thresh value).
(8) Calculate the optimal interpolation resolution, dt, as 0.5/F.
If anti-alias filtering is selected:
(9) Interpolate the data set D to 0.1*dt, yielding D2.
(10) Filter D2 using a Taner lowpass (anti-alias) filter with a cutoff frequency of 1.2/dt, yielding D3.
(11) Resample D3 at the optimal resolution dt, yielding D4.
If anti-alias filtering is not selected, instead of steps 9-11, resample D at the optimal resolution dt.
When anti-alias filtering is applied, the first and last value of the interpolated series (D4) have a tendency to be strongly biased if they closely align with the original sampling grid of D. To address this issue, the first and last interpolated points are removed if they are within 0.5*dt (the optimal interpolation interval) of the first or last sampling location of D.
NOTE: A finer (smaller increment) interpolation interval than the 'optimal' one proposed by linterpLH13 may be appropriate for astronomical signal detection, although the magnitude of the observed astronomical variability may be substantially underestimated.
T. Laepple and P. Huybers, 2013, Reconciling discrepancies between Uk37 and Mg/Ca reconstructions of Holocene marine temperature variability: Earth and Planetary Science Letters, v. 375, p. 418-429.
# generate example series from ar1 noise, 5 kyr sampling interval ex = ar1(npts=501,dt=10) # jitter sampling times ex[1]=ex[1]+rnorm(501,sd=1) # sort ex = ex[order(ex[,1],na.last=NA,decreasing=FALSE),] # view sampling statistics strats(ex) # run linterpLH13 linterpLH13(ex,output=FALSE) # run linterpLH13 with multiple simulations linterpLH13(ex,nsim=500,output=FALSE)
# generate example series from ar1 noise, 5 kyr sampling interval ex = ar1(npts=501,dt=10) # jitter sampling times ex[1]=ex[1]+rnorm(501,sd=1) # sort ex = ex[order(ex[,1],na.last=NA,decreasing=FALSE),] # view sampling statistics strats(ex) # run linterpLH13 linterpLH13(ex,output=FALSE) # run linterpLH13 with multiple simulations linterpLH13(ex,nsim=500,output=FALSE)
Log transformation of stratigraphic series.
logT(dat,c=0,opt=1,genplot=T,verbose=T)
logT(dat,c=0,opt=1,genplot=T,verbose=T)
dat |
Stratigraphic series for log transformation. Input can have any number of columns desired. If two or more columns are input, the first column must be location (e.g., depth), while remaining columns are data values for transformation. |
c |
Constant to add prior to log transformation. Default = 0. |
opt |
(1) use natural logarithm, (2) use log10. Default = 1. |
genplot |
Generate summary plots? (T or F). This is automatically deactivated if more than one variable is transformed. |
verbose |
Verbose output? (T or F) |
arcsinT
, demean
, detrend
, divTrend
, prewhiteAR
, and prewhiteAR1
Lowpass filter stratigraphic series using rectangular, Gaussian or tapered cosine window. This function can also be used to highpass filter a record (see examples).
lowpass(dat,padfac=2,fcut=NULL,win=0,demean=T,detrend=F,addmean=T,alpha=3,p=0.25, xmin=0,xmax=Nyq,genplot=T,verbose=T)
lowpass(dat,padfac=2,fcut=NULL,win=0,demean=T,detrend=F,addmean=T,alpha=3,p=0.25, xmin=0,xmax=Nyq,genplot=T,verbose=T)
dat |
Stratigraphic series for lowpass filtering. First column should be location (e.g., depth), second column should be data value. |
padfac |
Pad with zeros to (padfac*npts) points, where npts is the original number of data points. |
fcut |
Cutoff frequency for lowpass filtering. |
win |
Window type for bandpass filter: 0 = rectangular , 1= Gaussian, 2= Cosine-tapered window. |
demean |
Remove mean from data series? (T or F) |
detrend |
Remove linear trend from data series? (T or F) |
addmean |
Add mean value to bandpass result? (T or F) |
alpha |
Gaussian window parameter: alpha is 1/stdev, a measure of the width of the Dirichlet kernal. Larger values decrease the width of data window, reduce discontinuities, and increase width of the transform. Choose alpha >= 2.5. |
p |
Cosine-tapered window parameter: p is the percent of the data series tapered (choose 0-1). |
xmin |
Smallest frequency for plotting. |
xmax |
Largest frequency for plotting. |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
bandpass
, noKernel
, noLow
, prewhiteAR
, prewhiteAR1
, and taner
# generate example series with periods of 405 ka, 100 ka, 40ka, and 20 ka, plus noise ex=cycles(freqs=c(1/405,1/100,1/40,1/20),end=1000,dt=5,noisevar=.1) # lowpass filter eccentricity terms using cosine-tapered window lowpass_ex=lowpass(ex,fcut=.02,win=2,p=.4) # highpass filter obliquity and precession terms using cosine-tapered window # if you'd like the final notch filtered record to be centered on the mean proxy # value, set addmean=FALSE highpass_ex=lowpass(ex,fcut=.02,win=2,p=.4,addmean=FALSE) highpass_ex[2] <- ex[2]-highpass_ex[2] pl(2) plot(ex,type="l",main="Eccentricity+Obliquity+Precession") plot(highpass_ex,type="l",main="Obliquity+Precession highpassed signal")
# generate example series with periods of 405 ka, 100 ka, 40ka, and 20 ka, plus noise ex=cycles(freqs=c(1/405,1/100,1/40,1/20),end=1000,dt=5,noisevar=.1) # lowpass filter eccentricity terms using cosine-tapered window lowpass_ex=lowpass(ex,fcut=.02,win=2,p=.4) # highpass filter obliquity and precession terms using cosine-tapered window # if you'd like the final notch filtered record to be centered on the mean proxy # value, set addmean=FALSE highpass_ex=lowpass(ex,fcut=.02,win=2,p=.4,addmean=FALSE) highpass_ex[2] <- ex[2]-highpass_ex[2] pl(2) plot(ex,type="l",main="Eccentricity+Obliquity+Precession") plot(highpass_ex,type="l",main="Obliquity+Precession highpassed signal")
LOWSPEC: Robust Locally-Weighted Regression Spectral Background Estimation (Meyers, 2012)
lowspec(dat,decimate=NULL,tbw=3,padfac=5,detrend=F,siglevel=0.9,setrho, lowspan,b_tun,output=0,CLpwr=T,xmin,xmax,pl=1,sigID=T,genplot=T, verbose=T)
lowspec(dat,decimate=NULL,tbw=3,padfac=5,detrend=F,siglevel=0.9,setrho, lowspan,b_tun,output=0,CLpwr=T,xmin,xmax,pl=1,sigID=T,genplot=T, verbose=T)
dat |
Stratigraphic series for LOWSPEC. First column should be location (e.g., depth), second column should be data value. |
decimate |
Decimate statigraphic series to have this sampling interval (via piecewise linear interpolation). By default, no decimation is performed. |
tbw |
MTM time-bandwidth product (2 or 3 permitted) |
padfac |
Pad with zeros to (padfac*npts) points, where npts is the original number of data points. |
detrend |
Remove linear trend from data series? This detrending is performed following AR1 prewhitening. (T or F) |
siglevel |
Significance level for peak identification. (0-1) |
setrho |
Define AR1 coefficient for pre-whitening (otherwise calculated). If set to 0, no pre-whitening is applied. |
lowspan |
Span for LOWESS smoothing of prewhitened signal, usually fixed to 1. If using value <1, the method is overly conservative with a reduced false positive rate. |
b_tun |
Robustness weight parameter for LOWSPEC. By default, this will be estimated internally. |
output |
What should be returned as a data frame? (0=nothing; 1=pre-whitened spectrum + harmonic F-test CL + LOWSPEC background + LOWSPEC CL + 90%-99% LOWSPEC power levels; 2=sig peaks) |
CLpwr |
Plot LOWSPEC noise confidence levels on power spectrum? (T or F) |
xmin |
Smallest frequency for plotting. |
xmax |
Largest frequency for plotting. |
pl |
Power spectrum plotting: (1) linear frequency-log spectral power, (2) linear frequency-linear spectral power (3) log frequency-log spectral power, (4) log frequency-linear spectral power |
sigID |
Identify significant frequencies on power and probabilty plots? (T or F) |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
LOWSPEC is a 'robust' method for spectral background estimation, designed for the identification of potential astronomical signals that are imbedded in red noise (Meyers, 2012). The complete algoritm implemented here is as follows: (1) initial pre-whitening with AR1 filter (default) or other filter as appropriate (e.g., see function prewhiteAR), (2) power spectral estimation via the multitaper method (Thomson, 1982), (3) robust locally weighted estimation of the spectral background using the LOWESS-based (Cleveland, 1979) procedure of Ruckstuhl et al. (2001), (4) assignment of confidence levels using a Chi-square distribution.
NOTE: If you choose to pre-whiten before running LOWSPEC (rather than using the default AR1 pre-whitening), specify setrho=0.
Candidiate astronomical cycles are subsequently identified via isolation of those frequencies that achieve the required (e.g., 90 percent) LOWSPEC confidence level and MTM harmonic F-test confidence level. Allowance is made for the smoothing inherent in the MTM power spectral estimate as compared to the MTM harmonic spectrum. That is, an F-test peak is reported if it achieves the required MTM harmonic confidence level, while also achieving the required LOWSPEC confidence level within +/- half the power spectrum bandwidth resolution. One additional criterion is included to further reduce the false positive rate, a requirement that significant F-tests must occur on a local power spectrum high, which is parameterized as occurring above the local LOWSPEC background estimate. See Meyers (2012) for futher information on the algorithm.
In this implementation, the 'robustness criterion' ('b' in EQ. 6 of Ruckstuhl et al., 2001) has been optimized for 2 and 3 pi DPSS, using a 'span' of 1. By default the robustness criterion will be estimated. Both 'b' and the 'span' can be expliclty set using parameters 'b_tun' and 'lowspan'. Note that it is permissible to decrease 'lowspan' from its default value, but this will result in an overly conservative false positive rate. However, it may be necessary to reduce 'lowspan' to provide an approporiate background fit for some stratigraphic data. Other options include decimating the data series prior to spectral estimation, or using an alternative pre-whitening filter (e.g., see function prewhiteAR).
Note that the 'rfbaseline' function in package 'IDPmisc' (Locher, 2024) is used for implementation of the procedure of Ruckstuhl et al. (2001).
If option 1 is selected, a data frame containing the following is returned: Frequency, Prewhitened power, harmonic F-test CL, LOWSPEC CL, LOWSPEC background, 90%-99% LOWSPEC power levels. NOTE: as of version 0.8, the order of the columns in the output data frame has been changed, for consistency with functions mtm, mtmML96, and mtmPL.
If option 2 is selected, the 'significant' frequencies are returned (as described above).
W.S. Cleveland, 1979, Locally weighted regression and smoothing scatterplots: Journal of the American Statistical Association, v. 74, p. 829-836.
Locher R (2024). IDPmisc: 'Utilities of Institute of Data Analyses and Process Design (www.zhaw.ch/idp)'. R package version 1.1.21, https://CRAN.R-project.org/package=IDPmisc.
S.R. Meyers, 2012, Seeing Red in Cyclic Stratigraphy: Spectral Noise Estimation for Astrochronology: Paleoceanography, 27, PA3228, doi:10.1029/2012PA002307.
A.F. Ruckstuhl, M.P Jacobson, R.W. Field, and J.A. Dodd, 2001, Baseline subtraction using robust local regression estimation: Journal of Quantitative Spectroscopy & Radiative Transfer, v. 68, p. 179-193.
D.J. Thomson, 1982, Spectrum estimation and harmonic analysis: IEEE Proceedings, v. 70, p. 1055-1096.
eha
, mtm
, mtmAR
, mtmML96
, periodogram
# generate example series with periods of 400 ka, 100 ka, 40 ka and 20 ka ex = cycles(freqs=c(1/400,1/100,1/40,1/20),start=1,end=1000,dt=5) # add AR1 noise noise = ar1(npts=200,dt=5,sd=.5) ex[2] = ex[2] + noise[2] # LOWSPEC analysis pl(1, title="lowspec") lowspec(ex) # compare to MTM spectral analysis, with conventional AR1 noise test pl(1,title="mtm") mtm(ex,ar1=TRUE) # compare to ML96 analysis pl(1, title="mtmML96") mtmML96(ex) # compare to amplitudes from eha pl(1,title="eha") eha(ex,tbw=3,win=1000,pad=1000)
# generate example series with periods of 400 ka, 100 ka, 40 ka and 20 ka ex = cycles(freqs=c(1/400,1/100,1/40,1/20),start=1,end=1000,dt=5) # add AR1 noise noise = ar1(npts=200,dt=5,sd=.5) ex[2] = ex[2] + noise[2] # LOWSPEC analysis pl(1, title="lowspec") lowspec(ex) # compare to MTM spectral analysis, with conventional AR1 noise test pl(1,title="mtm") mtm(ex,ar1=TRUE) # compare to ML96 analysis pl(1, title="mtmML96") mtmML96(ex) # compare to amplitudes from eha pl(1,title="eha") eha(ex,tbw=3,win=1000,pad=1000)
Generate noise surrogates from a theoretical power spectrum.
makeNoise(S,dt=1,mean=0,sdev=1,addPt=F,nsim=1,genplot=T,verbose=T)
makeNoise(S,dt=1,mean=0,sdev=1,addPt=F,nsim=1,genplot=T,verbose=T)
S |
Vector or 1-D data frame containing the theoretical power, from f(0) to the Nyquist frequency. |
dt |
Sampling interval for surrogate series |
mean |
Mean value for surrogate series |
sdev |
Standard deviation for surrogate series |
addPt |
Did you add a Nyquist frequency? (T or F) |
nsim |
Number of surrogate series to generate |
genplot |
generate summary plots (T or F) |
verbose |
verbose output (T or F) |
These simulations use the random number generator of Matsumoto and Nishimura [1998]. The algorithm of Timmer and Konig (1995) is employed to generate surrogates from any arbitrary theoretical power spectrum. See examples section below.
M. Matsumoto, and T. Nishimura, (1998), Mersenne Twister: A 623-dimensionally equidistributed uniform pseudo-random number generator, ACM Transactions on Modeling and Computer Simulation, 8, 3-30.
J. Timmer and K. Konig (1995), On Generating Power Law Noise, Astronomy and Astrophysics: v. 300, p. 707-710.
# create theoretical AR1 spectrum, using rho of 0.8 rho=0.8 freq=seq(0,.5,by=0.005) Nyq=max(freq) AR1 = (1-(rho^2)) / ( 1 - (2*rho*cos(pi*freq/Nyq)) + (rho^2) ) plot(freq,AR1,type="l") # make noise surrogates from the theoretical AR1 spectrum makeNoise(AR1)
# create theoretical AR1 spectrum, using rho of 0.8 rho=0.8 freq=seq(0,.5,by=0.005) Nyq=max(freq) AR1 = (1-(rho^2)) / ( 1 - (2*rho*cos(pi*freq/Nyq)) + (rho^2) ) plot(freq,AR1,type="l") # make noise surrogates from the theoretical AR1 spectrum makeNoise(AR1)
Example stratigraphic model series.
data(modelA)
data(modelA)
Height (meters), weight percent CaCO3
Multitaper method (MTM) spectral analysis (Thomson, 1982)
mtm(dat,tbw=3,ntap=NULL,padfac=5,demean=T,detrend=F,siglevel=0.9,ar1=T,output=0, CLpwr=T,xmin,xmax,pl=1,sigID=T,genplot=T,verbose=T)
mtm(dat,tbw=3,ntap=NULL,padfac=5,demean=T,detrend=F,siglevel=0.9,ar1=T,output=0, CLpwr=T,xmin,xmax,pl=1,sigID=T,genplot=T,verbose=T)
dat |
Stratigraphic series for MTM spectral analysis. First column should be location (e.g., depth), second column should be data value. |
tbw |
MTM time-bandwidth product. |
ntap |
Number of DPSS tapers to use. By default, this is set to (2*tbw)-1. |
padfac |
Pad with zeros to (padfac*npts) points, where npts is the original number of data points. |
demean |
Remove mean from data series? (T or F) |
detrend |
Remove linear trend from data series? (T or F) |
siglevel |
Significance level for peak identification. (0-1) |
ar1 |
Estimate conventional AR(1) noise spectrum and confidence levels? (T or F) |
CLpwr |
Plot AR(1) noise confidence levels on power spectrum? (T or F) |
output |
What should be returned as a data frame? (0=nothing; 1= power spectrum + harmonic CL + AR1 CL + AR1 fit + 90%-99% AR1 power levels (ar1 must be set to TRUE to output AR model results); 2=significant peak frequencies; 3=significant peak frequencies + harmonic CL; 4=internal variables from spec.mtm). Option 4 is intended for expert users, and should generally be avoided. |
xmin |
Smallest frequency for plotting. |
xmax |
Largest frequency for plotting. |
pl |
Power spectrum plotting: (1) linear frequency-log spectral power, (2) linear frequency-linear spectral power (3) log frequency-log spectral power, (4) log frequency-linear spectral power |
sigID |
Identify significant frequencies on power and probabilty plots? (T or F) |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
The power spectrum normalization approach applied here divides the Fourier coefficients by the number of points (npts) in the stratigraphic series, which is equivalent to dividing the power by (npts*npts). The (npts*npts) normalization has the convenient property whereby – for an unpadded series – the sum of the power in the positive frequencies is equivalent to half of variance; the other half of the variance is in the negative frequencies.
If ar1=T, candidiate astronomical cycles are identified via isolation of those frequencies that achieve the required (e.g., 90 percent) "red noise" confidence level and MTM harmonic F-test confidence level. Allowance is made for the smoothing inherent in the MTM power spectral estimate as compared to the MTM harmonic spectrum. That is, an F-test peak is reported if it achieves the required MTM harmonic confidence level, while also achieving the required red noise confidence level within +/- half the power spectrum bandwidth resolution. One additional criterion is included to further reduce the false positive rate, a requirement that significant F-tests must occur on a local power spectrum high, which is parameterized as occurring above the local red noise background estimate. See Meyers (2012) for futher information.
Note that the 'spec.mtm' function in package 'multitaper' (Rahim et al., 2014) is used for MTM spectrum estimation.
S.R. Meyers, 2012, Seeing Red in Cyclic Stratigraphy: Spectral Noise Estimation for Astrochronology: Paleoceanography, 27, PA3228, doi:10.1029/2012PA002307.
Rahim, K.J. and Burr W.S. and Thomson, D.J., 2014, Applications of Multitaper Spectral Analysis to Nonstationary Data. PhD thesis, Queen's University. R package version 1.0-17, https://CRAN.R-project.org/package=multitaper.
Thomson, D. J., 1982, Spectrum estimation and harmonic analysis, Proc. IEEE, 70, 1055-1096, doi:10.1109/PROC.1982.12433.
eha
, lowspec
, mtmAR
, mtmML96
, periodogram
# generate example series with periods of 400 ka, 100 ka, 40 ka and 20 ka ex = cycles(freqs=c(1/400,1/100,1/40,1/20),start=1,end=1000,dt=5) # add AR1 noise noise = ar1(npts=200,dt=5,sd=.5) ex[2] = ex[2] + noise[2] # MTM spectral analysis, with conventional AR1 noise test pl(1,title="mtm") mtm(ex,ar1=TRUE) # compare to ML96 analysis pl(1, title="mtmML96") mtmML96(ex) # compare to analysis with LOWSPEC pl(1, title="lowspec") lowspec(ex) # compare to amplitudes from eha pl(1,title="eha") eha(ex,tbw=3,win=1000,pad=1000)
# generate example series with periods of 400 ka, 100 ka, 40 ka and 20 ka ex = cycles(freqs=c(1/400,1/100,1/40,1/20),start=1,end=1000,dt=5) # add AR1 noise noise = ar1(npts=200,dt=5,sd=.5) ex[2] = ex[2] + noise[2] # MTM spectral analysis, with conventional AR1 noise test pl(1,title="mtm") mtm(ex,ar1=TRUE) # compare to ML96 analysis pl(1, title="mtmML96") mtmML96(ex) # compare to analysis with LOWSPEC pl(1, title="lowspec") lowspec(ex) # compare to amplitudes from eha pl(1,title="eha") eha(ex,tbw=3,win=1000,pad=1000)
Perform the 'intermediate spectrum test' of Thomson et al. (2001).
Paraphrased from Thomson et al. (2001): Form an intermediate spectrum by dividing MTM by AR estimate. Choose an order P for a predictor. A variety of formal methods are available in the literature, but practically, one keeps increasing P (the order) until the range of the intermediate spectrum Si(f) (equation (C4) of Thomson et al., 2001) stops decreasing rapidly as a function of P. If the intermediate spectrum is not roughly white, as judged by the minima, the value of P should be increased.
mtmAR(dat,tbw=3,ntap=NULL,order=1,method="mle",CItype=1,padfac=5,demean=T,detrend=F, output=1,xmin=0,xmax=Nyq,pl=1,genplot=T,verbose=T)
mtmAR(dat,tbw=3,ntap=NULL,order=1,method="mle",CItype=1,padfac=5,demean=T,detrend=F, output=1,xmin=0,xmax=Nyq,pl=1,genplot=T,verbose=T)
dat |
Stratigraphic series for analysis. First column should be location (e.g., depth), second column should be data value. |
tbw |
MTM time-bandwidth product. |
ntap |
Number of DPSS tapers to use. By default, this is set to (2*tbw)-1. |
order |
Order of the AR spectrum. |
method |
AR method ("yule-walker", "burg", "ols", "mle", "yw") |
CItype |
Illustrate (1) one-sided or (2) two-sided confidence intervals on plots |
padfac |
Pad with zeros to (padfac*npts) points, where npts is the original number of data points. |
demean |
Remove mean from data series? (T or F) |
detrend |
Remove linear trend from data series? (T or F) |
output |
Output (1) intermediate spectrum and confidence levels, (2) intermediate spectrum, (3) confidence levels |
xmin |
Smallest frequency for plotting. |
xmax |
Largest frequency for plotting. |
pl |
Plot logarithm of spectral power (1) or linear spectral power (2)? |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
The power spectrum normalization approach applied here divides the Fourier coefficients by the number of points (npts) in the stratigraphic series, which is equivalent to dividing the power by (npts*npts). The (npts*npts) normalization has the convenient property whereby – for an unpadded series – the sum of the power in the positive frequencies is equivalent to half of variance; the other half of the variance is in the negative frequencies.
Note that the 'spec.mtm' function in package 'multitaper' (Rahim et al., 2014) is used for MTM spectrum estimation.
Rahim, K.J. and Burr W.S. and Thomson, D.J., 2014, Applications of Multitaper Spectral Analysis to Nonstationary Data. PhD thesis, Queen's University. R package version 1.0-17, https://CRAN.R-project.org/package=multitaper.
Thomson, D. J., L. J. Lanzerotti, and C. G. Maclennan, 2001, The interplanetary magnetic field: Statistical properties and discrete modes, J. Geophys.Res., 106, 15,941-15,962, doi:10.1029/2000JA000113.
eha
, lowspec
, mtm
, mtmML96
, and periodogram
# generate example series with periods of 400 ka, 100 ka, 40 ka and 20 ka ex = cycles(freqs=c(1/400,1/100,1/40,1/20),start=1,end=1000,dt=5) # add AR1 noise noise = ar1(npts=200,dt=5,sd=.5) ex[2] = ex[2] + noise[2] # MTM spectral analysis, with conventional AR1 noise test pl(1,title="mtmAR") mtmAR(ex)
# generate example series with periods of 400 ka, 100 ka, 40 ka and 20 ka ex = cycles(freqs=c(1/400,1/100,1/40,1/20),start=1,end=1000,dt=5) # add AR1 noise noise = ar1(npts=200,dt=5,sd=.5) ex[2] = ex[2] + noise[2] # MTM spectral analysis, with conventional AR1 noise test pl(1,title="mtmAR") mtmAR(ex)
Mann and Lees (1996) robust red noise MTM analysis. This function implements several improvements to the algorithm used in SSA-MTM toolkit, including faster AR1 model optimization, and more appropriate 'edge-effect' treatment.
mtmML96(dat,tbw=3,ntap=NULL,padfac=5,demean=T,detrend=F,medsmooth=0.2, opt=1,linLog=2,siglevel=0.9,output=0,CLpwr=T,xmin=0,xmax=Nyq, sigID=T,pl=1,genplot=T,verbose=T)
mtmML96(dat,tbw=3,ntap=NULL,padfac=5,demean=T,detrend=F,medsmooth=0.2, opt=1,linLog=2,siglevel=0.9,output=0,CLpwr=T,xmin=0,xmax=Nyq, sigID=T,pl=1,genplot=T,verbose=T)
dat |
Stratigraphic series for MTM spectral analysis. First column should be location (e.g., depth), second column should be data value. |
tbw |
MTM time-bandwidth product. |
ntap |
Number of DPSS tapers to use. By default, this is set to (2*tbw)-1. |
padfac |
Pad with zeros to (padfac*npts) points, where npts is the original number of data points. |
demean |
Remove mean from data series? (T or F) |
detrend |
Remove linear trend from data series? (T or F) |
medsmooth |
ML96 median smoothing parameter (1 = use 100% of spectrum; 0.20 = use 20%) |
opt |
Optimization method for robust AR1 model estimation (1=Brent's method:fast, 2=Gauss-Newton:fast, 3=grid search:slow) |
linLog |
Optimize AR1 model fit using (1) linear power or (2) log(power)? |
siglevel |
Significance level for peak identification. (0-1) |
output |
What should be returned as a data frame? (0=nothing; 1= power spectrum + harmonic CL + AR1 CL + AR1 fit + 90%-99% AR1 power levels + median smoothed spectrum; 2=significant peak frequencies; 3=significant peak frequencies + harmonic CL) |
CLpwr |
Plot ML96 AR(1) noise confidence levels on power spectrum? (T or F) |
xmin |
Smallest frequency for plotting. |
xmax |
Largest frequency for plotting. |
sigID |
Identify significant frequencies on power and probabilty plots? (T or F) |
pl |
Power spectrum plotting: (1) linear frequency-log spectral power, (2) linear frequency-linear spectral power (3) log frequency-log spectral power, (4) log frequency-linear spectral power |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
This function conducts the Mann and Lees (1996; ML96) "robust red noise" analysis, with an improved median smoothing approach. The original Mann and Lees (1996) approach applies a truncation of the median smoothing window to include fewer frequencies near the edges of the spectrum; while truncation is required, its implementation in the original method often results in an "edge effect" that can produce excess false positive rates at low frequencies, commonly within the eccentricity-band (Meyers, 2012).
To help address this issue, an alternative median smoothing approach is applied that implements Tukey's robust end-point rule and symmetrical medians (see the function runmed for details). Numerical experiments indicate that this approach produces an approximately uniform false positive rate across the spectrum. It should be noted that the false positive rates are still inflated with this method, but they are substantially reduced compared to the original ML96 approach. For example, simulations using rho=0.9 (using identical parameters to those in Meyers, 2012) yield median false positive rates of 1.7%, 7.3% and 13.4%, for the 99%, 95% and 90% confidence levels (respectively). This compares with 4.7%, 11.4% and 17.8% using the original approach (see Table 2 of Meyers, 2012).
Candidiate astronomical cycles are identified via isolation of those frequencies that achieve the required (e.g., 90 percent) "robust red noise" confidence level and MTM harmonic F-test confidence level. Allowance is made for the smoothing inherent in the MTM power spectral estimate as compared to the MTM harmonic spectrum. That is, an F-test peak is reported if it achieves the required MTM harmonic confidence level, while also achieving the required robust red noise confidence level within +/- half the power spectrum bandwidth resolution. One additional criterion is included to further reduce the false positive rate, a requirement that significant F-tests must occur on a local power spectrum high, which is parameterized as occurring above the local robust red noise background estimate. See Meyers (2012) for futher information.
The power spectrum normalization approach applied here divides the Fourier coefficients by the number of points (npts) in the stratigraphic series, which is equivalent to dividing the power by (npts*npts). The (npts*npts) normalization has the convenient property whereby – for an unpadded series – the sum of the power in the positive frequencies is equivalent to half of variance; the other half of the variance is in the negative frequencies.
NOTES: If the (fast) Brent or Gauss-Newton methods fail, use the (slow) grid search approach. The function 'spec.mtm' in package 'multitaper' (Rahim et al., 2014) is used for MTM spectrum estimation.
This version of the ML96 algorithm was first implemented in Patterson et al. (2014).
Mann, M.E., and Lees, J.M., 1996, Robust estimation of background noise and signal detection in climatic time series, Clim. Change, 33, 409-445.
Meyers, S.R., 2012, Seeing red in cyclic stratigraphy: Spectral noise estimation for astrochronology, Paleoceanography, 27, PA3228.
M.O. Patterson, R. McKay, T. Naish, C. Escutia, F.J. Jimenez-Espejo, M.E. Raymo, M.E., S.R. Meyers, L. Tauxe, H. Brinkhuis, and IODP Expedition 318 Scientists,2014, Response of the East Antarctic Ice Sheet to orbital forcing during the Pliocene and Early Pleistocene, Nature Geoscience, v. 7, p. 841-847.
Rahim, K.J. and Burr W.S. and Thomson, D.J., 2014, Applications of Multitaper Spectral Analysis to Nonstationary Data. PhD thesis, Queen's University. R package version 1.0-17, https://CRAN.R-project.org/package=multitaper.
Thomson, D. J., 1982, Spectrum estimation and harmonic analysis, Proc. IEEE, 70, 1055-1096, doi:10.1109/PROC.1982.12433.
http://www.meteo.psu.edu/holocene/public_html/Mann/tools/MTM-RED/
Tukey, J.W., 1977, Exploratory Data Analysis, Addison.
eha
, lowspec
, mtm
, mtmAR
, periodogram
, and runmed
# generate example series with periods of 400 ka, 100 ka, 40 ka and 20 ka ex = cycles(freqs=c(1/400,1/100,1/40,1/20),start=1,end=1000,dt=5) # add AR1 noise noise = ar1(npts=200,dt=5,sd=0.5) ex[2] = ex[2] + noise[2] # run ML96 analysis pl(1, title="mtmML96") mtmML96(ex) # compare to analysis with conventional AR1 noise test pl(1,title="mtm") mtm(ex) # compare to analysis with LOWSPEC pl(1, title="lowspec") lowspec(ex) # compare to amplitudes from eha pl(1,title="eha") eha(ex,tbw=3,win=1000,pad=1000)
# generate example series with periods of 400 ka, 100 ka, 40 ka and 20 ka ex = cycles(freqs=c(1/400,1/100,1/40,1/20),start=1,end=1000,dt=5) # add AR1 noise noise = ar1(npts=200,dt=5,sd=0.5) ex[2] = ex[2] + noise[2] # run ML96 analysis pl(1, title="mtmML96") mtmML96(ex) # compare to analysis with conventional AR1 noise test pl(1,title="mtm") mtm(ex) # compare to analysis with LOWSPEC pl(1, title="lowspec") lowspec(ex) # compare to amplitudes from eha pl(1,title="eha") eha(ex,tbw=3,win=1000,pad=1000)
Multitaper Method (MTM) Spectral Analysis with Power Law (1/f) fit
mtmPL(dat,tbw=3,ntap=NULL,padfac=5,demean=T,detrend=F,siglevel=0.9,flow=NULL,fhigh=NULL, output=0,CLpwr=T,xmin=0,xmax=Nyq,pl=1,sigID=F,genplot=T,verbose=T)
mtmPL(dat,tbw=3,ntap=NULL,padfac=5,demean=T,detrend=F,siglevel=0.9,flow=NULL,fhigh=NULL, output=0,CLpwr=T,xmin=0,xmax=Nyq,pl=1,sigID=F,genplot=T,verbose=T)
dat |
Stratigraphic series for MTM spectral analysis. First column should be location (e.g., depth), second column should be data value. |
tbw |
MTM time-bandwidth product. |
ntap |
Number of DPSS tapers to use. By default, this is set to (2*tbw)-1. |
padfac |
Pad with zeros to (padfac*npts) points, where npts is the original number of data points. |
demean |
Remove mean from data series? (T or F) |
detrend |
Remove linear trend from data series? (T or F) |
siglevel |
Significance level for peak identification. |
flow |
Lowest frequency to include in 1/f fit |
fhigh |
Highest frequency to include in 1/f fit |
output |
What should be returned as a data frame? (0=nothing; 1=spectrum + CLs + power law fit; 2=sig peak freqs; 3=sig peak freqs + prob; 4=all) |
CLpwr |
Plot power law noise confidence levels on power spectrum (in addition to the power law fit)? (T or F) |
xmin |
Smallest frequency for plotting. |
xmax |
Largest frequency for plotting. |
pl |
Power spectrum plotting: (1) linear frequency-log spectral power, (2) linear frequency-linear spectral power (3) log frequency-log spectral power, (4) log frequency-linear spectral power |
sigID |
Identify signficant frequencies on power and probabilty plots? (T or F) |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
Candidiate astronomical cycles are identified via isolation of those frequencies that achieve the required (e.g., 90 percent) power law confidence level and MTM harmonic F-test confidence level. Allowance is made for the smoothing inherent in the MTM power spectral estimate as compared to the MTM harmonic spectrum. That is, an F-test peak is reported if it achieves the required MTM harmonic confidence level, while also achieving the required power law confidence level within +/- half the power spectrum bandwidth resolution. One additional criterion is included to further reduce the false positive rate, a requirement that significant F-tests must occur on a local power spectrum high, which is parameterized as occurring above the local red noise background estimate. See Meyers (2012) for futher information.
The power spectrum normalization approach applied here divides the Fourier coefficients by the number of points (npts) in the stratigraphic series, which is equivalent to dividing the power by (npts*npts). The (npts*npts) normalization has the convenient property whereby – for an unpadded series – the sum of the power in the positive frequencies is equivalent to half of variance; the other half of the variance is in the negative frequencies.
Note that the 'spec.mtm' function in package 'multitaper' (Rahim et al., 2014) is used for MTM spectrum estimation.
S.R. Meyers, 2012, Seeing Red in Cyclic Stratigraphy: Spectral Noise Estimation for Astrochronology: Paleoceanography, 27, PA3228, doi:10.1029/2012PA002307.
Rahim, K.J. and Burr W.S. and Thomson, D.J., 2014, Appendix A: Multitaper R package in "Applications of Multitaper Spectral Analysis to Nonstationary Data", PhD diss., Queen's Univieristy, pp 149-183. http://hdl.handle.net/1974/12584
Thomson, D. J., 1982, Spectrum estimation and harmonic analysis, Proc. IEEE, 70, 1055-1096, doi:10.1109/PROC.1982.12433.
eha
, lowspec
, mtm
, mtmAR
, mtmML96
, and periodogram
Adjust spectral p-values for multiple comparisons, using a range of approaches.
multiTest(spec,flow=NULL,fhigh=NULL,pl=T,output=T,genplot=T,verbose=T)
multiTest(spec,flow=NULL,fhigh=NULL,pl=T,output=T,genplot=T,verbose=T)
spec |
A data frame with two columns: frequency, uncorrected confidence level. If more than 2 columns are input, the results are assumed to come from periodogram, mtm, mtmML96, lowspec or mtmPL. |
flow |
Vector of lower bounds for each frequency band of interest. Order must match fhigh. |
fhigh |
Vector of upper bounds for each frequency band of interest. Order must match flow. |
pl |
Include graphs of uncorrected p-values? (T or F) |
output |
Return results as new data frame? (T or F) |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
Multiple testing is a common problem in the evaluation of power spectrum peaks (Vaughan et al., 2011; Crampton et al., PNAS). To address the issue of multiple testing, a range of approaches have been advocated. This function will conduct an assessment using six approaches: Bonferroni, Holm (1979), Hochberg (1998), Hommel (1988), Benjamini & Hochberg (1995, a.k.a. "false discovery rate"), Benjamini & Yekutieli (2001, a.k.a. "false discovery rate"). See the function p.adjust for additional information on these six approaches.
In conducting these assessments, it is important that the spectral analysis is conducted without zero-padding. If one is exclusively concerned with particular frequency bands a priori (e.g., those associated with Milankovitch cycles), the statistical power of the method can be improved by restricting the analysis to those frequency bands (use options 'flow' and 'fhigh').
Application of these multiple testing corrections does not guarantee that the spectral background is appropriate. To address this issue, carefully examine the fit of the spectral background, and also conduct simulations with the function testBackground.
Y. Benjamini, and Y. Hochberg, 1995, Controlling the false discovery rate: a practical and powerful approach to multiple testing. Journal of the Royal Statistical Society Series B 57, 289-300.
Y. Benjamini, and D. Yekutieli, 2001, The control of the false discovery rate in multiple testing under dependency. Annals of Statistics 29, 1165-1188.
J.S. Campton, S.R. Meyers, R.A. Cooper, P.M Sadler, M. Foote, D. Harte, 2018, Pacing of Paleozoic macroevolutionary rates by Milankovitch grand cycles: Proceedings of the National Academy of Sciences, doi:10.1073/pnas.1714342115.
S. Holm, 1979, A simple sequentially rejective multiple test procedure. Scandinavian Journal of Statistics 6, 65-70.
G. Hommel, 1988, A stagewise rejective multiple test procedure based on a modified Bonferroni test. Biometrika 75, 383-386.
Y. Hochberg, 1988, A sharper Bonferroni procedure for multiple tests of significance. Biometrika 75, 800-803.
J.P. Shaffer, 1995, Multiple hypothesis testing. Annual Review of Psychology 46, 561-576. (An excellent review of the area.)
S. Vaughan, R.J. Bailey, and D.G. Smith, 2011, Detecting cycles in stratigraphic data: Spectral analysis in the presence of red noise. Paleoceanography 26, PA4211, doi:10.1029/2011PA002195.
p.adjust
,testBackground
,confAdjust
,lowspec
, mtm
, mtmML96
, mtmPL
, and periodogram
# generate example series with periods of 400 ka, 100 ka, 40 ka and 20 ka ex = cycles(freqs=c(1/400,1/100,1/40,1/20),start=1,end=1000,dt=5) # add AR1 noise noise = ar1(npts=200,dt=5,sd=.5) ex[2] = ex[2] + noise[2] # first, let's look at mtm with conventional AR1 background spec=mtm(ex,padfac=1,ar1=TRUE,output=1) # when blindly prospecting for cycles, it is necessary to consider all of the # observed frequencies in the test multiTest(cb(spec,c(1,4)),output=FALSE) # if, a priori, you are only concerned with the Milankovitch frequency bands, # restrict your analysis to those bands (as constrained by available sedimentation # rate estimates and the frequency resolution of the spectrum). in the example below, # the mtm bandwidth resolution is employed to search frequencies nearby the # Milankovitch-target periods. flow=c((1/400)-0.003,(1/100)-0.003,(1/41)-0.003,(1/20)-0.003) fhigh=c((1/400)+0.003,(1/100)+0.003,(1/41)+0.003,(1/20)+0.003) multiTest(cb(spec,c(1,4)),flow=flow,fhigh=fhigh,output=FALSE) # now try with the lowspec method. this uses prewhitening, so it has one less data point. spec=lowspec(ex,padfac=1,output=1) flow=c((1/400)-0.003015075,(1/100)-0.003015075,(1/41)-0.003015075,(1/20)-0.003015075) fhigh=c((1/400)+0.003015075,(1/100)+0.003015075,(1/41)+0.003015075,(1/20)+0.003015075) multiTest(cb(spec,c(1,4)),flow=flow,fhigh=fhigh,output=FALSE) # for comparison... multiTest(cb(spec,c(1,4)),output=FALSE)
# generate example series with periods of 400 ka, 100 ka, 40 ka and 20 ka ex = cycles(freqs=c(1/400,1/100,1/40,1/20),start=1,end=1000,dt=5) # add AR1 noise noise = ar1(npts=200,dt=5,sd=.5) ex[2] = ex[2] + noise[2] # first, let's look at mtm with conventional AR1 background spec=mtm(ex,padfac=1,ar1=TRUE,output=1) # when blindly prospecting for cycles, it is necessary to consider all of the # observed frequencies in the test multiTest(cb(spec,c(1,4)),output=FALSE) # if, a priori, you are only concerned with the Milankovitch frequency bands, # restrict your analysis to those bands (as constrained by available sedimentation # rate estimates and the frequency resolution of the spectrum). in the example below, # the mtm bandwidth resolution is employed to search frequencies nearby the # Milankovitch-target periods. flow=c((1/400)-0.003,(1/100)-0.003,(1/41)-0.003,(1/20)-0.003) fhigh=c((1/400)+0.003,(1/100)+0.003,(1/41)+0.003,(1/20)+0.003) multiTest(cb(spec,c(1,4)),flow=flow,fhigh=fhigh,output=FALSE) # now try with the lowspec method. this uses prewhitening, so it has one less data point. spec=lowspec(ex,padfac=1,output=1) flow=c((1/400)-0.003015075,(1/100)-0.003015075,(1/41)-0.003015075,(1/20)-0.003015075) fhigh=c((1/400)+0.003015075,(1/100)+0.003015075,(1/41)+0.003015075,(1/20)+0.003015075) multiTest(cb(spec,c(1,4)),flow=flow,fhigh=fhigh,output=FALSE) # for comparison... multiTest(cb(spec,c(1,4)),output=FALSE)
Calculate moving window correlation coefficient for two stratigraphic series, using a 'dynamic window'. This routine adjusts the number of data points in the window so it has a constant duration in time or space, for use with unevenly sampled data.
mwCor(dat,cols=NULL,win=NULL,conv=1,cormethod=1,output=T,pl=1,genplot=T,verbose=T)
mwCor(dat,cols=NULL,win=NULL,conv=1,cormethod=1,output=T,pl=1,genplot=T,verbose=T)
dat |
Your data frame containing stratigraphic data; any number of columns (variables) are permitted, but the first column should be a location identifier (e.g., depth, height, time). |
cols |
A vector that identifies the two variable columns to be extracted (first column automatically extracted). |
win |
Moving window size in units of space or time. |
conv |
Convention for window placement: (1) center each window on a stratigraphic level in 'dat' (DEFAULT), (2) start with the smallest location datum in 'dat', (3) start with the largest location datum in 'dat'. For options 2 and 3, the center of the window will not necessarily coincide with a measured stratigraphic level in 'dat', but edges of the data set are better preserved. |
cormethod |
Method used for calculation of correlation coefficient (1=Pearson, 2=Spearman, 3=Kendall) |
output |
Output results? (T or F) |
pl |
(1) Plot results at center of window, or (2) create "string of points plot" as in Sageman and Hollander (1999) |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
B.B. Sageman and D.H. Hollander, 1999, Cross correlation of paleoecological and geochemical proxies: A holistic approach to the study of past global change, in E. Barrera and C.C. Johnson, eds., GSA Special Paper 332, p. 365-384.
# generate example series ex <- cycles(freqs=c(1/40,1/20),noisevar=.2) # add second variable ex[3] <- cycles(freqs=c(1/40,1/20),noisevar=0.2)[2] # jitter sampling times ex[1]=ex[1]+rnorm(500,sd=1) # sort ex = ex[order(ex[,1],na.last=NA,decreasing=FALSE),] # run mwCor mwCor(ex,win=50)
# generate example series ex <- cycles(freqs=c(1/40,1/20),noisevar=.2) # add second variable ex[3] <- cycles(freqs=c(1/40,1/20),noisevar=0.2)[2] # jitter sampling times ex[1]=ex[1]+rnorm(500,sd=1) # sort ex = ex[order(ex[,1],na.last=NA,decreasing=FALSE),] # run mwCor mwCor(ex,win=50)
Determine start and end points for a moving window of fixed duration (e.g. 500 kiloyears). The dynamic window allows for adjustment of the number of data points in the window, so it has a constant duration in time or space.
mwin(dat,win,conv=1,verbose=T)
mwin(dat,win,conv=1,verbose=T)
dat |
Your data frame containing stratigraphic data; any number of columns (variables) are permitted, but the first column should be a location identifier (e.g., depth, height, time). |
win |
Moving window size in units of space or time. |
conv |
Convention for window placement: (1) center each window on a stratigraphic level in 'dat' (DEFAULT), (2) start with the smallest location datum in 'dat', (3) start with the largest location datum in 'dat'. For options 2 and 3, the center of the window will not necessarily coincide with a measured stratigraphic level in 'dat', but edges of the data set are better preserved. |
verbose |
Verbose output? (T or F) |
This algorithm steps forward one stratigraphic datum at a time. The output consists of:
Average = this is the average of the depth/time values in the given window.
Center = this is the center of the 'win' size window.
Midpoint = this is midpoint between first and last observation in the window (for unevenly sampled data this is typically less than than the size of 'win').
A data frame containing: Starting index for window, Ending index for window, Location (average), Location (center), Location (midpoint)
# generate some noise ex1 <- ar1(npts=50,dt=1) # jitter sampling times ex1[1]=ex1[1]+rnorm(50,sd=3) # sort ex1 = ex1[order(ex1[,1],na.last=NA,decreasing=FALSE),] # run mwin mwin(ex1,win=10)
# generate some noise ex1 <- ar1(npts=50,dt=1) # jitter sampling times ex1[1]=ex1[1]+rnorm(50,sd=3) # sort ex1 = ex1[order(ex1[,1],na.last=NA,decreasing=FALSE),] # run mwin mwin(ex1,win=10)
Determine start and end points for a moving window of fixed duration (e.g. 500 kiloyears). The dynamic window allows for adjustment of the number of data points in the window, so it has a constant duration in time or space. This version will output an evenly spaced spatial/temporal grid.
mwinGrid(dat,win,step,start=NULL,end=NULL,verbose=T)
mwinGrid(dat,win,step,start=NULL,end=NULL,verbose=T)
dat |
Your data frame containing stratigraphic data; any number of columns (variables) are permitted, but the first column should be a location identifier (e.g., depth, height, time). |
win |
Moving window size in units of space or time. |
step |
Step size for moving window, in units of space or time. |
start |
Start moving window at what depth/height/time; by default will use first value |
end |
End moving window at what depth/height/time; by default will use last value |
verbose |
Verbose output? (T or F) |
This algorithm is similar to function mwin, but instead of stepping forward one stratigraphic datum at a time, it generates an evenly spaced spatial/temporal grid.
A data frame containing: Starting index for window, Ending index for window, Location (center)
# generate some noise ex1 <- ar1(npts=50,dt=1) # jitter sampling times ex1[1]=ex1[1]+rnorm(50,sd=0.25) # sort ex1 = ex1[order(ex1[,1],na.last=NA,decreasing=FALSE),] # run mwin mwinGrid(ex1,win=10,step=2)
# generate some noise ex1 <- ar1(npts=50,dt=1) # jitter sampling times ex1[1]=ex1[1]+rnorm(50,sd=0.25) # sort ex1 = ex1[order(ex1[,1],na.last=NA,decreasing=FALSE),] # run mwin mwinGrid(ex1,win=10,step=2)
'Dynamic window' moving assessment of maxima and minima in stratigraphic series. This routine adjusts the number of data points in the window so it has a constant duration in time or space, for use with unevenly sampled data.
mwMinMax(dat,cols=NULL,win=NULL,conv=1,output=T,genplot=T,verbose=T)
mwMinMax(dat,cols=NULL,win=NULL,conv=1,output=T,genplot=T,verbose=T)
dat |
Your data frame containing stratigraphic data; any number of columns (variables) are permitted, but the first column should be a location identifier (e.g., depth, height, time). |
cols |
A vector that identifies the variable column to be extracted (first column automatically extracted). |
win |
Moving window size in units of space or time. |
conv |
Convention for window placement: (1) center each window on a stratigraphic level in 'dat' (DEFAULT), (2) start with the smallest location datum in 'dat', (3) start with the largest location datum in 'dat'. For options 2 and 3, the center of the window will not necessarily coincide with a measured stratigraphic level in 'dat', but edges of the data set are better preserved. |
output |
Output results? (T or F) |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
A data frame with five columns: Center of window, Minimum, Maximum, Maximum-Minimum, Number of points in window
# generate example series from ar1 noise, 5 kyr sampling interval ex = ar1(npts=1001,dt=5) # jitter sampling times ex[1]=ex[1]+rnorm(1001,sd=1) # sort ex = ex[order(ex[,1],na.last=NA,decreasing=FALSE),] # run mwStats mwMinMax(ex,win=100)
# generate example series from ar1 noise, 5 kyr sampling interval ex = ar1(npts=1001,dt=5) # jitter sampling times ex[1]=ex[1]+rnorm(1001,sd=1) # sort ex = ex[order(ex[,1],na.last=NA,decreasing=FALSE),] # run mwStats mwMinMax(ex,win=100)
'Dynamic window' moving average, median and variance of stratigraphic series. This routine adjusts the number of data points in the window so it has a constant duration in time or space, for use with unevenly sampled data.
mwStats(dat,cols=NULL,win=NULL,conv=1,ends=F,CI=0,output=T,genplot=T,verbose=T)
mwStats(dat,cols=NULL,win=NULL,conv=1,ends=F,CI=0,output=T,genplot=T,verbose=T)
dat |
Your data frame containing stratigraphic data; any number of columns (variables) are permitted, but the first column should be a location identifier (e.g., depth, height, time). |
cols |
A vector that identifies the variable column to be extracted (first column automatically extracted). |
win |
Moving window size in units of space or time. |
conv |
Convention for window placement: (1) center each window on a stratigraphic level in 'dat' (DEFAULT), (2) start with the smallest location datum in 'dat', (3) start with the largest location datum in 'dat'. For options 2 and 3, the center of the window will not necessarily coincide with a measured stratigraphic level in 'dat', but ends of the data set are better preserved. See options 'ends'. |
ends |
Assign average values to ends, by averaging data before first window, and averaging data after last window? (T or F; only applicable for conv=1) |
CI |
What confidence interval should be calculated for the average value (0-100 percent). If set to 0, the confidence interval calculation is skipped. |
output |
Output results? (T or F) |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
If conv=1 is selected, the edges of the record are determined using a smaller window size. A constant value is assigned based on the observed values within the first and last 0.5*win of the record.
A data frame with five or six columns: Center of window, Average, Median, Variance, Number of points in window. If CI>0, the sixth column is the value used to determine the confidence interval (add and subtract it from the average)
# generate example series from ar1 noise, 5 kyr sampling interval ex = ar1(npts=1001,dt=5) # jitter sampling times ex[1]=ex[1]+rnorm(1001,sd=1) # sort ex = ex[order(ex[,1],na.last=NA,decreasing=FALSE),] # run mwStats mwStats(ex,win=100)
# generate example series from ar1 noise, 5 kyr sampling interval ex = ar1(npts=1001,dt=5) # jitter sampling times ex[1]=ex[1]+rnorm(1001,sd=1) # sort ex = ex[order(ex[,1],na.last=NA,decreasing=FALSE),] # run mwStats mwStats(ex,win=100)
'Dynamic window' moving average, median and variance of stratigraphic series. This routine adjusts the number of data points in the window so it has a constant duration in time or space, for use with unevenly sampled data. The results are output on an evenly spaced spatial/temporal grid (this contrasts with mwStats).
mwStatsGrid(dat,cols=NULL,win=NULL,step=NULL,start=NULL,end=NULL,output=T,norm=F, palette=6,ncolors=100,genplot=1,verbose=T)
mwStatsGrid(dat,cols=NULL,win=NULL,step=NULL,start=NULL,end=NULL,output=T,norm=F, palette=6,ncolors=100,genplot=1,verbose=T)
dat |
Your data frame containing stratigraphic data; any number of columns (variables) are permitted, but the first column should be a location identifier (e.g., depth, height, time). |
cols |
A vector that identifies the variable column to be extracted (first column automatically extracted). |
win |
Moving window size, in units of space or time. |
step |
Moving window step size, in units of space or time. |
start |
Starting point for analysis, in units of space or time. |
end |
Ending point for analysis, in units of space or time. |
norm |
Normalize density estimates to maximum value? (T or F). If false, density estimates are normalized to unit area. |
output |
Output results? (T or F) |
palette |
What color palette would you like to use? (1) rainbow, (2) grayscale, (3) blue, (4) red, (5) blue-white-red, (6) viridis |
ncolors |
Number of colors to use in plot. |
genplot |
Generate summary plots? (0=none, 1=all time series, 2=kernel density estimates for each window, 3=kernel density estimates with median, 4=kernel density estimates with mean) |
verbose |
Verbose output? (T or F) |
A data frame with four columns: Center of window, Average, Median, Variance
# generate example series from ar1 noise, 5 kyr sampling interval ex = ar1(npts=1001,dt=5) # jitter sampling times ex[1]=ex[1]+rnorm(1001,sd=1) # sort ex = ex[order(ex[,1],na.last=NA,decreasing=FALSE),] # run mwStats mwStatsGrid(ex,win=100)
# generate example series from ar1 noise, 5 kyr sampling interval ex = ar1(npts=1001,dt=5) # jitter sampling times ex[1]=ex[1]+rnorm(1001,sd=1) # sort ex = ex[order(ex[,1],na.last=NA,decreasing=FALSE),] # run mwStats mwStatsGrid(ex,win=100)
Estimate trend and remove from stratigraphic series using a Gaussian kernel smoother
noKernel(dat,smooth=0.1,sort=F,output=1,genplot=T,verbose=T)
noKernel(dat,smooth=0.1,sort=F,output=1,genplot=T,verbose=T)
dat |
Stratigraphic series for smoothing. First column should be location (e.g., depth), second column should be data value. |
smooth |
Degree of smoothing with a Gaussian kernal (0 = no smoothing); for a value of 0.5, the kernel is scaled so that its quartiles (viewed as prob densities) are at +/- 25 percent of the data series length. Must be > 0. |
sort |
Sort data into increasing depth (required for ksmooth)? (T or F) |
output |
1= output residual values; 2= output Gaussian kernel smoother. |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
bandpass
, lowpass
, noLow
, prewhiteAR
, and prewhiteAR1
Fit and remove lowess smoother from stratigraphic series
noLow(dat,smooth=.20,output=1,genplot=T,verbose=T)
noLow(dat,smooth=.20,output=1,genplot=T,verbose=T)
dat |
Stratigraphic series for lowess smoother removal. First column should be location (e.g., depth), second column should be data value. |
smooth |
Lowess smoothing parameter. |
output |
1= output residual values; 2= output lowess fit |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
bandpass
, lowpass
, noKernel
, prewhiteAR
, and prewhiteAR1
Pad stratigraphic series with zeros ("zero padding")
pad(dat,zeros,genplot=T,verbose=T)
pad(dat,zeros,genplot=T,verbose=T)
dat |
Stratigraphic series for mean removal. First column should be location (e.g., depth), second column should be data value. |
zeros |
Number of zeros to add on the end of the series. By default, the number of points will be doubled. |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
Identify maxima of peaks in any 1D or 2D series, filter at desired threshold value.
peak(dat,level,plateau=F,genplot=T,verbose=T)
peak(dat,level,plateau=F,genplot=T,verbose=T)
dat |
1 or 2 dimensional series. If 2 dimesions, first column should be location (e.g., depth), second column should be data value. |
level |
Threshold level for filtering peaks. By default all peak maxima reported. |
plateau |
Output plateau points not evaluated? If T, identified peaks will not be output. (T or F) |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
ex=cycles(genplot=FALSE) peak(ex,level=0.02)
ex=cycles(genplot=FALSE) peak(ex,level=0.02)
Calculate periodogram for stratigraphic series
periodogram(dat,padfac=2,demean=T,detrend=F,nrm=1,background=0,medsmooth=0.2, bc=F,output=0,f0=F,fNyq=T,xmin=0,xmax=Nyq,pl=1,genplot=T,check=T, verbose=T)
periodogram(dat,padfac=2,demean=T,detrend=F,nrm=1,background=0,medsmooth=0.2, bc=F,output=0,f0=F,fNyq=T,xmin=0,xmax=Nyq,pl=1,genplot=T,check=T, verbose=T)
dat |
Stratigraphic series to analyze. First column should be location (e.g., depth), second column should be data value. |
padfac |
Pad with zeros to (padfac*npts) points, where npts is the original number of data points. padfac will automatically promote the total padded series length to an even number, to ensure the Nyquist frequency is calculated. padfac must be >= 1. |
demean |
Remove mean from data series? (T or F) |
detrend |
Remove linear trend from data series? (T or F) |
nrm |
Power normalization: 0 = no normalization; 1 = divide Fourier coefficients by npts. |
background |
Estimate noise model background spectrum and confidence levels? (0= No, 1= AR1, 2= Power Law, 3= Robust AR1) |
medsmooth |
Robust AR1 median smoothing parameter (1 = use 100% of spectrum; 0.20 = use 20%) |
bc |
Apply Bonferroni correction? (T or F) |
output |
Return output as new data frame? 0= no; 1= frequency, amplitude, power, phase (+ background fit and confidence levels if background selected); 2= frequency, real coeff., imag. coeff. If option 2 is selected, all frequencies from negative to positive Nyquist are returned, regardless of the f0 and fNyq settings |
f0 |
Return results for the zero frequency? (T or F) |
fNyq |
Return results for the Nyquist frequency? (T or F) |
xmin |
Smallest frequency for plotting. |
xmax |
Largest frequency for plotting. |
pl |
Power spectrum plotting: 1 = log power, 2 = linear power |
genplot |
Generate summary plots? (T or F) |
check |
Conduct compliance checks before processing? (T or F) In general this should be activated; the option is included for Monte Carlo simulation. |
verbose |
Verbose output? (T or F) |
The power spectrum normalization approach applied here (nrm=1) divides the Fourier coefficients by the number of points (npts) in the stratigraphic series, which is equivalent to dividing the power by (npts*npts). The (npts*npts) normalization has the convenient property whereby – for an unpadded series – the sum of the power in the positive frequencies is equivalent to half of variance; the other half of the variance is in the negative frequencies.
# ***** PART 1: Demonstrate the impact of tapering # generate example series with 10 periods: 100, 40, 29, 21, 19, 14, 10, 5, 4 and 3 ka. ex=cycles(c(1/100,1/40,1/29,1/21,1/19,1/14,1/10,1/5,1/4,1/3),amp=c(1,.75,0.01,.5,.25, 0.01,0.1,0.05,0.001,0.01)) # set zero padding amount for spectral analyses # (pad= 1 results in no zero padding, pad = 2 will pad the series to two times its original length) # start with pad = 1, then afterwards evaluate pad=2 pad=1 # calculate the periodogram with no tapering applied (a "rectangular window") res=periodogram(ex,output=1,padfac=pad) # save the frequency grid and the power for plotting freq=res[1] pwr_rect=res[3] # now compare with results obtained after applying four different tapers: # Hann, 30% cosine taper, DPSS with a time-bandwidth product of 1, and DPSS # with a time-bandwidth product of 3 pwr_hann=periodogram(hannTaper(ex,demean=FALSE),output=1,padfac=pad)[3] pwr_cos=periodogram(cosTaper(ex,p=.3,demean=FALSE),output=1,padfac=pad)[3] pwr_dpss1=periodogram(dpssTaper(ex,tbw=1,demean=FALSE),output=1,padfac=pad)[3] pwr_dpss3=periodogram(dpssTaper(ex,tbw=3,demean=FALSE),output=1,padfac=pad)[3] # now plot the results ymin=min(rbind (log(pwr_rect[,1]),log(pwr_hann[,1]),log(pwr_cos[,1]),log(pwr_dpss1[,1]), log(pwr_dpss3[,1]) )) ymax=max(rbind (log(pwr_rect[,1]),log(pwr_hann[,1]),log(pwr_cos[,1]),log(pwr_dpss1[,1]), log(pwr_dpss3[,1]) )) pl(2) plot(freq[,1],log(pwr_rect[,1]),type="l",ylim=c(ymin,ymax),lwd=2,ylab="log(Power)", xlab="Frequency (cycles/ka)", main="Comparison of rectangle (black), cosine (blue) and Hann (orange) taper", cex.main=1) lines(freq[,1],log(pwr_hann[,1]),col="orange",lwd=2) lines(freq[,1],log(pwr_cos[,1]),col="blue") points(c(1/100,1/40,1/29,1/21,1/19,1/14,1/10,1/5,1/4,1/3),rep(ymax,10),cex=.5, col="purple") plot(freq[,1],log(pwr_rect[,1]),type="l",ylim=c(ymin,ymax),lwd=2,ylab="log(Power)", xlab="Frequency (cycles/ka)", main="Comparison of rectangle (black), 1pi DPSS (green) and 3pi DPSS (red) taper", cex.main=1) lines(freq[,1],log(pwr_dpss1[,1]),col="green") lines(freq[,1],log(pwr_dpss3[,1]),col="red",lwd=2) points(c(1/100,1/40,1/29,1/21,1/19,1/14,1/10,1/5,1/4,1/3),rep(ymax,10),cex=.5, col="purple") # ***** PART 2: Now add a very small amount of red noise to the series # (with lag-1 correlation = 0.5) ex2=ex ex2[2]=ex2[2]+ar1(rho=.5,dt=1,npts=500,sd=.005,genplot=FALSE)[2] # compare the original series with the series+noise pl(2) plot(ex,type="l",lwd=2,lty=3,col="black",xlab="time (ka)",ylab="signal", main="signal (black dotted) and signal+noise (red)"); lines(ex2,col="red") plot(ex[,1],ex2[,2]-ex[,2],xlab="time (ka)",ylab="difference", main="Difference between the two time series (very small!)") # calculate the periodogram with no tapering applied (a "rectangular window") res.2=periodogram(ex2,output=1,padfac=pad) # save the frequency grid and the power for plotting freq.2=res.2[1] pwr_rect.2=res.2[3] # now compare with results obtained after applying four different tapers: # Hann, 30% cosine taper, DPSS with a time-bandwidth product of 1, and DPSS # with a time-bandwidth product of 3 pwr_hann.2=periodogram(hannTaper(ex2,demean=FALSE),output=1,padfac=pad)[3] pwr_cos.2=periodogram(cosTaper(ex2,p=.3,demean=FALSE),output=1,padfac=pad)[3] pwr_dpss1.2=periodogram(dpssTaper(ex2,tbw=1,demean=FALSE),output=1,padfac=pad)[3] pwr_dpss3.2=periodogram(dpssTaper(ex2,tbw=3,demean=FALSE),output=1,padfac=pad)[3] # now plot the results ymin=min(rbind (log(pwr_rect.2[,1]),log(pwr_hann.2[,1]),log(pwr_cos.2[,1]), log(pwr_dpss1.2[,1]),log(pwr_dpss3.2[,1]) )) ymax=max(rbind (log(pwr_rect.2[,1]),log(pwr_hann.2[,1]),log(pwr_cos.2[,1]), log(pwr_dpss1.2[,1]),log(pwr_dpss3.2[,1]) )) pl(2) plot(freq.2[,1],log(pwr_rect.2[,1]),type="l",ylim=c(ymin,ymax),lwd=2,ylab="log(Power)", xlab="Frequency (cycles/ka)", main="Comparison of rectangle (black), cosine (blue) and Hann (orange) taper", cex.main=1) lines(freq.2[,1],log(pwr_hann.2[,1]),col="orange",lwd=2) lines(freq.2[,1],log(pwr_cos.2[,1]),col="blue") points(c(1/100,1/40,1/29,1/21,1/19,1/14,1/10,1/5,1/4,1/3),rep(ymax,10),cex=.5, col="purple") plot(freq.2[,1],log(pwr_rect.2[,1]),type="l",ylim=c(ymin,ymax),lwd=2,ylab="log(Power)", xlab="Frequency (cycles/ka)", main="Comparison of rectangle (black), 1pi DPSS (green) and 3pi DPSS (red) taper", cex.main=1) lines(freq.2[,1],log(pwr_dpss1.2[,1]),col="green") lines(freq.2[,1],log(pwr_dpss3.2[,1]),col="red",lwd=2) points(c(1/100,1/40,1/29,1/21,1/19,1/14,1/10,1/5,1/4,1/3),rep(ymax,10),cex=.5, col="purple") # ***** PART 3: Return to PART 1, but this time increase the zero padding to 2 (pad=2)
# ***** PART 1: Demonstrate the impact of tapering # generate example series with 10 periods: 100, 40, 29, 21, 19, 14, 10, 5, 4 and 3 ka. ex=cycles(c(1/100,1/40,1/29,1/21,1/19,1/14,1/10,1/5,1/4,1/3),amp=c(1,.75,0.01,.5,.25, 0.01,0.1,0.05,0.001,0.01)) # set zero padding amount for spectral analyses # (pad= 1 results in no zero padding, pad = 2 will pad the series to two times its original length) # start with pad = 1, then afterwards evaluate pad=2 pad=1 # calculate the periodogram with no tapering applied (a "rectangular window") res=periodogram(ex,output=1,padfac=pad) # save the frequency grid and the power for plotting freq=res[1] pwr_rect=res[3] # now compare with results obtained after applying four different tapers: # Hann, 30% cosine taper, DPSS with a time-bandwidth product of 1, and DPSS # with a time-bandwidth product of 3 pwr_hann=periodogram(hannTaper(ex,demean=FALSE),output=1,padfac=pad)[3] pwr_cos=periodogram(cosTaper(ex,p=.3,demean=FALSE),output=1,padfac=pad)[3] pwr_dpss1=periodogram(dpssTaper(ex,tbw=1,demean=FALSE),output=1,padfac=pad)[3] pwr_dpss3=periodogram(dpssTaper(ex,tbw=3,demean=FALSE),output=1,padfac=pad)[3] # now plot the results ymin=min(rbind (log(pwr_rect[,1]),log(pwr_hann[,1]),log(pwr_cos[,1]),log(pwr_dpss1[,1]), log(pwr_dpss3[,1]) )) ymax=max(rbind (log(pwr_rect[,1]),log(pwr_hann[,1]),log(pwr_cos[,1]),log(pwr_dpss1[,1]), log(pwr_dpss3[,1]) )) pl(2) plot(freq[,1],log(pwr_rect[,1]),type="l",ylim=c(ymin,ymax),lwd=2,ylab="log(Power)", xlab="Frequency (cycles/ka)", main="Comparison of rectangle (black), cosine (blue) and Hann (orange) taper", cex.main=1) lines(freq[,1],log(pwr_hann[,1]),col="orange",lwd=2) lines(freq[,1],log(pwr_cos[,1]),col="blue") points(c(1/100,1/40,1/29,1/21,1/19,1/14,1/10,1/5,1/4,1/3),rep(ymax,10),cex=.5, col="purple") plot(freq[,1],log(pwr_rect[,1]),type="l",ylim=c(ymin,ymax),lwd=2,ylab="log(Power)", xlab="Frequency (cycles/ka)", main="Comparison of rectangle (black), 1pi DPSS (green) and 3pi DPSS (red) taper", cex.main=1) lines(freq[,1],log(pwr_dpss1[,1]),col="green") lines(freq[,1],log(pwr_dpss3[,1]),col="red",lwd=2) points(c(1/100,1/40,1/29,1/21,1/19,1/14,1/10,1/5,1/4,1/3),rep(ymax,10),cex=.5, col="purple") # ***** PART 2: Now add a very small amount of red noise to the series # (with lag-1 correlation = 0.5) ex2=ex ex2[2]=ex2[2]+ar1(rho=.5,dt=1,npts=500,sd=.005,genplot=FALSE)[2] # compare the original series with the series+noise pl(2) plot(ex,type="l",lwd=2,lty=3,col="black",xlab="time (ka)",ylab="signal", main="signal (black dotted) and signal+noise (red)"); lines(ex2,col="red") plot(ex[,1],ex2[,2]-ex[,2],xlab="time (ka)",ylab="difference", main="Difference between the two time series (very small!)") # calculate the periodogram with no tapering applied (a "rectangular window") res.2=periodogram(ex2,output=1,padfac=pad) # save the frequency grid and the power for plotting freq.2=res.2[1] pwr_rect.2=res.2[3] # now compare with results obtained after applying four different tapers: # Hann, 30% cosine taper, DPSS with a time-bandwidth product of 1, and DPSS # with a time-bandwidth product of 3 pwr_hann.2=periodogram(hannTaper(ex2,demean=FALSE),output=1,padfac=pad)[3] pwr_cos.2=periodogram(cosTaper(ex2,p=.3,demean=FALSE),output=1,padfac=pad)[3] pwr_dpss1.2=periodogram(dpssTaper(ex2,tbw=1,demean=FALSE),output=1,padfac=pad)[3] pwr_dpss3.2=periodogram(dpssTaper(ex2,tbw=3,demean=FALSE),output=1,padfac=pad)[3] # now plot the results ymin=min(rbind (log(pwr_rect.2[,1]),log(pwr_hann.2[,1]),log(pwr_cos.2[,1]), log(pwr_dpss1.2[,1]),log(pwr_dpss3.2[,1]) )) ymax=max(rbind (log(pwr_rect.2[,1]),log(pwr_hann.2[,1]),log(pwr_cos.2[,1]), log(pwr_dpss1.2[,1]),log(pwr_dpss3.2[,1]) )) pl(2) plot(freq.2[,1],log(pwr_rect.2[,1]),type="l",ylim=c(ymin,ymax),lwd=2,ylab="log(Power)", xlab="Frequency (cycles/ka)", main="Comparison of rectangle (black), cosine (blue) and Hann (orange) taper", cex.main=1) lines(freq.2[,1],log(pwr_hann.2[,1]),col="orange",lwd=2) lines(freq.2[,1],log(pwr_cos.2[,1]),col="blue") points(c(1/100,1/40,1/29,1/21,1/19,1/14,1/10,1/5,1/4,1/3),rep(ymax,10),cex=.5, col="purple") plot(freq.2[,1],log(pwr_rect.2[,1]),type="l",ylim=c(ymin,ymax),lwd=2,ylab="log(Power)", xlab="Frequency (cycles/ka)", main="Comparison of rectangle (black), 1pi DPSS (green) and 3pi DPSS (red) taper", cex.main=1) lines(freq.2[,1],log(pwr_dpss1.2[,1]),col="green") lines(freq.2[,1],log(pwr_dpss3.2[,1]),col="red",lwd=2) points(c(1/100,1/40,1/29,1/21,1/19,1/14,1/10,1/5,1/4,1/3),rep(ymax,10),cex=.5, col="purple") # ***** PART 3: Return to PART 1, but this time increase the zero padding to 2 (pad=2)
Open new device and set up for multiple plots, output to screen or PDF if desired.
pl(n,r,c,h,w,mar,file,title)
pl(n,r,c,h,w,mar,file,title)
n |
Number of plots per page (1-25). When specified, this parameter takes precedence and the default settings for r and c are used (the r and c options below are ignored). |
r |
Number of rows of plots. |
c |
Number of columns of plots. |
h |
Height of new page (a.k.a. "device"). |
w |
Width of new page (a.k.a. "device"). |
mar |
A numerical vector of the form c(bottom, left, top, right) which gives the margin size specified in inches. |
file |
File name, in quotes. Accepted file formats include .pdf, .jpg, .png, .tiff, .bmp; the format must be indicated using the appropriate filename extension at the end of the file name. If a file name is not designated, the plot is output to the screen instead. |
title |
Plot title (must be in quotes) |
Create color time-frequency plots from eha results.
plotEha(spec,xmin,xmax,ymin,ymax,h=6,w=4,ydir=1,pl=0,norm,palette=6, centerZero=T,ncolors=100,colorscale=F,xlab,ylab,filetype=0,output=T,verbose=T)
plotEha(spec,xmin,xmax,ymin,ymax,h=6,w=4,ydir=1,pl=0,norm,palette=6, centerZero=T,ncolors=100,colorscale=F,xlab,ylab,filetype=0,output=T,verbose=T)
spec |
Time-frequency spectral results to evaluate. Must have the following format: column 1=frequency; remaining columns (2 to n)=power, amplitude or probability; titles for columns 2 to n must be the location (depth or height). Note that this format is ouput by function eha. |
xmin |
Minimum frequency for PLOTTING. |
xmax |
Maximum frequency for PLOTTING. |
ymin |
Minimum depth/height for PLOTTING. |
ymax |
Maximum depth/height for PLOTTING. |
h |
Height of plot in inches. |
w |
Width of plot in inches. |
ydir |
Direction for y-axis in plots (depth or height). -1 = values increase downwards (slower plotting!), 1 = values increase upwards. |
pl |
An option for the color plots (0=linear scale; 1=plot log of value [useful for plotting power], 2=normalize to maximum value in each window [useful for plotting amplitude], 3=use normalization provided in norm. |
norm |
Optional amplitude normalization divisor, consisting of a single column dataframe. This option is provided in case you'd like to normalize a set of EHA results using the same scheme (e.g., before and after removal of spectral lines). |
palette |
What color palette would you like to use? (1) rainbow, (2) grayscale, (3) blue, (4) red, (5) blue-white-red (if values are negative and positive, white is centered on zero), (6) viridis |
centerZero |
Center color scale on zero (use an equal number of postive and negative color divisions)? (T or F) |
ncolors |
Number of colors steps to use in palette. |
colorscale |
Include a color scale in the plot? (T or F) |
xlab |
Label for x-axis. Default = "Frequency" |
ylab |
Label for y-axis. Default = "Location" |
filetype |
Generate .pdf, .jpeg, .png or tiff file? (0=no; 1=pdf; 2=jpeg; 3=png; 4=tiff) |
output |
If amplitude is normalized (pl = 2), output normalization used? (T or F) |
verbose |
Verbose output? (T or F) |
## as an example, evaluate the modelA data(modelA) ## interpolate to even sampling interval of 0.075 m ex1=linterp(modelA, dt=0.075) ## perform EHA with a time-bandwidth parameter of 2, using an 7.95 meter window, 0.15 m step, ## and pad to 1000 points, output amplitude res=eha(ex1,tbw=2,win=7.95,step=0.15,pad=1000,genplot=0,output=3) # plot EHA amplitude, normalized to maximum value in each window plotEha(res,xlab="Frequency (cycles/m)",ylab="Height (m)",pl=2)
## as an example, evaluate the modelA data(modelA) ## interpolate to even sampling interval of 0.075 m ex1=linterp(modelA, dt=0.075) ## perform EHA with a time-bandwidth parameter of 2, using an 7.95 meter window, 0.15 m step, ## and pad to 1000 points, output amplitude res=eha(ex1,tbw=2,win=7.95,step=0.15,pad=1000,genplot=0,output=3) # plot EHA amplitude, normalized to maximum value in each window plotEha(res,xlab="Frequency (cycles/m)",ylab="Height (m)",pl=2)
Set default plotting parameters for vertical stratigraphic plots. This is ususally invoked after function pl.
plS(f=T,s=1)
plS(f=T,s=1)
f |
Are you plotting the first (leftmost) stratigraphic plot? (T or F) |
s |
Size of the symbols and text on plot. Default = 1 |
Prewhiten stratigraphic series using autoregressive (AR) filter. Appropriate AR order can be automatically determined using the Akaike Information Criterion, or alternatively, the order may be predefined.
prewhiteAR(dat,order=0,method="mle",aic=T,genplot=T,verbose=T)
prewhiteAR(dat,order=0,method="mle",aic=T,genplot=T,verbose=T)
dat |
Stratigraphic series for prewhitening. First column should be location (e.g., depth), second column should be data value for prewhitening. Series must have uniform sampling interval. |
order |
AR order for prewhitening (if aic=F), or alternatively, the maximum AR order to investigate (if aic=T). If order is set to <=0, will evaluate up to maximum default order (this varies based on method). |
method |
Method for AR parameter estimation: ("yule-walker", "burg", "ols", "mle", "yw") |
aic |
Select model using AIC? if F, will use order. AIC is only strictly valid if method is "mle". |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
Akaike, H. (1974), A new look at the statistical model identification, IEEE Trans. Autom. Control, 19, 716-723, doi:10.1109/TAC.1974.1100705.
ar
, arcsinT
, bandpass
, demean
, detrend
, divTrend
, logT
, lowpass
, noKernel
, and prewhiteAR1
Prewhiten stratigraphic series using autoregressive-1 (AR1) filter. Rho can be estimated using the 'standard' approach, or following a bias correction.
prewhiteAR1(dat,setrho=NULL,bias=F,genplot=T,verbose=T)
prewhiteAR1(dat,setrho=NULL,bias=F,genplot=T,verbose=T)
dat |
Stratigraphic series for prewhitening. First column should be location (e.g., depth), second column should be data value for prewhitening. Series must have uniform sampling interval. |
setrho |
Specified lag-1 correlation coefficient (rho). By default, rho is calculated. |
bias |
Calculate unbiased estimate of rho, as in Mudelsee (2010, eq. 2.45). (T or F) |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
M. Mudelsee, 2010, Climate Time Series Analysis: Classical Statistical and Bootstrap Methods, 474 pp., Springer, Dordrecht, Netherlands.
arcsinT
, bandpass
, demean
, detrend
, divTrend
, logT
, lowpass
, noKernel
, and prewhiteAR
Generate power law (1/f) noise surrogates, following the algorithm of Timmer and Konig (1995).
pwrLaw(npts=1024,dt=1,mean=0,sdev=1,beta=2,fcut=0,nsim=1,genplot=T,verbose=T)
pwrLaw(npts=1024,dt=1,mean=0,sdev=1,beta=2,fcut=0,nsim=1,genplot=T,verbose=T)
npts |
number of data points for 1/f surrogate time series |
dt |
sampling interval |
mean |
mean value for 1/f surrogate series |
sdev |
standard deviation for 1/f surrogate series |
beta |
power law coefficient. Positive number will yield a negative slope. |
fcut |
frequency cutoff: below this frequency a plateau will be modeled. Set to zero (default) for no plateau. |
nsim |
Number of surrogate series to generate |
genplot |
generate summary plots (T or F) |
verbose |
verbose output (T or F) |
These simulations use the random number generator of Matsumoto and Nishimura (1998). Power law noise series are generated following the algorithm of Timmer and Konig (1995).
M. Matsumoto, and T. Nishimura, (1998), Mersenne Twister: A 623-dimensionally equidistributed uniform pseudo-random number generator, ACM Transactions on Modeling and Computer Simulation, 8, 3-30.
J. Timmer and K. Konig (1995), On Generating Power Law Noise, Astronomy and Astrophysics: v. 300, p. 707-710.
Estimate power law (1/f) fit to power spectrum, following the algorithm of Vaughan (2005).
pwrLawFit(spec,dof=2,flow=NULL,fhigh=NULL,output=1,genplot=T,verbose=T)
pwrLawFit(spec,dof=2,flow=NULL,fhigh=NULL,output=1,genplot=T,verbose=T)
spec |
Power spectrum. First column is frequency, second column is raw power (linear). Do not include the zero frequency and Nyquist. |
dof |
Degrees of freedom for power spectral estimate. Default is 2, for a simple periodogram. |
flow |
Lowest frequency to include in 1/f fit |
fhigh |
Highest frequency to include in 1/f fit |
output |
Output results of 1/f fit? (0=none; 1=Frequency,Power,Power Law CL,Unbiased Power Law fit,CL_90,CL_95,CL_99; 2=beta, unbiased log10N, biased log10N) |
genplot |
generate summary plots (T or F) |
verbose |
verbose output (T or F) |
Vaughan, S. (2005), A simple test for periodic signals in red noise, Astronomy & Astrophysics.
# generate example series with periods of 400 ka, 100 ka, 40 ka and 20 ka ex = cycles(freqs=c(1/400,1/100,1/40,1/20),start=1,end=1000,dt=5) # add AR1 noise noise = ar1(npts=200,dt=5,sd=.5) ex[2] = ex[2] + noise[2] # calculate periodogram res=periodogram(ex,output=1,padfac=1) # extract power and remove the Nyquist frequency resPwr=cb(res,c(1,3)) resPwr=resPwr[-length(resPwr[,1]),] pwrLawFit(resPwr)
# generate example series with periods of 400 ka, 100 ka, 40 ka and 20 ka ex = cycles(freqs=c(1/400,1/100,1/40,1/20),start=1,end=1000,dt=5) # add AR1 noise noise = ar1(npts=200,dt=5,sd=.5) ex[2] = ex[2] + noise[2] # calculate periodogram res=periodogram(ex,output=1,padfac=1) # extract power and remove the Nyquist frequency resPwr=cb(res,c(1,3)) resPwr=resPwr[-length(resPwr[,1]),] pwrLawFit(resPwr)
Create lithofacies rank series from bed thickness data.
rankSeries(dat,dt,start=0,genplot=T,verbose=T)
rankSeries(dat,dt,start=0,genplot=T,verbose=T)
dat |
First column should be bed thickness, and second column should bed lithofacies rank. |
dt |
Sampling interval for piecewise linear interpolation. By default a grid spacing that is 5 times smaller than the thinnest bed is used. If dt is set to zero, interpolation is skipped. |
start |
Start at what time/depth/height value? |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
# generate example series with random bed thicknesses exThick=rnorm(n=20,mean=10,sd=2) # assign alternating rank of 1 and 2 rank=double(20) rank[seq(from=1,to=19,by=2)] <- 1 rank[seq(from=2,to=20,by=2)] <- 2 # combine into a dataframe ex=cb(exThick,rank) # generate lithofacies rank series rankSeries(ex)
# generate example series with random bed thicknesses exThick=rnorm(n=20,mean=10,sd=2) # assign alternating rank of 1 and 2 rank=double(20) rank[seq(from=1,to=19,by=2)] <- 1 rank[seq(from=2,to=20,by=2)] <- 2 # combine into a dataframe ex=cb(exThick,rank) # generate lithofacies rank series rankSeries(ex)
Read stratigraphic data series from a file, either tab-delimited, CSV, or semicolon-delimited. First column MUST contain location data (depth, height, time). The function will remove missing entries, sort by location, average duplicate values, and generate summary plots.
read(file=NULL,d=1,h="auto",skip=0,srt=T,ave=T,check=T,genplot=T,verbose=T)
read(file=NULL,d=1,h="auto",skip=0,srt=T,ave=T,check=T,genplot=T,verbose=T)
file |
An optional file name, which must be in quotes (use the full directory path if the file is not in your present working directory). When a file name is not specified (the default), the file will be selected using a graphical user interface. |
d |
What column delimiter is used? (0 = tab/.txt, 1 = comma/.csv, 2 = semicolon). CSV is the default option, which interfaces well with EXCEL. |
h |
Does the data file have column titles/headers? ("yes", "no", "auto"). "auto" will auto detect column titles/headers, which must be single strings and start with a character. |
skip |
Number of lines to skip before beginning to read file |
srt |
Sort data values by first column? (T or F) |
ave |
Average duplicate values? (T or F). Only applies if input file has 2 columns |
check |
Check for sorting, duplicates, and empty entries in the data frame? (T or F). If set to F, sorting, duplicate averaging and empty entry removal are disabled. |
genplot |
generate summary plots (T or F). |
verbose |
Verbose output? (T or F). |
Missing values (in the file that you are reading from) should be indicated by 'NA'. If you have included characters in the column titles that are not permitted by R, they will be modified!
Read data matrix from a file, either tab-delimited, CSV, or semicolon-delimited.
readMatrix(file=NULL,d=1,h="auto",skip=0,output=1,check=T,genplot=F,verbose=T)
readMatrix(file=NULL,d=1,h="auto",skip=0,output=1,check=T,genplot=F,verbose=T)
file |
An optional file name, which must be in quotes (use the full directory path if the file is not in your present working directory). When a file name is not specified (the default), the file will be selected using a graphical user interface. |
d |
What column delimiter is used? (0 = tab/.txt, 1 = comma/.csv, 2 = semicolon). CSV is the default option, which interfaces well with EXCEL. |
h |
Does the data file have column titles/headers? ("yes", "no", "auto"). "auto" will auto detect column titles/headers, which must be single strings and start with a character. |
skip |
Number of lines to skip before beginning to read file |
output |
Return data as: 1= matrix, 2=data frame |
check |
Check for empty entries in the matrix? (T or F). |
genplot |
generate summary plots (T or F). |
verbose |
Verbose output? (T or F). |
Missing values (in the file that you are reading from) should be indicated by 'NA'. If you have included characters in the column titles that are not permitted by R, they will be modified!
Replace all variable values < 0 with 0. If first column is location ID (depth/height/time), it will not be processed. Any number of variables (columns) permitted.
repl0(dat,ID=T,genplot=T,verbose=T)
repl0(dat,ID=T,genplot=T,verbose=T)
dat |
Data series to process. If location is included (e.g., depth), it should be in the first column. |
ID |
Is a location ID included in the first column? (T or F) |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
Replace all variable values <= 0 with the smallest positive floating-point number (eps) that can be represented on machine. If first column is location ID (depth/height/time), it will not be processed. Any number of variables (columns) permitted.
replEps(dat,ID=T,genplot=T,verbose=T)
replEps(dat,ID=T,genplot=T,verbose=T)
dat |
Data series to process. If location is included (e.g., depth), it should be in the first column. |
ID |
Is a location ID included in the first column? (T or F) |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
Resample a stratigraphic series using a new (variably sampled) time or space axis. Values are piecewise-linearly interpolated from original data.
resample(dat,xout,genplot=T,verbose=T)
resample(dat,xout,genplot=T,verbose=T)
dat |
Stratigraphic series for resampling. First column should be location (e.g., depth), second column should be data value. |
xout |
Vector of new sampling locations. |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
Remove stratigraphic levels that contain one or more NAs.
rmNA(dat,genplot=T,verbose=T)
rmNA(dat,genplot=T,verbose=T)
dat |
Data series to process. If location is included (e.g., depth), it should be in the first column. |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
Standardize variable in stratigraphic series (subtract mean value and divide by standard deviation)
s(dat,genplot=F,verbose=T)
s(dat,genplot=F,verbose=T)
dat |
Stratigraphic series for standardization. First column should be location (e.g., depth), second column should be data value. |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
Apply a linearly increasing (or decreasing) sedimentation rate model to convert time to stratigraphy.
sedRamp(dat,srstart=0.01,srend=0.05,genplot=T,verbose=T)
sedRamp(dat,srstart=0.01,srend=0.05,genplot=T,verbose=T)
dat |
Time series. First column should be time (in ka), second column should be data value. |
srstart |
Initial sedimentation rate (in m/ka). |
srend |
Final sedimentation rate (in m/ka). |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
modeled stratigraphic series.
# generate example series with 3 precession terms using function 'cycles' # then convert from time to space using sedimentation rate that increases from 1 to 7 cm/ka ex=sedRamp(cycles(),srstart=0.01,srend=0.07)
# generate example series with 3 precession terms using function 'cycles' # then convert from time to space using sedimentation rate that increases from 1 to 7 cm/ka ex=sedRamp(cycles(),srstart=0.01,srend=0.07)
Integrate sedimentation rate curve to obtain time-space map.
sedrate2time(sedrates,timedir=1,genplot=T,check=T,verbose=T)
sedrate2time(sedrates,timedir=1,genplot=T,check=T,verbose=T)
sedrates |
Data frame containing depth/height in first column (meters) and sedimentation rates in second column (cm/ka). |
timedir |
Floating time scale direction: 1= time increases with depth/height; 2= time decreases with depth/height.) |
genplot |
Generate summary plots? (T or F) |
check |
Conduct compliance checks before processing? (T or F) In general this should be activated; the option is included for Monte Carlo simulation. |
verbose |
Verbose output? (T or F) |
Identify optimal spatial/temporal shift to maximize correlation between two stratigraphic/time series.
slideCor(dat1,dat2,rev=F,cormethod=1,minpts=NULL,detrend=F,rmin=NULL, output=T,genplot=T,verbose=T)
slideCor(dat1,dat2,rev=F,cormethod=1,minpts=NULL,detrend=F,rmin=NULL, output=T,genplot=T,verbose=T)
dat1 |
Stratigraphic series 1. First column should be location (e.g., depth), second column should be data value. |
dat2 |
Stratigraphic series 2. First column should be location (e.g., depth), second column should be data value. |
rev |
Reverse polarity of stratigraphic series 2 (multiply proxy data value by -1)? (T or F) |
cormethod |
Method used for calculation of correlation coefficient (1=Pearson, 2=Spearman rank, 3=Kendall) |
minpts |
Minimum number of data points for calculation of correlation coefficient. |
detrend |
Remove linear trend from each window? (T or F) |
rmin |
Minimum r and r2 value shown on plots. By default all r and r2 values will be displayed. |
output |
Output correlation coefficient results as a dataframe? (T or F) |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
slideCor is a general purpose tool to identify the optimal spatial/temporal correlation between two data sets. A few example applications include: (1) stratigraphic correlation of data series from two locations (as in Preto et al., 2004), (2) identification of the optimal spatial/temporal lag between two variables from the same site, and (3) identification of the optimal fit between a floating astrochronology and astronomical target (e.g, Mitchell et al., 2008).
Both series must be evenly sampled, but are not required to have the same sampling interval. If stratigraphic series of different duration/length are being compared, the shift (in spatial or temporal units) should be interpreted as the location within the longer stratigraphic series where the shorter stratigraphic series begins. If both stratigraphic series are of the same duration/length, then the shift is the location within dat1 where dat2 begins.
In some cases, it may be desirable to smooth or bandpass the data series before implementing slideCor (e.g., functions noLow, noKernel, bandpass, taner, etc.).
Preto, N., Hinnov, L.A., De Zanche, V., Mietto, P., and Hardie, L.A., 2004, The Milankovitch interpretation of the Latemar Platform cycles (Dolomites, Italy): Implications for geochronology, biostratigraphy, and Middle Triassic carbonate accumulation, SEPM Special Publication 81.
Mitchell, R.N., Bice, D.M., Montanari, A., Cleaveland, L.C., Christianson, K.T., Coccioni, R., and Hinnov, L.A., 2008, Oceanic anoxic cycles? Orbital prelude to the Bonarelli Level (OAE 2), Earth Planet. Sci. Lett. 26, 1-16.
# Example 1: generate AR1 noise ex1 <- ar1(npts=1000,dt=1) # isolate a section ex2 <- iso(ex1,xmin=200,500) ex2[1] <- ex2[1]-200 res=slideCor(ex1,ex2) # Example 2: an astronomical signal ex1=etp(tmin=0,tmax=1000) # isolate a 200 ka section ex2=iso(ex1,xmin=400,xmax=600) # convert to a floating timescale (elapsed time) ex2[1] <- ex2[1]-400 res=slideCor(ex1,ex2) # now anchor the floating time scale anchor <- ex1[res[which.max(res[,2]),1],1] ex2.anchor <- anchorTime(dat=ex2, time=0, age=anchor, timeDir=2)
# Example 1: generate AR1 noise ex1 <- ar1(npts=1000,dt=1) # isolate a section ex2 <- iso(ex1,xmin=200,500) ex2[1] <- ex2[1]-200 res=slideCor(ex1,ex2) # Example 2: an astronomical signal ex1=etp(tmin=0,tmax=1000) # isolate a 200 ka section ex2=iso(ex1,xmin=400,xmax=600) # convert to a floating timescale (elapsed time) ex2[1] <- ex2[1]-400 res=slideCor(ex1,ex2) # now anchor the floating time scale anchor <- ex1[res[which.max(res[,2]),1],1] ex2.anchor <- anchorTime(dat=ex2, time=0, age=anchor, timeDir=2)
The stepHeat function will evaluate data from stepwise heating experiments, producing an Ar/Ar age spectrum, a weighted mean age with uncertainty, and other helpful statistics/plots (with interactive graphics for data culling). The function includes the option to generate results using the approach of IsoPlot 3.70 (Ludwig, 2008) or ArArCALC (Koppers, 2002).
stepHeat(dat,unc=1,lambda=5.463e-10,J=NULL,Jsd=NULL,CI=2,cull=-1,del=NULL,output=F, idPts=T,size=NULL,unit=1,setAr=95,color="black",genplot=T,verbose=T)
stepHeat(dat,unc=1,lambda=5.463e-10,J=NULL,Jsd=NULL,CI=2,cull=-1,del=NULL,output=F, idPts=T,size=NULL,unit=1,setAr=95,color="black",genplot=T,verbose=T)
dat |
dat must be a data frame with seven columns, as follows: (1) %Ar39 released, (2) date, (3) date uncertainty (one or two sigma), (4) K/Ca, (5) %Ar40*, (6) F, and (7) F uncertainty (one or two sigma). NOTE: F is the ratio Ar40*/Ar39K (see Koppers, 2002). |
unc |
What is the uncertainty on your input dates? (1) one sigma, or (2) two sigma. DEFAULT is one sigma. This also applies to the F uncertainty, and the J-value uncertainty (if specified) |
lambda |
Total decay constant of K40, in units of 1/year. The default value is 5.463e-10/year (Min et al., 2000). |
J |
Neutron fluence parameter |
Jsd |
Uncertainty for J-value (neutron fluence parameter; as one or two sigma) |
CI |
Which convention would you like to use for the 95% confidence intervals? (1) ISOPLOT (Ludwig, 2008), (2) ArArCALC (Koppers, 2002) |
cull |
Would you like select dates with a graphical interface? (0=no, 1=select points to retain, -1=select points to remove) |
del |
A vector of indices indicating dates to remove from weighted mean calculation. If specified, this takes precedence over cull. |
output |
Return weighted mean results as new data frame? (T or F) |
idPts |
Identify datum number on each point? (T or F) |
size |
Multiplicative factor to increase or decrease size of symbols and fonts. The default is 1.4 |
unit |
The time unit for your results. (1) = Ma, (2) = Ka |
setAr |
Set the %Ar40* level to be illustrated on the plot. The default is 95%. |
color |
Color to use for symbols. Default is black. |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
This function performs weighted mean age calculations for step-heating data, including estimation of age uncertainties, mean square weighted deviation, and probability of fit.
The following plots are produced:
(1) %Ar40* versus %Ar39 released
(2) K/Ca versus %Ar39 released
(3) Ar/Ar age spectrum, with 2 sigma uncertainties for each step, and weighted mean with 95% confidence interval (in red)
If the J-value and its uncertainty are input, stepHeat will calculate and include the uncertainty associated with J. The uncertainty is calculated and propagated following equation 18 of Koppers (2002).
A NOTE regarding confidence intervals: There are two conventions that can be used to calculate the confidence intervals, selected with the option 'CI':
(1) ISOPLOT convention (Ludwig, 2008). When the probability of fit is >= 0.15, the confidence interval is based on 1.96*sigma. When the probability of fit is < 0.15, the confidence interval is based on t*sigma*sqrt(MSWD).
(2) ArArCALC convention (Koppers, 2002). When MSWD <=1, the confidence interval is based on 1.96*sigma. When MSWD > 1, the confidence interval is based on 1.96*sigma*sqrt(MSWD).
ADDITIONAL ADVICE: Use the function readMatrix to load your data in R (rather than the function read).
A.A.P. Koppers, 2002, ArArCALC- software for 40Ar/39Ar age calculations: Computers & Geosciences, v. 28, p. 605-619.
K.R. Ludwig, 2008, User's Manual for Isoplot 3.70: A Geochronological Toolkit for Microsoft Excel: Berkeley Geochronology Center Special Publication No. 4, Berkeley, 77 p.
I. McDougall and T.M. Harrison, 1991, Geochronology and Thermochronology by the 40Ar/39Ar Method: Oxford University Press, New York, 269 pp.
K. Min, R. Mundil, P.R. Renne, and K. Ludwig, 2000, A test for systematic errors in 40Ar/39Ar geochronology through comparison with U/Pb analysis of a 1.1-Ga rhyolite: Geochimica et Cosmochimica Acta, v. 64, p. 73-98.
I. Wendt and C. Carl, 1991, The statistical distribution of the mean squared weighted deviation: Chemical Geology, v. 86, p. 275-285.
## Not run: # Check to see if this is an interactive R session, for compliance with CRAN standards. # YOU CAN SKIP THE FOLLOWING LINE IF YOU ARE USING AN INTERACTIVE SESSION. if(interactive()) { # Sample MT-09-09 incremental heating Ar/Ar data from Sageman et al. (2014). perAr39 <- c(4.96,27.58,19.68,39.9,6.25,1.02,0.42,0.19) age <- c(90.08,89.77,89.92,89.95,89.89,89.55,87.71,86.13) sd <- c(0.18,0.11,0.08,0.06,0.14,0.64,1.5,3.22) KCa <- c(113,138,101,195,307,27,17,24) perAr40 <- c(93.42,99.42,99.64,99.79,99.61,97.99,94.64,90.35) Fval <- c(2.148234,2.140643,2.144197,2.145006,2.143627,2.135163,2.090196,2.051682) Fsd <- c(0.00439,0.00270,0.00192,0.00149,0.00331,0.01557,0.03664,0.07846) ex <- data.frame(cbind(perAr39,age,sd,KCa,perAr40,Fval,Fsd)) stepHeat(ex) # plot without points identified stepHeat(ex,size=0,idPts=FALSE,cull=0) } ## End(Not run)
## Not run: # Check to see if this is an interactive R session, for compliance with CRAN standards. # YOU CAN SKIP THE FOLLOWING LINE IF YOU ARE USING AN INTERACTIVE SESSION. if(interactive()) { # Sample MT-09-09 incremental heating Ar/Ar data from Sageman et al. (2014). perAr39 <- c(4.96,27.58,19.68,39.9,6.25,1.02,0.42,0.19) age <- c(90.08,89.77,89.92,89.95,89.89,89.55,87.71,86.13) sd <- c(0.18,0.11,0.08,0.06,0.14,0.64,1.5,3.22) KCa <- c(113,138,101,195,307,27,17,24) perAr40 <- c(93.42,99.42,99.64,99.79,99.61,97.99,94.64,90.35) Fval <- c(2.148234,2.140643,2.144197,2.145006,2.143627,2.135163,2.090196,2.051682) Fsd <- c(0.00439,0.00270,0.00192,0.00149,0.00331,0.01557,0.03664,0.07846) ex <- data.frame(cbind(perAr39,age,sd,KCa,perAr40,Fval,Fsd)) stepHeat(ex) # plot without points identified stepHeat(ex,size=0,idPts=FALSE,cull=0) } ## End(Not run)
Perform principal component analysis on stratigraphic series.
stratPCA(dat,id=TRUE,rot=0,nPC=NULL,output=0,symSize=2,genplot=1)
stratPCA(dat,id=TRUE,rot=0,nPC=NULL,output=0,symSize=2,genplot=1)
dat |
Your data frame; should be in stratigraphic order. First column may be location identifier (e.g., depth). Can contain any number of variables. |
id |
Is the first column of dat an ID column (depth/height/time)? (T or F) |
rot |
Rotation method. 0=none, 1=varimax (orthogonal), 2=promax (oblique) |
nPC |
Number of principal components to extract. Default=all |
output |
What would you like to output? 0=nothing, 1=PC loadings, 2=scores |
symSize |
Size of symbols used in color plots? Default=2 |
genplot |
Generate summary plots? (0) no plots, (1) standard plots, (2) additional plots |
## Not run: # create a test data set, composed of 7 variables: # antiphased 20 kyr cycles with noise, # antiphased 40 kyr cycles with noise, # antiphased 110 kyr cycles with noise, # and a variable that is entirely noise noise=0.01 a=cycles(1/20,noisevar=noise,genplot=FALSE) b=cycles(1/20,phase=pi,noisevar=noise,genplot=FALSE) c=cycles(1/40,noisevar=noise,genplot=FALSE) d=cycles(1/40,phase=pi,noisevar=noise,genplot=FALSE) e=cycles(1/110,noisevar=noise,genplot=FALSE) f=cycles(1/110,phase=pi, noisevar=noise,genplot=FALSE) g=ar1(npts=500,genplot=FALSE) ex=data.frame(cbind(a[,1],a[,2],b[,2],c[,2],d[,2],e[,2],f[,2],g[,2])) stratPCA(ex) stratPCA(ex,rot=1,nPC=4) stratPCA(ex,rot=2,nPC=4) ## End(Not run)
## Not run: # create a test data set, composed of 7 variables: # antiphased 20 kyr cycles with noise, # antiphased 40 kyr cycles with noise, # antiphased 110 kyr cycles with noise, # and a variable that is entirely noise noise=0.01 a=cycles(1/20,noisevar=noise,genplot=FALSE) b=cycles(1/20,phase=pi,noisevar=noise,genplot=FALSE) c=cycles(1/40,noisevar=noise,genplot=FALSE) d=cycles(1/40,phase=pi,noisevar=noise,genplot=FALSE) e=cycles(1/110,noisevar=noise,genplot=FALSE) f=cycles(1/110,phase=pi, noisevar=noise,genplot=FALSE) g=ar1(npts=500,genplot=FALSE) ex=data.frame(cbind(a[,1],a[,2],b[,2],c[,2],d[,2],e[,2],f[,2],g[,2])) stratPCA(ex) stratPCA(ex,rot=1,nPC=4) stratPCA(ex,rot=2,nPC=4) ## End(Not run)
Summary statistics for stratigraphic series: sampling interval and proxy values.
strats(dat,output=0,genplot=1)
strats(dat,output=0,genplot=1)
dat |
Stratigraphic series to evaluate. The first column should contain location (e.g., depth), and the second column should contain data value. This function also accepts non-stratigraphic (single column) input, in which case the sampling interval assessment is skipped. |
output |
Output: (0) nothing, (1) cumulative dt as percent of data points, (2) cumulative dt as percent of total interval duration, (3) dt by location |
genplot |
Generate summary plots? (0) none, (1) include plot of cumulative dt, (2) include dt histogram/density plot |
This function will generate a range of summary statistics for time series, including sampling interval information and the statistical distribution of proxy values.
Estimate correlation coefficient and significance for serially correlated data. This algorithm permits the analysis of data sets with different sampling grids, as discussed in Baddouh et al. (2016). The sampling grid from the data set with fewer points (in the common interval) is used for resampling. Resampling is conducted using piecewise-linear interpolation.
If either dat1 or dat2 have only one column, the resampling is skipped.
The significance of the correlation is determined using the method of Ebisuzaki W. (1997).
surrogateCor(dat1,dat2,firstDiff=F,cormethod=1,nsim=1000,output=2,genplot=T,check=T, verbose=T)
surrogateCor(dat1,dat2,firstDiff=F,cormethod=1,nsim=1000,output=2,genplot=T,check=T, verbose=T)
dat1 |
Data series with one or two columns. If two columns, first should be location (e.g., depth), second column should be data value. |
dat2 |
Data series with one or two columns. If two columns, first should be location (e.g., depth), second column should be data value. |
firstDiff |
Calculate correlation using first differences? (T or F) |
cormethod |
Method used for calculation of correlation coefficient (1=Pearson, 2=Spearman rank, 3=Kendall) |
nsim |
Number of phase-randomized surrogate series to generate. If nsim <=1, simulation is deactivated. |
output |
Return which of the following?: 1= correlation coefficients for each simulation; 2= correlation coefficient for data series; 3= data values used in correlation estimate (resampled) |
genplot |
Generate summary plots? (T or F) |
check |
Conduct compliance checks before processing? (T or F) In general this should be activated; the option is included for Monte Carlo simulation. |
verbose |
Verbose output? (T or F) |
Paraphrased from Baddouh et al. (2016): To provide a quantitative evaluation of the correlation between two data sets that do not share a common sampling grid, we introduce a statistical approach that employs sample interpolation, and significance testing with phase-randomized surrogate data (Ebisuzaki, 1997). The sparser sampling grid is used to avoid over-interpolation. Correlation is evaluated using Pearson, Spearman Rank, or Kendall rank coefficients. The statistical significance of the resulting correlation coefficients are estimated via Monte Carlo simulations using phase-randomized surrogates; the surrogates are subject to the same interpolation process, and compensate for potential serial correlation of data (Ebisuzaki, 1997).
The first-difference series of each variable can also evaluated, to assess correlation in the magnitude of change between sequential stratigraphic samples rather than absolute magnitude.
M. Baddouh, S.R. Meyers, A.R. Carroll, B.L. Beard, C.M. Johnson , 2016, Lacustrine 87-Sr/86-Sr as a tracer to reconstruct Milankovitch forcing of the Eocene hydrologic cycle: Earth and Planetary Science Letters.
W. Ebisuzaki, 1997, A Method to Estimate the Statistical Significance of a Correlation When the Data Are Serially Correlated: Journal of Climate, v. 10, p. 2147-2153.
# generate two stochastic AR1 series ex1 <- ar1(npts=100,dt=5) ex2 <- ar1(npts=100,dt=6) # calculate pearson correlation coefficient and p-value surrogateCor(ex1,ex2)
# generate two stochastic AR1 series ex1 <- ar1(npts=100,dt=5) ex2 <- ar1(npts=100,dt=6) # calculate pearson correlation coefficient and p-value surrogateCor(ex1,ex2)
Generate phase-randomized surrogate series as in Ebisuzaki (1997).
surrogates(dat,nsim=1,preserveMean=T,std=T,genplot=T,verbose=T)
surrogates(dat,nsim=1,preserveMean=T,std=T,genplot=T,verbose=T)
dat |
Data series with one or two columns. If two columns, first should be location (e.g., depth), second column should be data value. |
nsim |
Number of phase-randomized surrogate series to generate. |
preserveMean |
Should surrogate series have the same mean value as data series? (T or F) |
std |
Standardize results to guarantee equivalent variance as data series? (T or F) |
genplot |
Generate summary plots? Only applies if nsim=1. (T or F) |
verbose |
Verbose output? (T or F) |
This function will generate phase-randomized surrogate series as in Ebisuzaki (1997). It is an R-translation of the Matlab code by V. Moron (see link below), with modifications and additional features.
W. Ebisuzaki, 1997, A Method to Estimate the Statistical Significance of a Correlation When the Data Are Serially Correlated: Journal of Climate, v. 10, p. 2147-2153.
Matlab code by V. Moron: http://www.mathworks.com/matlabcentral/fileexchange/10881-weaclim/content/ebisuzaki.m
Original C-code by W. Ebisuzaki: http://www.ftp.cpc.ncep.noaa.gov/wd51we/random_phase/
# generate example series with 3 precession terms and noise ex <- cycles(start=0,end=500,noisevar=.0004,dt=5) # generate phase-randomized surrogates ran_ex <- surrogates(ex,nsim=1) # compare periodograms of data and surrogates res1 <- periodogram(ex,padfac=0,output=1,genplot=FALSE) res2 <- periodogram(ran_ex,padfac=0,output=1,genplot=FALSE) pl(2) plot(ex,type="l",main="black=original; red=surrogate") lines(ran_ex,col="red",lty=4) plot(res1[,1],res1[,2],type="l",lwd=2,main="black=original; red=surrogate", xlab="frequency",ylab="amplitude") lines(res2[,1],res2[,2],col="red",lwd=2,lty=4)
# generate example series with 3 precession terms and noise ex <- cycles(start=0,end=500,noisevar=.0004,dt=5) # generate phase-randomized surrogates ran_ex <- surrogates(ex,nsim=1) # compare periodograms of data and surrogates res1 <- periodogram(ex,padfac=0,output=1,genplot=FALSE) res2 <- periodogram(ran_ex,padfac=0,output=1,genplot=FALSE) pl(2) plot(ex,type="l",main="black=original; red=surrogate") lines(ran_ex,col="red",lty=4) plot(res1[,1],res1[,2],type="l",lwd=2,main="black=original; red=surrogate", xlab="frequency",ylab="amplitude") lines(res2[,1],res2[,2],col="red",lwd=2,lty=4)
Synthesize stratigraphy from forcing function.
synthStrat(signal=NULL,nfacies=4,clip=T,flip=F,fmax=0.1,output=F,genplot=2,verbose=T)
synthStrat(signal=NULL,nfacies=4,clip=T,flip=F,fmax=0.1,output=F,genplot=2,verbose=T)
signal |
Forcing signal. First column should be time (in ka), second column should be forcing. |
nfacies |
Number of sedimentary facies to model. |
clip |
Clip forcing signal at mean value? (T or F) |
flip |
Reverse the sign of the forcing? (T or F) |
fmax |
Maximum frequency for spectra (if genplot=2). |
output |
Output facies series? (T or F) |
genplot |
Generate summary plots? (1) plot stratigraphy, (2) plot statigraphy and spectra. |
verbose |
Verbose output? (T or F) |
modeled stratigraphic series.
## Not run: # EX.1: precession, unclipped signal=etp(tmin=8400,tmax=8900,pWt=1,oWt=0,eWt=0) synthStrat(signal,nfacies=4,clip=FALSE,genplot=2) # EX.2: more finely resolved facies #synthStrat(signal,nfacies=15,clip=FALSE,genplot=2) # EX.3: couplets #synthStrat(signal,nfacies=2,clip=FALSE,genplot=2) # EX.4: precession, clipped #synthStrat(signal,nfacies=4,genplot=2) # EX.5: noise noise=ar1(npts=501,rho=0.8) #synthStrat(noise,nfacies=4,genplot=2) # EX.6: precession + noise #signal2=signal #signal2[2]=signal2[2]+0.75*noise[2] #synthStrat(signal2,nfacies=4,genplot=2) # EX.7: p-0.5t, clipped (demonstrates interference pattern; compare with EX.4 #signal3=etp(tmin=8400,tmax=8900,pWt=1,oWt=-0.5,eWt=0) #synthStrat(signal3,nfacies=4,genplot=2) # EX.8: ice sheet model, using p-0.5t #ice=imbrie() #synthStrat(ice,nfacies=5,clip=FALSE,genplot=2) # EX.9: precession, clipped, ramping sedimentation rate #synthStrat(linterp(sedRamp(signal,genplot=FALSE),genplot=FALSE),nfacies=6, # clip=TRUE,genplot=2,fmax=10) ## End(Not run)
## Not run: # EX.1: precession, unclipped signal=etp(tmin=8400,tmax=8900,pWt=1,oWt=0,eWt=0) synthStrat(signal,nfacies=4,clip=FALSE,genplot=2) # EX.2: more finely resolved facies #synthStrat(signal,nfacies=15,clip=FALSE,genplot=2) # EX.3: couplets #synthStrat(signal,nfacies=2,clip=FALSE,genplot=2) # EX.4: precession, clipped #synthStrat(signal,nfacies=4,genplot=2) # EX.5: noise noise=ar1(npts=501,rho=0.8) #synthStrat(noise,nfacies=4,genplot=2) # EX.6: precession + noise #signal2=signal #signal2[2]=signal2[2]+0.75*noise[2] #synthStrat(signal2,nfacies=4,genplot=2) # EX.7: p-0.5t, clipped (demonstrates interference pattern; compare with EX.4 #signal3=etp(tmin=8400,tmax=8900,pWt=1,oWt=-0.5,eWt=0) #synthStrat(signal3,nfacies=4,genplot=2) # EX.8: ice sheet model, using p-0.5t #ice=imbrie() #synthStrat(ice,nfacies=5,clip=FALSE,genplot=2) # EX.9: precession, clipped, ramping sedimentation rate #synthStrat(linterp(sedRamp(signal,genplot=FALSE),genplot=FALSE),nfacies=6, # clip=TRUE,genplot=2,fmax=10) ## End(Not run)
Apply Taner bandpass or lowpass filter to stratigraphic series. This function can also be used to notch filter or highpass a record (see examples).
taner(dat,padfac=2,flow=NULL,fhigh=NULL,roll=10^3,demean=T,detrend=F,addmean=T, output=1,xmin=0,xmax=Nyq,genplot=T,check=T,verbose=T)
taner(dat,padfac=2,flow=NULL,fhigh=NULL,roll=10^3,demean=T,detrend=F,addmean=T, output=1,xmin=0,xmax=Nyq,genplot=T,check=T,verbose=T)
dat |
Stratigraphic series for bandpass filtering. First column should be location (e.g., depth), second column should be data value. |
padfac |
Pad with zeros to (padfac*npts) points, where npts is the original number of data points. |
flow |
Low frequency cut-off for Taner filter (half power point). If this value is not set (NULL), it will default to -1*fhigh, which will create a lowpass filter. |
fhigh |
High frequency cut-off for Taner filter (half power point). |
roll |
Roll-off rate, in dB/octave. Typical values are 10^3 to 10^12, but can be larger. |
demean |
Remove mean from data series? (T or F) |
detrend |
Remove linear trend from data series? (T or F) |
addmean |
Add mean value to bandpass result? (T or F) |
output |
Output: (1) filtered series, (2) bandpass filter window. |
xmin |
Smallest frequency for plotting. |
xmax |
Largest frequency for plotting. |
genplot |
Generate summary plots? (T or F) |
check |
Conduct compliance checks before processing? (T or F) In general this should be activated; the option is included for Monte Carlo simulation. |
verbose |
Verbose output? (T or F) |
bandpassed stratigraphic series.
http://www.rocksolidimages.com/pdf/attrib_revisited.htm#_Toc328470897
bandpass
, lowpass
, noKernel
, noLow
, prewhiteAR
, and prewhiteAR1
# generate example series with periods of 405 ka, 100 ka, 40ka, and 20 ka, plus noise ex=cycles(freqs=c(1/405,1/100,1/40,1/20),end=1000,dt=5,noisevar=.1) # bandpass precession term using Taner window bandpass_ex <- taner(ex,flow=0.045,fhigh=0.055,roll=10^10) # lowpass filter eccentricity terms using Taner window lowpass_ex=taner(ex,fhigh=.02,roll=10^10) # notch filter (remove) obliquity term using Taner window # if you'd like the final notch filtered record to be centered on the mean proxy # value, set addmean=FALSE notch_ex <- taner(ex,flow=0.02,fhigh=0.03,roll=10^10,addmean=FALSE) notch_ex[2] <- ex[2]-notch_ex[2] pl(2) plot(ex,type="l",main="Eccentricity+Obliquity+Precession") plot(notch_ex,type="l",main="Following application of obliquity notch filter") # highpass filter obliquity and precession terms using Taner window # if you'd like the final highpass filtered record to be centered on the mean proxy # value, set addmean=FALSE highpass_ex=taner(ex,fhigh=.02,roll=10^10,addmean=FALSE) highpass_ex[2] <- ex[2]-highpass_ex[2] pl(2) plot(ex,type="l",main="Eccentricity+Obliquity+Precession") plot(highpass_ex,type="l",main="Obliquity+Precession highpassed signal")
# generate example series with periods of 405 ka, 100 ka, 40ka, and 20 ka, plus noise ex=cycles(freqs=c(1/405,1/100,1/40,1/20),end=1000,dt=5,noisevar=.1) # bandpass precession term using Taner window bandpass_ex <- taner(ex,flow=0.045,fhigh=0.055,roll=10^10) # lowpass filter eccentricity terms using Taner window lowpass_ex=taner(ex,fhigh=.02,roll=10^10) # notch filter (remove) obliquity term using Taner window # if you'd like the final notch filtered record to be centered on the mean proxy # value, set addmean=FALSE notch_ex <- taner(ex,flow=0.02,fhigh=0.03,roll=10^10,addmean=FALSE) notch_ex[2] <- ex[2]-notch_ex[2] pl(2) plot(ex,type="l",main="Eccentricity+Obliquity+Precession") plot(notch_ex,type="l",main="Following application of obliquity notch filter") # highpass filter obliquity and precession terms using Taner window # if you'd like the final highpass filtered record to be centered on the mean proxy # value, set addmean=FALSE highpass_ex=taner(ex,fhigh=.02,roll=10^10,addmean=FALSE) highpass_ex[2] <- ex[2]-highpass_ex[2] pl(2) plot(ex,type="l",main="Eccentricity+Obliquity+Precession") plot(highpass_ex,type="l",main="Obliquity+Precession highpassed signal")
Apply Taner bandpass or lowpass filter to Fourier coefficients.
tanerFC(fc,npts,flow=NULL,fhigh=NULL,roll=10^3,output=1,genplot=T,verbose=T)
tanerFC(fc,npts,flow=NULL,fhigh=NULL,roll=10^3,output=1,genplot=T,verbose=T)
fc |
Fourier coefficients, as output by the function 'periodogram'. The first column is frequency, the second column contains the real coefficients, and the third column contains the imaginary coefficients. |
npts |
The number of points in the stratigraphic series used to estimate the Fourier coefficients. |
flow |
Low frequency cut-off for Taner filter (half power point). If this value is not set (NULL), it will default to -1*fhigh, which will create a lowpass filter. |
fhigh |
High frequency cut-off for Taner filter (half power point). |
roll |
Roll-off rate, in dB/octave. Typical values are 10^3 to 10^12, but can be larger. |
output |
Output: (1) filtered series, (2) bandpass filter window. |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
This function is designed for cases when one needs to efficiently apply a range of filter parameters to a stratigraphic series. It is used within function 'timeOpt' to speed up processing. For more general use, function 'taner' is preferred, which also provides a range of plots for evaluating the filtering.
Fourier coefficients for 'tanerFC' can be determined with the function 'periodogram', using options 'output=2' and 'nrm=0'.
bandpassed stratigraphic series.
http://www.rocksolidimages.com/pdf/attrib_revisited.htm#_Toc328470897
bandpass
, lowpass
, noKernel
, noLow
, prewhiteAR
, and prewhiteAR1
# generate example series with periods of 405 ka, 100 ka, 40ka, and 20 ka, plus noise ex=cycles(freqs=c(1/405,1/100,1/40,1/20),end=1000,dt=5,noisevar=.1) # calculate the Fourier coefficients using periodogram function. this must be done with # no normalization (nrm=0) fc_ex <- periodogram(ex,demean=TRUE,output=2,nrm=0) # bandpass precession term using Taner window bandpass_ex <- tanerFC(fc=fc_ex,npts=201,flow=0.045,fhigh=0.055,roll=10^10) # lowpass filter eccentricity terms using Taner window lowpass_ex <- tanerFC(fc=fc_ex,npts=201,fhigh=.02,roll=10^10)
# generate example series with periods of 405 ka, 100 ka, 40ka, and 20 ka, plus noise ex=cycles(freqs=c(1/405,1/100,1/40,1/20),end=1000,dt=5,noisevar=.1) # calculate the Fourier coefficients using periodogram function. this must be done with # no normalization (nrm=0) fc_ex <- periodogram(ex,demean=TRUE,output=2,nrm=0) # bandpass precession term using Taner window bandpass_ex <- tanerFC(fc=fc_ex,npts=201,flow=0.045,fhigh=0.055,roll=10^10) # lowpass filter eccentricity terms using Taner window lowpass_ex <- tanerFC(fc=fc_ex,npts=201,fhigh=.02,roll=10^10)
This is a simulation tool to evaluate power spectrum false positive rates, the frequency distribution of the false positives, and the behavior of numerous "multiple correction" procedures, for a range of background estimation approaches that are implemented in Astrochron. The tool can be used to conduct surrogate analyses, alongside analysis of real data, to better understand the suitability of particular background estimation approaches. The resulting simulations are similar to those presented in Figure 3 of Meyers (2012) and Crampton et al. (PNAS).
testBackground(npts=1001,dt=5,noiseType="ar1",coeff=NULL,method="periodogramAR1", opt=NULL,demean=T,detrend=F,low=0,tbw=3,multi=F,iter=2000,output=F, genplot=F,verbose=T)
testBackground(npts=1001,dt=5,noiseType="ar1",coeff=NULL,method="periodogramAR1", opt=NULL,demean=T,detrend=F,low=0,tbw=3,multi=F,iter=2000,output=F, genplot=F,verbose=T)
npts |
Number of points in simulated stratigraphic series (surrogates). |
dt |
Sampling interval for surrogates. |
noiseType |
Select "ar1" for AR1 noise surrogates, or "pwrLaw" for Power Law noise surrogates |
coeff |
AR1 coefficient (rho) or Power Law coefficient (beta) for surrogates. |
method |
Background estimation method: (1) "mtmAR1" (function mtm), (2) "mtmML96" (function mtmML96), (3) "lowspec" (function lowspec), (4) "mtmPL" (function mtmPL), (5) "periodogramPL" (function periodogram), (6) "periodogramAR1" (function periodogram) |
opt |
Method specific options. For mtmML96, this is medsmooth (see function mtmML96); for lowspec this is lowspan (see function lowspec); for periodogram this is percent cosine taper (see function cosTaper). |
demean |
Remove mean value from simulated surrogates? (T or F; this option does not apply to lowspec) |
detrend |
Remove linear trend from simulated surrogates? (T or F) |
low |
Remove long-term trend using a LOWESS smoother? Choose a value ranging from 0-1 (see function noLow). 0 = no long-term trend removal. |
tbw |
MTM time-bandwidth product. This option is ignored for methods 5 and 6. |
multi |
Evaluate a range of multiple-comparison tests too? (T or F) |
iter |
Number of iterations (surrogate series) for Monte Carlo simulation. |
output |
Output data frame? (T or F) |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
The Monte Carlo simulations can utilize AR1 or Power Law noise surrogates. Background estimation approaches include conventional AR1, ML96, LOWSPEC and Power Law. The function also allows evaluation of common data detrending approaches (linear trend removal, LOWESS trend removal).
Note that MTM-ML96 conducts the Mann and Lees (1996; ML96) "robust red noise" analysis, with an improved median smoothing approach. The original Mann and Lees (1996) approach applies a truncation of the median smoothing window to include fewer frequencies near the edges of the spectrum; while truncation is required, its implementation in the original method often results in an "edge effect" that can produce excess false positive rates at low frequencies, commonly within the eccentricity-band (Meyers, 2012). To help address this issue, an alternative median smoothing approach is applied that implements Tukey's robust end-point rule and symmetrical medians (see the function mtmML96 for more details). This version of the ML96 algorithm was first implemented in Patterson et al. (2014).
See function multiTest for more information on the multiple comparison tests evaluated.
W.S. Cleveland, 1979, Locally weighted regression and smoothing scatterplots: Journal of the American Statistical Association, v. 74, p. 829-836.
J.S. Campton, S.R. Meyers, R.A. Cooper, P.M Sadler, M. Foote, D. Harte, 2018, Pacing of Paleozoic macroevolutionary rates by Milankovitch grand cycles: Proceedings of the National Academy of Sciences, doi:10.1073/pnas.1714342115.
M.E. Mann, and J.M. Lees, 1996, Robust estimation of background noise and signal detection in climatic time series, Clim. Change, 33, 409-445.
S.R. Meyers, 2012, Seeing Red in Cyclic Stratigraphy: Spectral Noise Estimation for Astrochronology: Paleoceanography, 27, PA3228, doi:10.1029/2012PA002307.
M.O. Patterson, R. McKay, T. Naish, C. Escutia, F.J. Jimenez-Espejo, M.E. Raymo, M.E., S.R. Meyers, L. Tauxe, H. Brinkhuis, and IODP Expedition 318 Scientists,2014, Response of the East Antarctic Ice Sheet to orbital forcing during the Pliocene and Early Pleistocene, Nature Geoscience, v. 7, p. 841-847.
D.J. Thomson, 1982, Spectrum estimation and harmonic analysis: IEEE Proceedings, v. 70, p. 1055-1096.
confAdjust
,multiTest
,lowspec
, mtm
, mtmML96
, mtmPL
, and periodogram
## Not run: # evaluate false positive rate for MTM-AR1 using AR1 surrogates testBackground(noiseType="ar1",method="mtmAR1") # evaluate false positive rate for MTM-AR1 using Power Law surrogates testBackground(noiseType="pwrLaw",method="mtmAR1") ## End(Not run)
## Not run: # evaluate false positive rate for MTM-AR1 using AR1 surrogates testBackground(noiseType="ar1",method="mtmAR1") # evaluate false positive rate for MTM-AR1 using Power Law surrogates testBackground(noiseType="pwrLaw",method="mtmAR1") ## End(Not run)
Astrochronologic testing via the precession amplitude modulation approach of Zeeden et al. (2015), as updated in Zeeden et al. (2018 submitted).
testPrecession(dat,nsim=1000,gen=1,edge=0.025,maxNoise=1,rho=NULL,detrendEnv=T, solution=NULL,output=F,genplot=T,verbose=T)
testPrecession(dat,nsim=1000,gen=1,edge=0.025,maxNoise=1,rho=NULL,detrendEnv=T, solution=NULL,output=F,genplot=T,verbose=T)
dat |
Stratigraphic series to analyze. First column should be location (time in ka, a positive value), second column should be data value. |
nsim |
Number of Monte Carlo simulations (phase-randomized surrogates or AR1 surrogates). |
gen |
Monte Carlo simulation generator: (1) use phase-randomized surrogates, (2) use AR1 surrogates. |
edge |
Percentage of record to exclude from beginning and end of data series, to remove edge effects. (a value from 0-1) |
maxNoise |
Maximum noise level to add in simulations. A value of 1 will apply maximum noise that is equivalent to 1 standard deviation of the data. |
rho |
Specified lag-1 correlation coefficient (rho). If rho is not specified, it will be calculated within the function. |
detrendEnv |
Linearly detrend envelope? (T or F) |
solution |
Theoretical solution used for astrochronologic testing. Solution should be in the format: time (ka), precession angle, obliquity, eccentricity (the output from function 'getLaskar'). By default this is automatically determined within the function, using the solution of Laskar et al. (2004). |
output |
Return results as a new data frame? (T or F) |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
This astrochronologic testing method compares observed precession-scale amplitude modulations to those expected from the theoretical eccentricity solutions. It is applicable for testing astrochronologies spanning 0-50 Ma. The technique implements a series of filters to guard against artificial introduction of eccentricity modulations during tuning and data processing, and evaluates the statistical significance of the results using Monte Carlo simulation (Zeeden et al., 2015).
The algorithm includes an improvement in the significance testing approach. Specifically, as a safeguard against artificially imposed modulations, an adaptive noise addition step is implemented (as outlined in Zeeden et al., submitted).
The astronomically-tuned data series under evaluation should consist of two columns: time in kiloyears & data value. Note that time must be positive. The default astronomical solutions used for the astrochronologic testing come from Laskar et al. (2004).
When reporting a p-value for your result, it is important to consider the number of simulations used. A factor of 10 is appropriate, such that for 1000 simulations one would report a minimum p-value of "p<0.01", and for 10000 simulations one would report a minimum p-value of "p<0.001".
Please be aware that the kernel density estimate plots, which summarize the simulations, represent 'smoothed' models. Due to the smoothing bandwidth, they can sometimes give the impression of simulation values that are larger or smaller than actually present. However, the reported p-value does not suffer from these issues.
IMPORTANT CHANGES (June 20, 2018): Note that this version has been updated to use 'solution' instead of 'esinw', for consistency with the function 'testTilt'. If you are invoking the default option, you do not need to make any changes to your script. Also note that the new option 'edge' has been added, which by default will truncate your data series by 5 percent (2.5 percent on each end of the record), to guard against edge effects that can be present in the amplitude envelope. Set edge to 0 to reconstruct the original (now legacy) 'testPrecession' approach.
When nsim is set to zero, the function will output a data frame with five columns:
1=time, 2=precession bandpass filter output, 3=amplitude envelope of (2), 4=lowpass filter output of (3), 5=theoretical eccentricity (as extracted from precession modulations using the filtering algorithm), 6=(2) + noise, 7=amplitude envelope of (6), 8=lowpass filter output of (7)
When nsim is > 0, the function will output the correlation coefficients for each simulation.
C. Zeeden, S.R. Meyers, L.J. Lourens, and F.J. Hilgen, 2015, Testing astronomically tuned age models: Paleoceanography, 30, doi:10.1002/2014PA002762.
C. Zeeden, S.R. Meyers, F.J. Hilgen, L.J. Lourens, and J. Laskar, submitted, Time scale evaluation and the quantification of obliquity forcing: Quaternary Science Reviews.
J. Laskar, P. Robutel, F. Joutel, M. Gastineau, A.C.M. Correia, and B. Levrard, B., 2004, A long term numerical solution for the insolation quantities of the Earth: Astron. Astrophys., Volume 428, 261-285.
asm
, eAsmTrack
, timeOpt
, and timeOptSim
## Not run: ### as a test series, use the three dominant precession terms from Berger et al. (1992) ex<-cycles(start=0,end=1000,dt=2) ### now conduct astrochronologic testing res1=testPrecession(ex) ### if you plan to run testPrecession repeatedly, it is advisable to download the astronomical ### solution first solution<-getLaskar() ### now conduct astrochronologic testing res2<-testPrecession(ex,solution=solution) ## End(Not run)
## Not run: ### as a test series, use the three dominant precession terms from Berger et al. (1992) ex<-cycles(start=0,end=1000,dt=2) ### now conduct astrochronologic testing res1=testPrecession(ex) ### if you plan to run testPrecession repeatedly, it is advisable to download the astronomical ### solution first solution<-getLaskar() ### now conduct astrochronologic testing res2<-testPrecession(ex,solution=solution) ## End(Not run)
Astrochronologic testing via the obliquity amplitude modulation approach of Zeeden et al. (2019 submitted).
testTilt(dat,nsim=1000,gen=1,edge=0.025,cutoff=1/150,maxNoise=0.25,rho=NULL,detrendEnv=T, solution=NULL,output=F,genplot=T,verbose=T)
testTilt(dat,nsim=1000,gen=1,edge=0.025,cutoff=1/150,maxNoise=0.25,rho=NULL,detrendEnv=T, solution=NULL,output=F,genplot=T,verbose=T)
dat |
Stratigraphic series to analyze. First column should be location (time in ka, a positive value), second column should be data value. |
nsim |
Number of Monte Carlo simulations (phase-randomized surrogates or AR1 surrogates). |
gen |
Monte Carlo simulation generator: (1) use phase-randomized surrogates, (2) use AR1 surrogates. |
edge |
Percentage of record to exclude from beginning and end of data series, to remove edge effects. (0-1) |
cutoff |
Cutoff frequency for lowpass filtering. |
maxNoise |
Maximum noise level to add in simulations. A value of 1 will apply maximum noise that is equivalent to 1 sd of data. |
rho |
Specified lag-1 correlation coefficient (rho). This value is only used if gen=2. If rho is not specified, it will be calculated within the function. |
detrendEnv |
Linearly detrend envelope? (T or F) |
solution |
Theoretical solution used for astrochronologic testing. Solution should be in the format: time (ka), precession angle, obliquity, eccentricity (the output from function 'getLaskar'). By default this is automatically determined within the function, using the solution of Laskar et al. (2004). |
output |
Return results as a new data frame? (T or F) |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
This astrochronologic testing method compares observed obliquity-scale amplitude modulations to those expected from the theoretical solutions. It is applicable for testing astrochronologies spanning 0-50 Ma. The technique implements a series of filters to guard against artificial introduction of modulations during tuning and data processing, and evaluates the statistical significance of the results using Monte Carlo simulation. The algorithm includes an adaptive noise addition step to improvement the significance testing approach. See Zeeden et al. (2019 submitted) for additional information.
The astronomically-tuned data series under evaluation should consist of two columns: time in kiloyears & data value. Note that time must be positive. The default obliquity solution used for the astrochronologic testing comes from Laskar et al. (2004).
When reporting a p-value for your result, it is important to consider the number of simulations used. A factor of 10 is appropriate, such that for 1000 simulations one would report a minimum p-value of "p<0.01", and for 10000 simulations one would report a minimum p-value of "p<0.001".
Please be aware that the kernel density estimate plots, which summarize the simulations, represent 'smoothed' models. Due to the smoothing bandwidth, they can sometimes give the impression of simulation values that are larger or smaller than actually present. However, the reported p-value does not suffer from these issues.
When nsim is set to zero, the function will output a data frame with five columns:
1=time, 2=obliquity bandpass filter output, 3=amplitude envelope of (2), 4=lowpass filter output of (3), 5=theoretical obliquity (as extracted from modulations using the filtering algorithm), 6=(2) + noise, 7=amplitude envelope of (6), 8=lowpass filter output of (7)
When nsim is > 0, the function will output the correlation coefficients for each simulation.
C. Zeeden, S.R. Meyers, F.J. Hilgen, L.J. Lourens, and J. Laskar, 2019 submitted, Time scale evaluation and the quantification of obliquity forcing: Quaternary Science Reviews.
C. Zeeden, S.R. Meyers, L.J. Lourens, and F.J. Hilgen, 2015, Testing astronomically tuned age models: Paleoceanography, 30, doi:10.1002/2014PA002762.
J. Laskar, P. Robutel, F. Joutel, M. Gastineau, A.C.M. Correia, and B. Levrard, B., 2004, A long term numerical solution for the insolation quantities of the Earth: Astron. Astrophys., Volume 428, 261-285.
asm
, eAsmTrack
, timeOpt
, and timeOptSim
## Not run: ### as a test series, use the obliquity series from Laskar et al. (2004), spanning ### the past 4 million years ex<-etp(tmin=0,tmax=4000,dt=2,eWt=0,oWt=1,pWt=0,solution=solution,standardize=FALSE) ### now conduct astrochronologic testing res1=testTilt(ex) ### if you plan to run testTilt repeatedly, it is advisable to download the astronomical ### solution solution<-getLaskar() ### now conduct astrochronologic testing res<-testTilt(ex,solution=solution) ## End(Not run)
## Not run: ### as a test series, use the obliquity series from Laskar et al. (2004), spanning ### the past 4 million years ex<-etp(tmin=0,tmax=4000,dt=2,eWt=0,oWt=1,pWt=0,solution=solution,standardize=FALSE) ### now conduct astrochronologic testing res1=testTilt(ex) ### if you plan to run testTilt repeatedly, it is advisable to download the astronomical ### solution solution<-getLaskar() ### now conduct astrochronologic testing res<-testTilt(ex,solution=solution) ## End(Not run)
TimeOpt: Evaluation of eccentricity-related amplitude modulation and bundling in paleoclimate data, as in Meyers (2015). The method can also be used to evaluate records that express obliquity, as in Meyers (2019).
timeOpt(dat,sedmin=0.5,sedmax=5,numsed=100,linLog=1,limit=T,fit=1,r2max=1, fitModPwr=T,flow=NULL,fhigh=NULL,roll=NULL,targetE=NULL,targetP=NULL, detrend=T,output=0,title=NULL,genplot=T,check=T,verbose=T)
timeOpt(dat,sedmin=0.5,sedmax=5,numsed=100,linLog=1,limit=T,fit=1,r2max=1, fitModPwr=T,flow=NULL,fhigh=NULL,roll=NULL,targetE=NULL,targetP=NULL, detrend=T,output=0,title=NULL,genplot=T,check=T,verbose=T)
dat |
Stratigraphic series for astrochronologic assessment. First column should be depth or height (in meters), second column should be data value. |
sedmin |
Minimum sedimentation rate for investigation (cm/ka). |
sedmax |
Maximum sedimentation rate for investigation (cm/ka). |
numsed |
Number of sedimentation rates to investigate in optimization grid. |
linLog |
Use linear or logarithmic scaling for sedimentation rate grid spacing? (0=linear, 1=log; default value is 1) |
limit |
Limit evaluated sedimentation rates to region in which full target signal can be recovered? (T or F) |
fit |
Test for (1) precession amplitude modulation or (2) short eccentricity amplitude modulation? |
r2max |
Which maximum in r2 do you want to use for the time model calibration? (1) r^2_opt, (2) r^2_spectral, (3) r^2_envelope |
fitModPwr |
Include the modulation periods in the spectral fit? (T or F) |
flow |
Low frequency cut-off for Taner bandpass (half power point; in cycles/ka) |
fhigh |
High frequency cut-off for Taner bandpass (half power point; in cycles/ka) |
roll |
Taner filter roll-off rate, in dB/octave. |
targetE |
A vector of eccentricity periods to evaluate (in ka). These must be in order of decreasing period, with a first value of 405 ka. |
targetP |
A vector of precession periods to evaluate (in ka). These must be in order of decreasing period. |
detrend |
Remove linear trend from data series? (T or F) |
output |
Which results would you like to return to the console? (0) no output; (1) return sedimentation rate grid, r^2_envelope, r^2_power, r^2_opt; (2) return optimal time series, filtered precession, precession envelope, TimeOpt-reconstructed eccentricity model, full TimeOpt-regression model |
title |
A character string (in quotes) specifying the title for the graphics window (optional) |
genplot |
Generate summary plots? (T or F) |
check |
Conduct compliance checks before processing? (T or F) In general this should be activated; the option is included for Monte Carlo simulation. |
verbose |
Verbose output? (T or F) |
TimeOpt is an astronomical testing algorithm for untuned (spatial) stratigraphic data. The algorithm identifies the sedimentation rate(s) that simultaneously optimizes: (1) eccentricity amplitude modulations within the precession band, and (2) the concentration of spectral power at specified target astronomical periods (Meyers, 2015). The method can also be adapted to evaluate records that express obliquity, as in Meyers (2019).
For each temporal calibration investigated (i.e., sedimentation rate), the observed precession band amplitude envelope is extracted using bandpass filtering and the Hilbert transform. The fit of the extracted precession envelope to the eccentricity periods is evaluated using a linear regression onto sine and cosine terms that reflect the five dominant eccentricity periods (~405.7, 130.7, 123.8, 98.9 and 94.9 kyr); amplitude and phase of the eccentricity terms are not assigned, but are determined during the linear model optimization. This approach is advantageous, as (1) the transfer functions associated with the climate and depositional systems can alter the amplitude and phase of the theoretical eccentricity terms (e.g, Laurin et al., 2005), and (2) the amplitude and phase of the eccentricity terms are unconstrained for deep-time investigations (>50 Ma). The quality of the "fit" is estimated by calculation of the correlation of the fitted eccentricity model time series to the observed precession band envelope (r^2_envelope), indicating the fraction of variance shared between the model and envelope.
The concentration of power at the target astronomical periods is evaluated using a linear regression of the temporally-calibrated series onto sine and cosine terms that reflect the dominant eccentricity and precession periods. As above, the amplitude and phase of each term is determined during the linear model optimization, and the quality of the "fit" is estimated by calculation of the correlation of the fitted astronomical model series to the temporally-calibrated series (r^2_spectral).
The final measure of fit (r^2_opt) is determined as:
r^2_opt = r^2_envelope * r^2_spectral
which is simply the product of the fraction of variance shared between "model and envelope" and "model and time-calibrated data". This optimization approach identifies the sedimentation rate at which the precession envelope strongly expresses expected eccentricity modulation, while simultaneously, spectral power is concentrated at the target astronomical periods. r^2_opt can take on values ranging from 0 to 1 (a perfect fit to the astronomical model), and provides a measure of overall quality of the astronomically calibrated time series. A similar approach is applicable to evaluate short eccentricity amplitude modulations. The statistical significance of the r^2_opt is determined via Monte Carlo simulation (see timeOptSim).
See the examples below and Meyers (2019) for a demonstration of how TimeOpt can be adapted to evaluate records that express obliquity.
if output = 1, a data frame containing the following will be returned: Sedimentation rate (cm/ka), r^2_envelope, r^2_spectral, r^2_opt
if output = 2, a data frame containing the following will be returned: Time (ka), tuned time series, filtered precession, precession envelope, TimeOpt-reconstructed eccentricity model, full TimeOpt-regression model
J. Laurin, S.R. Meyers, B.B. Sageman, and D.A. Waltham, 2005, Phase-lagged amplitude modulation of hemipelagic cycles: A potential tool for recognition and analysis of sea level change: Geology, 33, doi.org/10.1130/G21350.1.
S.R. Meyers, 2015, The evaluation of eccentricity-related amplitude modulation and bundling in paleoclimate data: An inverse approach for astrochronologic testing and time scale optimization: Paleoceanography, 30, doi.org/10.1002/2015PA002850.
S.R. Meyers, 2019, Cyclostratigraphy and the problem of astrochronologic testing: Earth-Science Reviews, 190, doi.org/10.1016/j.earscirev.2018.11.015.
asm
, eAsmTrack
, testPrecession
, timeOptPlot
, and timeOptSim
## Not run: # generate a test signal with precession and eccentricity ex=etp(tmin=1,tmax=1000,dt=5,pWt=1,oWt=0,eWt=1,esinw=TRUE,genplot=FALSE,verbose=FALSE) # convert to meters with sedimentation rate of 2 cm/kyr ex[1]<-ex[1]*0.02 timeOpt(ex,sedmin=0.5,sedmax=5,numsed=100,fit=1,output=0) # evaluate short eccentricity modulations timeOpt(ex,sedmin=0.5,sedmax=5,numsed=100,fit=2,output=0) # generate a test signal with precession ex=etp(tmin=1,tmax=1000,dt=5,pWt=1,oWt=0,eWt=0,esinw=TRUE,genplot=FALSE,verbose=FALSE) # convert to meters with sedimentation rate of 2 cm/kyr ex[1]<-ex[1]*0.02 timeOpt(ex,sedmin=0.5,sedmax=5,numsed=100,fit=1,output=0) # generate a test signal with precession, obliquity and eccentricity ex=etp(tmin=1,tmax=1000,dt=5,pWt=1,oWt=1,eWt=1,esinw=TRUE,genplot=FALSE,verbose=FALSE) # convert to meters with sedimentation rate of 2 cm/kyr ex[1]<-ex[1]*0.02 # define target periods for obliquity and precession targetOP=c(41.15226,23.62069,22.31868,19.06768,18.91979) timeOpt(ex,sedmin=0.5,sedmax=5,numsed=100,fit=1,targetP=targetOP,output=0) # generate a test signal with obliquity ex=etp(tmin=1,tmax=1500,dt=5,pWt=0,oWt=1,eWt=0,genplot=FALSE,verbose=FALSE) # convert to meters with sedimentation rate of 2 cm/kyr ex[1]<-ex[1]*0.02 # define target periods for obliquity and obliquity amplitude modulation targetO=c(41.15226) targetO_AM=c(1250,175.4386,109.8901,95.2381) timeOpt(ex,sedmin=0.5,sedmax=5,numsed=100,fit=1,fitModPwr=F,targetP=targetO, targetE=targetO_AM,flow=1/70,fhigh=1/26,roll=10^15,output=0) ## End(Not run)
## Not run: # generate a test signal with precession and eccentricity ex=etp(tmin=1,tmax=1000,dt=5,pWt=1,oWt=0,eWt=1,esinw=TRUE,genplot=FALSE,verbose=FALSE) # convert to meters with sedimentation rate of 2 cm/kyr ex[1]<-ex[1]*0.02 timeOpt(ex,sedmin=0.5,sedmax=5,numsed=100,fit=1,output=0) # evaluate short eccentricity modulations timeOpt(ex,sedmin=0.5,sedmax=5,numsed=100,fit=2,output=0) # generate a test signal with precession ex=etp(tmin=1,tmax=1000,dt=5,pWt=1,oWt=0,eWt=0,esinw=TRUE,genplot=FALSE,verbose=FALSE) # convert to meters with sedimentation rate of 2 cm/kyr ex[1]<-ex[1]*0.02 timeOpt(ex,sedmin=0.5,sedmax=5,numsed=100,fit=1,output=0) # generate a test signal with precession, obliquity and eccentricity ex=etp(tmin=1,tmax=1000,dt=5,pWt=1,oWt=1,eWt=1,esinw=TRUE,genplot=FALSE,verbose=FALSE) # convert to meters with sedimentation rate of 2 cm/kyr ex[1]<-ex[1]*0.02 # define target periods for obliquity and precession targetOP=c(41.15226,23.62069,22.31868,19.06768,18.91979) timeOpt(ex,sedmin=0.5,sedmax=5,numsed=100,fit=1,targetP=targetOP,output=0) # generate a test signal with obliquity ex=etp(tmin=1,tmax=1500,dt=5,pWt=0,oWt=1,eWt=0,genplot=FALSE,verbose=FALSE) # convert to meters with sedimentation rate of 2 cm/kyr ex[1]<-ex[1]*0.02 # define target periods for obliquity and obliquity amplitude modulation targetO=c(41.15226) targetO_AM=c(1250,175.4386,109.8901,95.2381) timeOpt(ex,sedmin=0.5,sedmax=5,numsed=100,fit=1,fitModPwr=F,targetP=targetO, targetE=targetO_AM,flow=1/70,fhigh=1/26,roll=10^15,output=0) ## End(Not run)
TimeOptMCMC: Evaluation of eccentricity-related amplitude modulation and bundling in paleoclimate data ("TimeOpt"; Meyers, 2015), with uncertainties on all fitting parameters via Markov-Chain Monte Carlo (MCMC). This function follows the approach of Meyers and Malinverno (2018). MCMC is implemented using the Metropolis-Hastings algorithm. Optimization is conducted upon the sedimentation rate (constant within the study interval), the fundamental frequencies g1-g5, the precession constant k, and four hyperparameters associated with the residuals from the spectral and envelope fit. The priors for the k and g's are Gaussian, while other parameters (sedrate, hyperparameters) are uniform (uninformative).
timeOptMCMC(dat,iopt=1,sedmin=0.5,sedmax=5,sedstart=NULL,gAve=NULL, gSd=NULL,gstart=NULL,kAve=NULL,kSd=NULL,kstart=NULL, rhomin=0,rhomax=0.9999,rhostart=NULL,sigmamin=NULL,sigmamax=NULL,sigmastart=NULL, ran=T,fit=1,ftol=0.01,roll=10^3,nsamples=1000,epsilon=NULL,test=F,burnin=-1, detrend=T,output=1,savefile=F,genplot=1,verbose=T)
timeOptMCMC(dat,iopt=1,sedmin=0.5,sedmax=5,sedstart=NULL,gAve=NULL, gSd=NULL,gstart=NULL,kAve=NULL,kSd=NULL,kstart=NULL, rhomin=0,rhomax=0.9999,rhostart=NULL,sigmamin=NULL,sigmamax=NULL,sigmastart=NULL, ran=T,fit=1,ftol=0.01,roll=10^3,nsamples=1000,epsilon=NULL,test=F,burnin=-1, detrend=T,output=1,savefile=F,genplot=1,verbose=T)
dat |
Stratigraphic series for astrochronologic assessment. First column should be depth or height (in meters), second column should be data value. |
iopt |
(1) fit power and envelope, (2) fit power only. |
sedmin |
Minimum sedimentation rate for investigation (cm/ka). |
sedmax |
Maximum sedimentation rate for investigation (cm/ka). |
sedstart |
Initial sedimentation rate for MCMC search (cm/ka). Default is 0.5*(sedmin+sedmax). Alternatively, if set to negative number, a random value is selected from the prior distribution. |
gAve |
Vector which contains the average values for the g1 through g5 fundamental frequencies (arcsec/year). Must be in the following order: g1,g2,g3,g4,g5. |
gSd |
Vector which contains the standard deviation for the g1 through g5 fundamental frequencies (arcsec/year). Must be in the following order: g1,g2,g3,g4,g5. |
gstart |
Vector which contains the initial values for the g1 through g5 fundamental frequencies (arcsec/year). Must be in the following order: g1,g2,g3,g4,g5. Default is 0.5*(gmin+gmax). Alternatively, if set to negative number, a random value is selected from the prior distribution. |
kAve |
Average value for the precession constant (arcsec/year). |
kSd |
Standard deviation for the precession constant (arcsec/year). |
kstart |
Initial value for the precession constant (arcsec/year). Default is 0.5*(kmin+kmax). Alternatively, if set to negative number, a random value is selected from the prior distribution. |
rhomin |
Minimum value for residual lag-1 autocorrelation (for both spectral and envelope fit). Default is 0. |
rhomax |
Maximum value for residual lag-1 autocorrelation (for both spectral and envelope fit). Default is 0.9999 |
rhostart |
Initial value for residual lag-1 autocorrelation (for both spectral and envelope fit). Default 0.5. Alternatively, if set to negative number, a random value is selected from the prior distribution. |
sigmamin |
Minimum value for residual sigma (for both spectral and envelope fit). |
sigmamax |
Maximum value for residual sigma (for both spectral and envelope fit). |
sigmastart |
Initial value for residual sigma (for both spectral and envelope fit). Default 0.5*(data standard deviation). Alternatively, if set to negative number, a random value is selected from the prior distribution. |
ran |
Would you like to randomly select the parameter for updating (T), or simultaneously update all the parameters (F)? |
fit |
Test for (1) precession amplitude modulation or (2) short eccentricity amplitude modulation? Option 2 is not yet functional! |
ftol |
Tolerance in cycles/ka used to define the precession bandpass. It is added to the highest precession frequency, and subtracted from the lowest precession frequency, to define the half power points for the Taner bandpass filter. |
roll |
Taner filter roll-off rate, in dB/octave. |
nsamples |
Number of candidate MCMC simluations to perform. |
epsilon |
Vector of dimension 11, which controls how large the jump is between each candidate value, e.g. sedimentation rate. For example, a value of 0.2 will yield maximum jump +/- 10 percent of sedimentation rate range. The vector must be arranged in the the following order: sedrate,k,g1,g2,g3,g4,g5,spec_rho,spec_sigma,env_rho,env_sigma. If NULL, all epsilon values will be assigned 0.2 |
test |
Activate epsilon testing mode? This option will assign all MCMC samples a log-likelihood of unity. This provides a diagnostic check to ensure that the applied epsilon values are sampling the entire range of parameter values. (T or F) |
burnin |
Threshold for detection of MCMC stability. |
detrend |
Remove linear trend from data series? (T or F) |
output |
Which results would you like to return to the console? (0) no output; (1) return all MCMC candidates |
savefile |
Save MCMC samples to file MCMCsamples.csv? (T or F). If true, results are output after every 1000 iterations (last iterations will not be reported if you do not end on an even thousand!) |
genplot |
Generate summary plots? (0= none; 1=display all summary plots; 2=also include progress plot during iterations; 3=be quiet, but save all plots as pngs to the working directory) |
verbose |
Verbose output? (T or F) |
TimeOpt is an astronomical testing algorithm for untuned (spatial) stratigraphic data. The algorithm identifies the sedimentation rate(s) that simultaneously optimizes: (1) eccentricity amplitude modulations within the precession band, and (2) the concentration of spectral power at specified target astronomical periods.
This version of TimeOpt uses MCMC via Metropolis-Hastings to estimate the parameters and their uncertainties. The priors for the k and g's are Gaussian, while the other parameters (sedrate, hyperparameters) are uniform (uninformative).
When ran=T, the following approach is used to select the parameter to modify:
0.25 probability of changing sedimentation rate
0.25 probability of changing k
0.30 probability of changing g1,g2,g3,g4,g5 (simultaneously)
0.10 probability of changing sigma_spec,rho_spec (simultaneously)
0.10 probability of changing sigma_env,rho_env (simultaneously)
This is motivated by sensitivity tests, and the fact that we are most interested in g, k and s; moving each group of parameters (sedrate, k or g's) has specific consequences we can isolate.
For additional guidance on the application of TimeOptMCMC, please see the guide "Bayesian Inversion with TimeOptMCMC" (Meyers, 2024), and Meyers and Malinverno (2018).
S.R. Meyers, 2024, Bayesian Inversion with TimeOptMCMC: EarthArXiv, https://doi.org/10.31223/X5DQ3H
S.R. Meyers, 2015, The evaluation of eccentricity-related amplitude modulation and bundling in paleoclimate data: An inverse approach for astrochronologic testing and time scale optimization: Paleoceanography, 30, doi:10.1002/2015PA002850.
S.R. Meyers and A. Malinverno, 2018, Proterozoic Milankovitch cycles and the history of the solar system: Proceedings of the National Academy of Sciences, www.pnas.org/cgi/doi/10.1073/pnas.1717689115.
TimeOptPlot: Generate summary figure for TimeOpt analyses.
timeOptPlot(dat=NULL,res1=NULL,res2=NULL,simres=NULL,fit=1,fitModPwr,flow=NULL, fhigh=NULL,roll=NULL,targetE=NULL,targetP=NULL,xlab="Depth (m)", ylab="Proxy Value",fitR=NULL,verbose=T)
timeOptPlot(dat=NULL,res1=NULL,res2=NULL,simres=NULL,fit=1,fitModPwr,flow=NULL, fhigh=NULL,roll=NULL,targetE=NULL,targetP=NULL,xlab="Depth (m)", ylab="Proxy Value",fitR=NULL,verbose=T)
dat |
Stratigraphic series used for astrochronologic assessment. First column should be depth or height (in meters), second column should be data value. |
res1 |
Data frame containing TimeOpt results: sedimentation rate grid, r^2_envelope, r^2_power, r^2_opt. |
res2 |
Data frame containing the optimal-fitted time series, bandpassed series, envelope, and reconstructed eccentricity model. |
simres |
Data frame containing the r^2_opt value for each Monte Carlo simulation. |
fit |
Test for (1) precession amplitude modulation or (2) short eccentricity amplitude modulation? |
fitModPwr |
Include the modulation periods in the spectral fit? (T or F) |
flow |
Low frequency cut-off for Taner bandpass (half power point; in cycles/ka). |
fhigh |
High frequency cut-off for Taner bandpass (half power point; in cycles/ka). |
roll |
Taner filter roll-off rate, in dB/octave. |
targetE |
A vector of eccentricity periods to evaluate (in ka). These must be in order of decreasing period, with a first value of 405 ka. |
targetP |
A vector of precession periods to evaluate (in ka). These must be in order of decreasing period. |
xlab |
Label for the depth/height axis. |
ylab |
Label for proxy variable evaluated. |
fitR |
The r2_opt value at the optimal sedimentation rate. |
verbose |
Verbose output? (T or F) |
S.R. Meyers, 2015, The evaluation of eccentricity-related amplitude modulation and bundling in paleoclimate data: An inverse approach for astrochronologic testing and time scale optimization: Paleoceanography, 30, doi:10.1002/2015PA002850.
asm
, eAsmTrack
, testPrecession
, timeOpt
, and timeOptSim
## Not run: # generate a test signal with precession and eccentricity ex=etp(tmin=1,tmax=1000,dt=1,pWt=1,oWt=0,eWt=1,esinw=TRUE,genplot=FALSE,verbose=FALSE) # convert to meters with sedimentation rate of 2 cm/kyr ex[1]<-ex[1]*0.02 # evaluate precession modulations res1=timeOpt(ex,sedmin=0.5,sedmax=5,numsed=100,fit=1,output=1) res2=timeOpt(ex,sedmin=0.5,sedmax=5,numsed=100,fit=1,output=2) simres=timeOptSim(ex,sedmin=0.5,sedmax=5,numsed=100,numsim=2000,fit=1,output=2) timeOptPlot(ex,res1,res2,simres,flow=0.035,fhigh=0.065,roll=10^3, targetE=c(405.6795,130.719,123.839,98.86307,94.87666), targetP=c(23.62069,22.31868,19.06768,18.91979),xlab="Depth (m)", ylab="Value",fitR=0.832,verbose=T) ## End(Not run)
## Not run: # generate a test signal with precession and eccentricity ex=etp(tmin=1,tmax=1000,dt=1,pWt=1,oWt=0,eWt=1,esinw=TRUE,genplot=FALSE,verbose=FALSE) # convert to meters with sedimentation rate of 2 cm/kyr ex[1]<-ex[1]*0.02 # evaluate precession modulations res1=timeOpt(ex,sedmin=0.5,sedmax=5,numsed=100,fit=1,output=1) res2=timeOpt(ex,sedmin=0.5,sedmax=5,numsed=100,fit=1,output=2) simres=timeOptSim(ex,sedmin=0.5,sedmax=5,numsed=100,numsim=2000,fit=1,output=2) timeOptPlot(ex,res1,res2,simres,flow=0.035,fhigh=0.065,roll=10^3, targetE=c(405.6795,130.719,123.839,98.86307,94.87666), targetP=c(23.62069,22.31868,19.06768,18.91979),xlab="Depth (m)", ylab="Value",fitR=0.832,verbose=T) ## End(Not run)
Perform Monte Carlo AR1 simulations to evaluate significance of TimeOpt results, as in Meyers (2015).
timeOptSim(dat,numsim=2000,rho=NULL,sedrate=NULL,sedmin=0.5,sedmax=5,numsed=100, linLog=1,limit=T,fit=1,r2max=1,fitModPwr=T,flow=NULL,fhigh=NULL,roll=NULL, targetE=NULL,targetP=NULL,detrend=T,ncores=2,output=0,genplot=T, check=T,verbose=T)
timeOptSim(dat,numsim=2000,rho=NULL,sedrate=NULL,sedmin=0.5,sedmax=5,numsed=100, linLog=1,limit=T,fit=1,r2max=1,fitModPwr=T,flow=NULL,fhigh=NULL,roll=NULL, targetE=NULL,targetP=NULL,detrend=T,ncores=2,output=0,genplot=T, check=T,verbose=T)
dat |
Stratigraphic series for astrochronologic assessment. First column should be depth or height (in meters), second column should be data value. |
numsim |
Number of Monte Carlo AR1 simulations. |
rho |
AR1 coefficient to use in simulations. By default this will be estimated from the stratigraphic series. |
sedrate |
Sedimentation rate for investigation (cm/ka). This option is for compatibility with prior versions of timeOptSim. Please use sedmin, sedmax, numsed. |
sedmin |
Minimum sedimentation rate for investigation (cm/ka). |
sedmax |
Maximum sedimentation rate for investigation (cm/ka). |
numsed |
Number of sedimentation rates to investigate in optimization grid. |
linLog |
Use linear or logarithmic scaling for sedimentation rate grid spacing? (0=linear, 1=log) |
limit |
Limit evaluated sedimentation rates to region in which full target signal can be recovered? (T or F) |
fit |
Test for (1) precession amplitude modulation or (2) short eccentricity amplitude modulation? |
r2max |
Which maximum in r2 do you want to use for the time model calibration? (1) r^2_opt, (2) r^2_spectral, (3) r^2_envelope |
fitModPwr |
Include the modulation periods in the spectral fit? (T or F) |
flow |
Low frequency cut-off for Taner bandpass (half power point; in cycles/ka) |
fhigh |
High frequency cut-off for Taner bandpass (half power point; in cycles/ka) |
roll |
Taner filter roll-off rate, in dB/octave. |
targetE |
A vector of eccentricity periods to evaluate (in ka). These must be in order of decreasing period, with a first value of 405 ka. |
targetP |
A vector of precession periods to evaluate (in ka). These must be in order of decreasing period. |
detrend |
Remove linear trend from data series? (T or F) |
ncores |
Number of cores to use for parallel processing. Must be >=2 |
output |
Which results would you like to return to console? (0) no output; (1) p-value; (2) simulation r2 results |
genplot |
Generate summary plots? (T or F) |
check |
Conduct compliance checks before processing? (T or F). In general this should be activated. |
verbose |
Verbose output? (T or F) |
TimeOpt is an astronomical testing algorithm for untuned (spatial) stratigraphic data. The algorithm identifies the sedimentation rate(s) that simultaneously optimizes: (1) eccentricity amplitude modulations within the precession band, and (2) the concentration of spectral power at specified target astronomical periods. The statistical significance of the r^2_opt is determined via Monte Carlo simulation using timeOptSim.
The present version of timeOptSim improves upon the original significance testing method of Meyers (2015), by conducting simulations across the entire sedimentation grid. This approach more rigorously protects against inflation of the p-value due to multiple testing. Parallel processing has been implemented to address the greater computational demand that is required.
See timeOpt for more information on the basic methodology.
S.R. Meyers, 2015, The evaluation of eccentricity-related amplitude modulations and bundling in paleoclimate data: An inverse approach for astrochronologic testing and time scale optimization: Paleoceanography.
asm
, eAsm
, eAsmTrack
, testPrecession
, timeOpt
, and timeOptPlot
## Not run: # generate a test signal with precession and eccentricity ex=etp(tmin=1,tmax=1000,dt=5,pWt=1,oWt=0,eWt=1,esinw=TRUE,genplot=FALSE,verbose=FALSE) # convert to meters with sedimentation rate of 2 cm/kyr ex[1]<-ex[1]*0.02 # evaluate with timeOptSim. be patient, this may take a while to run. timeOptSim(ex,sedmin=0.5,sedmax=5,numsed=100) ## End(Not run)
## Not run: # generate a test signal with precession and eccentricity ex=etp(tmin=1,tmax=1000,dt=5,pWt=1,oWt=0,eWt=1,esinw=TRUE,genplot=FALSE,verbose=FALSE) # convert to meters with sedimentation rate of 2 cm/kyr ex[1]<-ex[1]*0.02 # evaluate with timeOptSim. be patient, this may take a while to run. timeOptSim(ex,sedmin=0.5,sedmax=5,numsed=100) ## End(Not run)
Perform Monte Carlo power law (1/f) simulations to evaluate significance of TimeOpt results, as in Meyers (2015).
timeOptSimPwrLaw(dat,numsim=2000,beta=NULL,sedrate=NULL,sedmin=0.5,sedmax=5,numsed=100, linLog=1,limit=T,fit=1,r2max=1,fitModPwr=T,flow=NULL,fhigh=NULL,roll=NULL, targetE=NULL,targetP=NULL,detrend=T,ncores=2,output=0,genplot=T, check=T,verbose=T)
timeOptSimPwrLaw(dat,numsim=2000,beta=NULL,sedrate=NULL,sedmin=0.5,sedmax=5,numsed=100, linLog=1,limit=T,fit=1,r2max=1,fitModPwr=T,flow=NULL,fhigh=NULL,roll=NULL, targetE=NULL,targetP=NULL,detrend=T,ncores=2,output=0,genplot=T, check=T,verbose=T)
dat |
Stratigraphic series for astrochronologic assessment. First column should be depth or height (in meters), second column should be data value. |
numsim |
Number of Monte Carlo power law (1/f) simulations. |
beta |
Power law coefficient for 1/f noise. Positive number yields a negative slope. By default this will be estimated from the stratigraphic series. |
sedrate |
Sedimentation rate for investigation (cm/ka). This option is for compatibility with prior versions of timeOptSim. Please use sedmin, sedmax, numsed. |
sedmin |
Minimum sedimentation rate for investigation (cm/ka). |
sedmax |
Maximum sedimentation rate for investigation (cm/ka). |
numsed |
Number of sedimentation rates to investigate in optimization grid. |
linLog |
Use linear or logarithmic scaling for sedimentation rate grid spacing? (0=linear, 1=log) |
limit |
Limit evaluated sedimentation rates to region in which full target signal can be recovered? (T or F) |
fit |
Test for (1) precession amplitude modulation or (2) short eccentricity amplitude modulation? |
r2max |
Which maximum in r2 do you want to use for the time model calibration? (1) r^2_opt, (2) r^2_spectral, (3) r^2_envelope |
fitModPwr |
Include the modulation periods in the spectral fit? (T or F) |
flow |
Low frequency cut-off for Taner bandpass (half power point; in cycles/ka) |
fhigh |
High frequency cut-off for Taner bandpass (half power point; in cycles/ka) |
roll |
Taner filter roll-off rate, in dB/octave. |
targetE |
A vector of eccentricity periods to evaluate (in ka). These must be in order of decreasing period, with a first value of 405 ka. |
targetP |
A vector of precession periods to evaluate (in ka). These must be in order of decreasing period. |
detrend |
Remove linear trend from data series? (T or F) |
ncores |
Number of cores to use for parallel processing. Must be >=2 |
output |
Which results would you like to return to console? (0) no output; (1) p-value; (2) simulation r2 results |
genplot |
Generate summary plots? (T or F) |
check |
Conduct compliance checks before processing? (T or F). In general this should be activated. |
verbose |
Verbose output? (T or F) |
TimeOpt is an astronomical testing algorithm for untuned (spatial) stratigraphic data. The algorithm identifies the sedimentation rate(s) that simultaneously optimizes: (1) eccentricity amplitude modulations within the precession band, and (2) the concentration of spectral power at specified target astronomical periods. The statistical significance of the r^2_opt is determined via Monte Carlo simulation using timeOptSim.
The present version of timeOptSim improves upon the original significance testing method of Meyers (2015), by conducting simulations across the entire sedimentation grid. This approach more rigorously protects against inflation of the p-value due to multiple testing. Parallel processing has been implemented to address the greater computational demand that is required.
See timeOpt for more information on the basic methodology.
S.R. Meyers, 2015, The evaluation of eccentricity-related amplitude modulations and bundling in paleoclimate data: An inverse approach for astrochronologic testing and time scale optimization: Paleoceanography.
asm
, eAsm
, eAsmTrack
, testPrecession
, timeOpt
, and timeOptPlot
## Not run: # generate a test signal with precession and eccentricity ex=etp(tmin=1,tmax=1000,dt=5,pWt=1,oWt=0,eWt=1,esinw=TRUE,genplot=FALSE,verbose=FALSE) # convert to meters with sedimentation rate of 2 cm/kyr ex[1]<-ex[1]*0.02 # evaluate with timeOptSim. be patient, this may take a while to run. timeOptSimPwrLaw(ex,sedmin=0.5,sedmax=5,numsed=100) ## End(Not run)
## Not run: # generate a test signal with precession and eccentricity ex=etp(tmin=1,tmax=1000,dt=5,pWt=1,oWt=0,eWt=1,esinw=TRUE,genplot=FALSE,verbose=FALSE) # convert to meters with sedimentation rate of 2 cm/kyr ex[1]<-ex[1]*0.02 # evaluate with timeOptSim. be patient, this may take a while to run. timeOptSimPwrLaw(ex,sedmin=0.5,sedmax=5,numsed=100) ## End(Not run)
Evaluation of eccentricity-related amplitude modulations and bundling in paleoclimate data, as in Meyers (2015) and Meyers (2019), adapted to allow the evaluation of a wide range of variable sedimentation models, including: differential accumulation across bedding couplets, linear accumulation rate change, step changes in sedimentation rate, etc.
timeOptTemplate(dat,template=NULL,sedmin=0.5,sedmax=5,difmin=NULL,difmax=NULL,fac=NULL, numsed=50,linLog=1,limit=T,fit=1,fitModPwr=T,iopt=3,flow=NULL,fhigh=NULL, roll=NULL,targetE=NULL,targetP=NULL,cormethod=1,detrend=T,detrendTemplate=F, flipTemplate=F,ncores=1,output=0,genplot=1,check=T,verbose=1)
timeOptTemplate(dat,template=NULL,sedmin=0.5,sedmax=5,difmin=NULL,difmax=NULL,fac=NULL, numsed=50,linLog=1,limit=T,fit=1,fitModPwr=T,iopt=3,flow=NULL,fhigh=NULL, roll=NULL,targetE=NULL,targetP=NULL,cormethod=1,detrend=T,detrendTemplate=F, flipTemplate=F,ncores=1,output=0,genplot=1,check=T,verbose=1)
dat |
Stratigraphic series for astrochronologic assessment. First column should be depth or height (in meters), second column should be data value. |
template |
Instantaneous sedimentation rate template to fit. This represents a unitless proportional sedimentation rate history. Default model is a copy of dat, which will be scaled for instantaneous accumulation optimization. |
sedmin |
Minimum AVERAGE sedimentation rate for investigation (cm/ka). |
sedmax |
Maximum AVERAGE sedimentation rate for investigation (cm/ka). |
difmin |
Minimum instantaneous sedimentation rate to investigate (cm/ka). |
difmax |
Maximum instantaneous sedimentation rate to investigate (cm/ka). By default, this is ignored, and fac is used. |
fac |
Maximum instantaneous accumulation factor. Maximum rate is scaled to each investigated sedrate as fac*sedrate. Default value of 5 is based on experimentation. If larger than this, risk getting into local minimum during fit. |
numsed |
Number of sedimentation rates to investigate in optimization grid. |
linLog |
Use linear or logarithmic scaling for sedimentation rate grid spacing? (0=linear, 1=log) |
limit |
Limit evaluated sedimentation rates to region in which full target signal can be recovered? (T or F) |
fit |
Test for (1) precession amplitude modulations or (2) short eccentricity amplitude modulations? |
fitModPwr |
Include the modulation periods in the spectral fit? (T or F) |
iopt |
Optimize on (1) modulations, (2) spectral power, (3) modulations*spectral power |
flow |
Low frequency cut-off for Taner bandpass (half power point; in cycles/ka) |
fhigh |
High frequency cut-off for Taner bandpass (half power point; in cycles/ka) |
roll |
Taner filter roll-off rate, in dB/octave. Default value is 10^3. |
targetE |
A vector of eccentricity periods to evaluate (in ka). These must be in order of decreasing period, with first value of 405 ka. |
targetP |
A vector of precession periods to evaluate (in ka). These must be in order of decreasing period. |
cormethod |
Method used for calculation of correlation coefficient (1=Pearson, 2=Spearman) |
detrend |
Remove linear trend from data series? (T or F) |
detrendTemplate |
Remove linear trend from sedimentation rate template? (T or F) |
flipTemplate |
Flip direction of sedimentation rate template? (T or F) |
ncores |
Number of cores to use for parallel processing |
output |
Which results you like to return to console? (0) no output; (1) return sedimentation rate grid, r2opt; (2) return optimal time series, bandpassed series, Hilbert and fitted periods; (3) return the optimal sedimentation rate at each depth or height |
genplot |
Generate summary plots? (0 = nothing, 1=summary plot, 2=progress + summary plots) |
check |
Conduct compliance checks before processing? (T or F) In general this should be activated; the option is included for Monte Carlo simulation. |
verbose |
Verbose output? (0 = nothing, 1=minimal, 2=everything) |
TimeOpt employs a probabilistic linear regression model framework to investigate amplitude modulation and frequency ratios (bundling) in stratigraphic data, while simultaneously determining the optimal time scale. This function further develops the method to optimize upon complex sedimentation templates. The approach is demonstrated below with a series of examples.
The statistical significance of the r^2_opt is determined via Monte Carlo simulation (see timeOptSim). See timeOpt for more information on the basic methodology.
if output = 1, a data frame containing the following will be returned: Sedimentation rate (cm/ka), r-squared value (r^2_envelope, r^2_spectra, or r^2_opt)
if output = 2, a data frame containing the following will be returned: Time (ka), tuned time series, bandpassed series, envelope, TimeOpt-reconstructed eccentricity model
S.R. Meyers, 2015, The evaluation of eccentricity-related amplitude modulations and bundling in paleoclimate data: An inverse approach for astrochronologic testing and time scale optimization: Paleoceanography, v.30, 1625-1640.
S.R. Meyers, 2019, Cyclostratigraphy and the problem of astrochronologic testing: Earth-Science Reviews v.190, 190-223.
asm
, eAsmTrack
, testPrecession
, timeOpt
, timeOptSim
, and timeOptTemplatePlot
## Not run: # EXAMPLE (1): Differential accumulation across bedding couplets ex=etp(tmin=0,tmax=1000,dt=5,pWt=1,oWt=0,eWt=1,esinw=TRUE) ex2=diffAccum(ex,0.01,.05) ex2=linterp(ex2) # first with the nominal timeOpt approach timeOpt(ex2,sedmin=1,sedmax=4,numsed=100) timeOptSim(ex2,sedmin=1,sedmax=4,numsed=100,numsim=2000) # then with the timeOptTemplate approach timeOptTemplate(ex2,sedmin=1,sedmax=4,difmin=.5,difmax=6,numsed=100,ncores=2) timeOptTemplateSim(ex2,sedmin=1,sedmax=4,difmin=.5,difmax=6,numsed=100,numsim=1000, ncores=2) # EXAMPLE (2): Linear sedimentation rate increase ex=etp(tmin=0,tmax=1000,dt=5,pWt=1,oWt=0,eWt=1,esinw=TRUE) ex2=sedRamp(ex,srstart=0.01,srend=0.05) ex2=linterp(ex2) # first with the nominal timeOpt approach timeOpt(ex2,sedmin=1,sedmax=4,numsed=100) # then with the timeOptTemplate approach # create linear model for input. the magnitude does not matter, it will be rescaled. # (it just needs to be a line) template=ex2; template[2]=ex2[1] timeOptTemplate(ex2,template=template,sedmin=1,sedmax=4,difmin=.5,difmax=6,numsed=100,ncores=2) # view optimization procedure (must set ncores=1) timeOptTemplate(ex2,template=template,sedmin=2.75,sedmax=3.25,difmin=.5,difmax=6,numsed=20, ncores=1,genplot=2) # EXAMPLE (3): Step increase in sedimentation rate, from 1 cm/kyr to 2 cm/kyr at 7 meters depth ex=etp(tmin=0,tmax=1000,dt=5,pWt=1,oWt=0,eWt=1,esinw=TRUE) ex2=ex ex2[1]=ex[1]*.01 ex2[141:201,1]=ex2[141:201,1]*2-7 ex2=linterp(ex2) # first with the nominal timeOpt approach timeOpt(ex2,sedmin=1,sedmax=4,numsed=100) # then with the timeOptTemplate approach # create step model for input. the magnitude does not matter, it will be rescaled. template=ex2; template[1:140,2]=1; template[141:261,2]=2 timeOptTemplate(ex2,template=template,sedmin=1,sedmax=4,numsed=100,ncores=2) # view optimization procedure (must set ncores=1) timeOptTemplate(ex2,template=template,sedmin=1,sedmax=2,numsed=20,ncores=1,genplot=2) # EXAMPLE (4): A record with a 100 kyr hiatus at 10 meters depth ex=etp(tmin=0,tmax=1000,dt=5,pWt=1,oWt=0,eWt=1,esinw=TRUE) ex2=delPts(ex,del=101:121) # use a background sedimentation rate of 2 cm/kyr ex2[1]=0:179*5*0.02 # first evaluate the distorted record with the nominal timeOpt approach timeOpt(ex2,sedmin=1,sedmax=4,numsed=100) # then with the timeOptTemplate approach # create a constant sedimentation rate template with possible hiatus of unknown # duration at 10 m template=ex2; template[2]=10; template[101,2]=1 timeOptTemplate(ex2,template=template,sedmin=1,sedmax=3,difmax=3,numsed=100,ncores=2) # now perform a finer grid search near the maximum, using power only # notice the oscillatory nature of the power fit. res=timeOptTemplate(ex2,template=template,sedmin=1.5,sedmax=2,difmax=3,numsed=100, ncores=2,iopt=2,output=2) # compare true eccentricity to TimeOpt-derived eccentricity pl(2) plot(ex,type="l",main="True Eccentricity Series",xlab="True Time (kyr)",ylab="") plot(res[,1],res[,4],type="l",main="Black=TimeOpt precession AM; Red=TimeOpt eccentricity model", xlab="TimeOpt derived time (kyr)",ylab="") lines(res[,1],res[,5],col="red",lwd=2) ## End(Not run)
## Not run: # EXAMPLE (1): Differential accumulation across bedding couplets ex=etp(tmin=0,tmax=1000,dt=5,pWt=1,oWt=0,eWt=1,esinw=TRUE) ex2=diffAccum(ex,0.01,.05) ex2=linterp(ex2) # first with the nominal timeOpt approach timeOpt(ex2,sedmin=1,sedmax=4,numsed=100) timeOptSim(ex2,sedmin=1,sedmax=4,numsed=100,numsim=2000) # then with the timeOptTemplate approach timeOptTemplate(ex2,sedmin=1,sedmax=4,difmin=.5,difmax=6,numsed=100,ncores=2) timeOptTemplateSim(ex2,sedmin=1,sedmax=4,difmin=.5,difmax=6,numsed=100,numsim=1000, ncores=2) # EXAMPLE (2): Linear sedimentation rate increase ex=etp(tmin=0,tmax=1000,dt=5,pWt=1,oWt=0,eWt=1,esinw=TRUE) ex2=sedRamp(ex,srstart=0.01,srend=0.05) ex2=linterp(ex2) # first with the nominal timeOpt approach timeOpt(ex2,sedmin=1,sedmax=4,numsed=100) # then with the timeOptTemplate approach # create linear model for input. the magnitude does not matter, it will be rescaled. # (it just needs to be a line) template=ex2; template[2]=ex2[1] timeOptTemplate(ex2,template=template,sedmin=1,sedmax=4,difmin=.5,difmax=6,numsed=100,ncores=2) # view optimization procedure (must set ncores=1) timeOptTemplate(ex2,template=template,sedmin=2.75,sedmax=3.25,difmin=.5,difmax=6,numsed=20, ncores=1,genplot=2) # EXAMPLE (3): Step increase in sedimentation rate, from 1 cm/kyr to 2 cm/kyr at 7 meters depth ex=etp(tmin=0,tmax=1000,dt=5,pWt=1,oWt=0,eWt=1,esinw=TRUE) ex2=ex ex2[1]=ex[1]*.01 ex2[141:201,1]=ex2[141:201,1]*2-7 ex2=linterp(ex2) # first with the nominal timeOpt approach timeOpt(ex2,sedmin=1,sedmax=4,numsed=100) # then with the timeOptTemplate approach # create step model for input. the magnitude does not matter, it will be rescaled. template=ex2; template[1:140,2]=1; template[141:261,2]=2 timeOptTemplate(ex2,template=template,sedmin=1,sedmax=4,numsed=100,ncores=2) # view optimization procedure (must set ncores=1) timeOptTemplate(ex2,template=template,sedmin=1,sedmax=2,numsed=20,ncores=1,genplot=2) # EXAMPLE (4): A record with a 100 kyr hiatus at 10 meters depth ex=etp(tmin=0,tmax=1000,dt=5,pWt=1,oWt=0,eWt=1,esinw=TRUE) ex2=delPts(ex,del=101:121) # use a background sedimentation rate of 2 cm/kyr ex2[1]=0:179*5*0.02 # first evaluate the distorted record with the nominal timeOpt approach timeOpt(ex2,sedmin=1,sedmax=4,numsed=100) # then with the timeOptTemplate approach # create a constant sedimentation rate template with possible hiatus of unknown # duration at 10 m template=ex2; template[2]=10; template[101,2]=1 timeOptTemplate(ex2,template=template,sedmin=1,sedmax=3,difmax=3,numsed=100,ncores=2) # now perform a finer grid search near the maximum, using power only # notice the oscillatory nature of the power fit. res=timeOptTemplate(ex2,template=template,sedmin=1.5,sedmax=2,difmax=3,numsed=100, ncores=2,iopt=2,output=2) # compare true eccentricity to TimeOpt-derived eccentricity pl(2) plot(ex,type="l",main="True Eccentricity Series",xlab="True Time (kyr)",ylab="") plot(res[,1],res[,4],type="l",main="Black=TimeOpt precession AM; Red=TimeOpt eccentricity model", xlab="TimeOpt derived time (kyr)",ylab="") lines(res[,1],res[,5],col="red",lwd=2) ## End(Not run)
TimeOptTemplatePlot: Generate summary figure for TimeOptTemplate analyses.
timeOptTemplatePlot(dat=NULL,template=NULL,detrend=T,detrendTemplate=F,flipTemplate=F, srMin=NULL,srMax=NULL,res1=NULL,simres=NULL,fit=1,flow=NULL,fhigh=NULL,roll=NULL, targetE=NULL,targetP=NULL,xlab="Depth (m)",ylab="Proxy Value",fitR=NULL,output=0, verbose=T)
timeOptTemplatePlot(dat=NULL,template=NULL,detrend=T,detrendTemplate=F,flipTemplate=F, srMin=NULL,srMax=NULL,res1=NULL,simres=NULL,fit=1,flow=NULL,fhigh=NULL,roll=NULL, targetE=NULL,targetP=NULL,xlab="Depth (m)",ylab="Proxy Value",fitR=NULL,output=0, verbose=T)
dat |
Stratigraphic series used for astrochronologic assessment. First column should be depth or height (in meters), second column should be data value. |
template |
Instantaneous sedimentation rate template to fit. This represents a unitless proportional sedimentation rate history. Default model is a copy of dat, which will be scaled for instantaneous accumulation optimization. |
detrend |
Remove linear trend from data series? (T or F) |
detrendTemplate |
Remove linear trend from sedimentation rate template? (T or F) |
flipTemplate |
Flip direction of sedimentation rate template? (T or F) |
srMin |
Minimum sedimentation rate for template |
srMax |
Maximum sedimentation rate for template |
res1 |
Data frame containing TimeOpt results: sedimentation rate grid, r^2_envelope, r^2_power, r^2_opt. |
simres |
Data frame containing the r^2_opt value for each Monte Carlo simulation. |
fit |
Test for (1) precession amplitude modulation or (2) short eccentricity amplitude modulation? |
flow |
Low frequency cut-off for Taner bandpass (half power point; in cycles/ka). |
fhigh |
High frequency cut-off for Taner bandpass (half power point; in cycles/ka). |
roll |
Taner filter roll-off rate, in dB/octave. |
targetE |
A vector of eccentricity periods to evaluate (in ka). These must be in order of decreasing period, with a first value of 405 ka. |
targetP |
A vector of precession periods to evaluate (in ka). These must be in order of decreasing period. |
xlab |
Label for the depth/height axis. |
ylab |
Label for proxy variable evaluated. |
fitR |
The r2 value at the optimal sedimentation rate. |
output |
Which results you like to return to console? (0) no output; (1) return sedimentation rate grid, r2; (2) return optimal time series, bandpassed series, Hilbert and fitted periods |
verbose |
Verbose output? (T or F) |
S.R. Meyers, 2015, The evaluation of eccentricity-related amplitude modulations and bundling in paleoclimate data: An inverse approach for astrochronologic testing and time scale optimization: Paleoceanography, v.30, 1625-1640.
S.R. Meyers, 2019, Cyclostratigraphy and the problem of astrochronologic testing: Earth-Science Reviews v. 190, 190-223.
asm
, eAsmTrack
, testPrecession
, timeOpt
, timeOptSim
, and timeOptTemplate
Simulations for timeOptTemplate
timeOptTemplateSim(dat,template=NULL,corVal=NULL,numsim=2000,rho=NULL,sedmin=0.5,sedmax=5, difmin=NULL,difmax=NULL,fac=NULL,numsed=50,linLog=1,limit=T,fit=1,fitModPwr=T, iopt=3,flow=NULL,fhigh=NULL,roll=NULL,targetE=NULL,targetP=NULL, cormethod=1,detrend=T,detrendTemplate=F,flipTemplate=F,ncores=1,output=0, genplot=T,check=T,verbose=T)
timeOptTemplateSim(dat,template=NULL,corVal=NULL,numsim=2000,rho=NULL,sedmin=0.5,sedmax=5, difmin=NULL,difmax=NULL,fac=NULL,numsed=50,linLog=1,limit=T,fit=1,fitModPwr=T, iopt=3,flow=NULL,fhigh=NULL,roll=NULL,targetE=NULL,targetP=NULL, cormethod=1,detrend=T,detrendTemplate=F,flipTemplate=F,ncores=1,output=0, genplot=T,check=T,verbose=T)
dat |
Stratigraphic series for modulation assessment. First column should be depth or height (in meters), second column should be data value. |
template |
Instantaneous sedimentation rate template to fit. This represents a unitless proportional sedimentation rate history. Default template is a copy of dat, which will be scaled for instantaneous accumulation optimization. |
corVal |
r2opt value for data. By default this will be calculated. |
numsim |
Number of Monte Carlo AR1 simulations. |
rho |
AR1 coefficient to use in simulations. By default this will be estimated from the stratigraphic series. |
sedmin |
Minimum AVERAGE sedimentation rate for investigation (cm/ka). |
sedmax |
Maximum AVERAGE sedimentation rate for investigation (cm/ka). |
difmin |
Minimum instantaneous sedimentation rate to investigate (cm/ka). |
difmax |
Maximum instantaneous sedimentation rate to investigate (cm/ka). By default, this is ignored, and fac is used. |
fac |
Maximum instantaneous accumulation factor. Maximum rate is scaled to each investigated sedrate as fac*sedrate. Default value of 5 is based on experimentation. If larger than this, risk getting into local minimum during fit. |
numsed |
Number of sedimentation rates to investigate in optimization grid. |
linLog |
Use linear or logarithmic scaling for sedimentation rate grid spacing? (0=linear, 1=log) |
limit |
Limit evaluated sedimentation rates to region in which full target signal can be recovered? (T or F) |
fit |
Test for (1) precession amplitude modulations or (2) short eccentricity amplitude modulations? fit= 2 is not yet functional. |
fitModPwr |
Include the modulation periods in the spectral fit? (T or F) |
iopt |
Optimize on (1) modulations, (2) power, (3) mod*power |
flow |
Low frequency cut-off for Taner bandpass (half power point; in cycles/ka) |
fhigh |
High frequency cut-off for Taner bandpass (half power point; in cycles/ka) |
roll |
Taner filter roll-off rate, in dB/octave. Default value is 10^3. |
targetE |
A vector of eccentricity periods to evaluate (in ka). These must be in order of decreasing period, with first value of 405 ka. |
targetP |
A vector of precession periods to evaluate (in ka). These must be in order of decreasing period. |
cormethod |
Method used for calculation of correlation coefficient (1=Pearson, 2=Spearman) |
detrend |
Remove linear trend from data series? (T or F) |
detrendTemplate |
Remove linear trend from sedimentation rate template? (T or F) |
flipTemplate |
Flip direction of sedimentation rate template? (T or F) |
ncores |
Number of cores to use for parallel processing |
output |
Which results you like to return to console? (0) no output; (1) return sedimentation rate grid, p, r, r*p; (2) return optimal time series, bandpassed series, Hilbert and fitted periods |
genplot |
Generate summary plots? (T or F) |
check |
Conduct compliance checks before processing? (T or F) In general this should be activated; the option is included for Monte Carlo simulation. |
verbose |
Verbose output? (T or F) |
TimeOpt employs a probabilistic linear regression model framework to investigate amplitude modulation and frequency ratios (bundling) in stratigraphic data, while simultaneously determining the optimal time scale. This function further develops the method to optimize upon complex sedimentation templates. The approach is demonstrated below with a series of examples.
The statistical significance of the r^2_opt is determined via Monte Carlo simulation (see timeOptSim). See timeOpt for more information on the basic methodology.
QUESTION: is this correct?
if output = 1, a data frame containing the following will be returned: Sedimentation rate (cm/ka), r-squared value for instantaneous amplitude vs. fitted periods, r-squared value for fit to specified periods, r-squared*r-squared.
if output = 2, a data frame containing the following will be returned: Time (ka), tuned time series, bandpassed series, instantaneous amplitude, fitted periods.
S.R. Meyers, 2015, The evaluation of eccentricity-related amplitude modulations and bundling in paleoclimate data: An inverse approach for astrochronologic testing and time scale optimization: Paleoceanography.
S.R. Meyers, 2019, Cyclostratigraphy and the problem of astrochronologic testing: Earth-Science Reviews.
## Not run: # EXAMPLE (1): Differential accumulation across bedding couplets ex=etp(tmin=0,tmax=1000,dt=5,pWt=1,oWt=0,eWt=1,esinw=TRUE) ex2=diffAccum(ex,0.01,.05) ex2=linterp(ex2) # first with the nominal timeOpt approach timeOpt(ex2,sedmin=1,sedmax=4,numsed=100) timeOptSim(ex2,sedmin=1,sedmax=4,numsed=100,numsim=2000) # then with the timeOptTemplate approach timeOptTemplate(ex2,sedmin=1,sedmax=4,difmin=.5,difmax=6,numsed=100,ncores=2) timeOptTemplateSim(ex2,sedmin=1,sedmax=4,difmin=.5,difmax=6,numsed=100,numsim=1000, ncores=2) # EXAMPLE (2): Linear sedimentation rate increase ex=etp(tmin=0,tmax=1000,dt=5,pWt=1,oWt=0,eWt=1,esinw=TRUE) ex2=sedRamp(ex,srstart=0.01,srend=0.05) ex2=linterp(ex2) # first with the nominal timeOpt approach timeOpt(ex2,sedmin=1,sedmax=4,numsed=100) # then with the timeOptTemplate approach # create linear model for input. the magnitude does not matter, it will be rescaled. # (it just needs to be a line) template=ex2; template[2]=ex2[1] timeOptTemplate(ex2,template=template,sedmin=1,sedmax=4,numsed=100,ncores=2) # view optimization procedure timeOptTemplate(ex2,template=template,sedmin=2.75,sedmax=3.25,numsed=20,ncores=1,genplot=2) # EXAMPLE (3): Step increase in sedimentation rate, from 1 cm/kyr to 2 cm/kyr at 7 meters depth ex=etp(tmin=0,tmax=1000,dt=5,pWt=1,oWt=0,eWt=1,esinw=TRUE) ex2=ex ex2[1]=ex[1]*.01 ex2[141:201,1]=ex2[141:201,1]*2-7 ex2=linterp(ex2) # first with the nominal timeOpt approach timeOpt(ex2,sedmin=1,sedmax=4,numsed=100) # then with the timeOptTemplate approach # create step model for input. the magnitude does not matter, it will be rescaled. template=ex2; template[1:140,2]=1; template[141:261,2]=2 timeOptTemplate(ex2,template=template,sedmin=1,sedmax=4,numsed=100,ncores=2) # view optimization procedure timeOptTemplate(ex2,template=template,sedmin=1,sedmax=2,numsed=20,ncores=1,genplot=2) # EXAMPLE (4): A record with a 100 kyr hiatus at 10 meters depth ex=etp(tmin=0,tmax=1000,dt=5,pWt=1,oWt=0,eWt=1,esinw=TRUE) ex2=delPts(ex,del=101:121) # use a background sedimentation rate of 2 cm/kyr ex2[1]=0:179*5*0.02 # first evaluate the distorted record with the nominal timeOpt approach timeOpt(ex2,sedmin=1,sedmax=4,numsed=100) # then with the timeOptTemplate approach # create a constant sedimentation rate model with possible hiatus of unknown # duration at 10 m template=ex2; template[2]=10; template[101,2]=1 timeOptTemplate(ex2,template=template,sedmin=1,sedmax=3,difmax=3,numsed=100,ncores=2) # now perform a finer grid search near the maximum, using power only # notice the oscillatory nature of the power fit. res=timeOptTemplate(ex2,template=template,sedmin=1.5,sedmax=2,difmax=3,numsed=100,ncores=2, iopt=2,output=2) # compare true eccentricity to TimeOpt-derived eccentricity pl(2) plot(ex,type="l",main="True Eccentricity Series",xlab="True Time (kyr)",ylab="") plot(res[,1],res[,4],type="l",main="Black=TimeOpt precession AM; Red=TimeOpt eccentricity model", xlab="TimeOpt derived time (kyr)",ylab="") lines(res[,1],res[,5],col="red",lwd=2) ## End(Not run)
## Not run: # EXAMPLE (1): Differential accumulation across bedding couplets ex=etp(tmin=0,tmax=1000,dt=5,pWt=1,oWt=0,eWt=1,esinw=TRUE) ex2=diffAccum(ex,0.01,.05) ex2=linterp(ex2) # first with the nominal timeOpt approach timeOpt(ex2,sedmin=1,sedmax=4,numsed=100) timeOptSim(ex2,sedmin=1,sedmax=4,numsed=100,numsim=2000) # then with the timeOptTemplate approach timeOptTemplate(ex2,sedmin=1,sedmax=4,difmin=.5,difmax=6,numsed=100,ncores=2) timeOptTemplateSim(ex2,sedmin=1,sedmax=4,difmin=.5,difmax=6,numsed=100,numsim=1000, ncores=2) # EXAMPLE (2): Linear sedimentation rate increase ex=etp(tmin=0,tmax=1000,dt=5,pWt=1,oWt=0,eWt=1,esinw=TRUE) ex2=sedRamp(ex,srstart=0.01,srend=0.05) ex2=linterp(ex2) # first with the nominal timeOpt approach timeOpt(ex2,sedmin=1,sedmax=4,numsed=100) # then with the timeOptTemplate approach # create linear model for input. the magnitude does not matter, it will be rescaled. # (it just needs to be a line) template=ex2; template[2]=ex2[1] timeOptTemplate(ex2,template=template,sedmin=1,sedmax=4,numsed=100,ncores=2) # view optimization procedure timeOptTemplate(ex2,template=template,sedmin=2.75,sedmax=3.25,numsed=20,ncores=1,genplot=2) # EXAMPLE (3): Step increase in sedimentation rate, from 1 cm/kyr to 2 cm/kyr at 7 meters depth ex=etp(tmin=0,tmax=1000,dt=5,pWt=1,oWt=0,eWt=1,esinw=TRUE) ex2=ex ex2[1]=ex[1]*.01 ex2[141:201,1]=ex2[141:201,1]*2-7 ex2=linterp(ex2) # first with the nominal timeOpt approach timeOpt(ex2,sedmin=1,sedmax=4,numsed=100) # then with the timeOptTemplate approach # create step model for input. the magnitude does not matter, it will be rescaled. template=ex2; template[1:140,2]=1; template[141:261,2]=2 timeOptTemplate(ex2,template=template,sedmin=1,sedmax=4,numsed=100,ncores=2) # view optimization procedure timeOptTemplate(ex2,template=template,sedmin=1,sedmax=2,numsed=20,ncores=1,genplot=2) # EXAMPLE (4): A record with a 100 kyr hiatus at 10 meters depth ex=etp(tmin=0,tmax=1000,dt=5,pWt=1,oWt=0,eWt=1,esinw=TRUE) ex2=delPts(ex,del=101:121) # use a background sedimentation rate of 2 cm/kyr ex2[1]=0:179*5*0.02 # first evaluate the distorted record with the nominal timeOpt approach timeOpt(ex2,sedmin=1,sedmax=4,numsed=100) # then with the timeOptTemplate approach # create a constant sedimentation rate model with possible hiatus of unknown # duration at 10 m template=ex2; template[2]=10; template[101,2]=1 timeOptTemplate(ex2,template=template,sedmin=1,sedmax=3,difmax=3,numsed=100,ncores=2) # now perform a finer grid search near the maximum, using power only # notice the oscillatory nature of the power fit. res=timeOptTemplate(ex2,template=template,sedmin=1.5,sedmax=2,difmax=3,numsed=100,ncores=2, iopt=2,output=2) # compare true eccentricity to TimeOpt-derived eccentricity pl(2) plot(ex,type="l",main="True Eccentricity Series",xlab="True Time (kyr)",ylab="") plot(res[,1],res[,4],type="l",main="Black=TimeOpt precession AM; Red=TimeOpt eccentricity model", xlab="TimeOpt derived time (kyr)",ylab="") lines(res[,1],res[,5],col="red",lwd=2) ## End(Not run)
Determine all possible difference and combinations tones from a set of frequencies, and find the closest one to a specified frequency
tones(a=NULL,freqs=NULL,f=T)
tones(a=NULL,freqs=NULL,f=T)
a |
The frequency you are seeking to match, in cycles/ka. |
freqs |
The vector of frequencies from which to calculate difference and combination tones, in cycles/ka. |
f |
Output results as frequencies (cycles/ka)? If false, will output results as periods (ka). (T or F) |
Frequency-domain minimal tuning: Use interactive graphical interface to trace frequency drift.
traceFreq(spec,color=2,h=6,w=4,xmin=NULL,xmax=NULL,ymin=NULL,ymax=NULL,ydir=1, palette=6,ncolors=100,path=1,pl=0)
traceFreq(spec,color=2,h=6,w=4,xmin=NULL,xmax=NULL,ymin=NULL,ymax=NULL,ydir=1, palette=6,ncolors=100,path=1,pl=0)
spec |
Time-frequency spectral results to evaluate. Must have the following format: column 1=frequency; remaining columns (2 to n)=power, amplitude or probability; titles for columns 2 to n must be the location (depth or height). Note that this format is ouput by function eha. |
color |
Line color for tracing. 1 = transparent black; 2 = transparent white; 3 = transparent yellow |
h |
Height of plot in inches. |
w |
Width of plot in inches. |
xmin |
Minimum spatial frequency to plot. |
xmax |
Maximum spatial frequency to plot. |
ymin |
Minimum depth/height to plot. |
ymax |
Maximum depth/height to plot. |
ydir |
Direction for y-axis in plots (depth or height). -1 = values increase downwards (slower plotting!), 1 = values increase upwards. |
palette |
What color palette would you like to use? (1) rainbow, (2) grayscale, (3) blue, (4) red, (5) blue-white-red, (6) viridis |
ncolors |
Number of colors to use in plot. |
path |
How do you want to represent the spatial frequency path?: 1=lines and points; 2=lines; 3=points |
pl |
An option for the color plots: 0=linear scale; 1=plot log of value, 2=normalize to maximum value |
## Not run: # Check to see if this is an interactive R session, for compliance with CRAN standards. # YOU CAN SKIP THE FOLLOWING LINE IF YOU ARE USING AN INTERACTIVE SESSION. if(interactive()) { # Generate example series with 3 terms using function 'cycles'. # Then convert from time to space with sedimentation rate that increases from 1 to 5 cm/ka, using # function 'sedramp'. # Finally interpolate to median sampling interval using function 'linterp'. dat=linterp(sedRamp(cycles(freqs=c(1/100,1/40,1/20),start=1,end=2500,dt=5))) # EHA anlaysis, output amplitude results out=eha(dat,output=3) ## Interactively track frequency drift freq=traceFreq(out) } ## End(Not run)
## Not run: # Check to see if this is an interactive R session, for compliance with CRAN standards. # YOU CAN SKIP THE FOLLOWING LINE IF YOU ARE USING AN INTERACTIVE SESSION. if(interactive()) { # Generate example series with 3 terms using function 'cycles'. # Then convert from time to space with sedimentation rate that increases from 1 to 5 cm/ka, using # function 'sedramp'. # Finally interpolate to median sampling interval using function 'linterp'. dat=linterp(sedRamp(cycles(freqs=c(1/100,1/40,1/20),start=1,end=2500,dt=5))) # EHA anlaysis, output amplitude results out=eha(dat,output=3) ## Interactively track frequency drift freq=traceFreq(out) } ## End(Not run)
A tool to interactively trace peak trajectories on plots, for results from such functions as eTimeOpt, EHA, eAsm.
tracePeak(dat,color=2,h=6,w=4,xmin=NULL,xmax=NULL,ymin=NULL,ymax=NULL, ydir=-1,palette=6,ncolors=100,path=1)
tracePeak(dat,color=2,h=6,w=4,xmin=NULL,xmax=NULL,ymin=NULL,ymax=NULL, ydir=-1,palette=6,ncolors=100,path=1)
dat |
Data frame with results to evaluate. It must have the following format: column 1=parameter to track (e.g., frequency, sedimentation rate, etc.; x-axis of plot); remaining columns (2 to n)=parameter to evaluate for peak identification (color on plot); titles for columns 2 to n must be the location (depth/height/time; y-axis of plot). Note that this format is ouput by functions eha, eTimeOpt, eAsm. |
color |
Line color for tracing. 1 = transparent black; 2 = transparent white; 3 = transparent yellow |
h |
Height of plot in inches. |
w |
Width of plot in inches. |
xmin |
Minimum parameter value to plot. |
xmax |
Maximum parameter value to plot. |
ymin |
Minimum depth/height/time to plot. |
ymax |
Maximum depth/height/time to plot. |
ydir |
Direction for y-axis in plots (depth/height/time). -1 = values increase downwards, 1 = values increase upwards. |
palette |
What color palette would you like to use? (1) rainbow, (2) grayscale, (3) blue, (4) red, (5) blue-white-red, (6) viridis |
ncolors |
Number of colors to use in plot. |
path |
How do you want to represent the path?: 1=lines and points; 2=lines; 3=points |
Frequency-domain minimal tuning: Use interactive graphical interface and sorting algorithm to track frequency drift.
trackFreq(spec,threshold=NULL,pick=T,fmin=NULL,fmax=NULL,dmin=NULL,dmax=NULL,xmin=NULL, xmax=NULL,ymin=NULL,ymax=NULL,h=6,w=4,ydir=1,palette=6,ncolors=100,genplot=T, verbose=T)
trackFreq(spec,threshold=NULL,pick=T,fmin=NULL,fmax=NULL,dmin=NULL,dmax=NULL,xmin=NULL, xmax=NULL,ymin=NULL,ymax=NULL,h=6,w=4,ydir=1,palette=6,ncolors=100,genplot=T, verbose=T)
spec |
Time-frequency spectral results to evaluate. Must have the following format: column 1=frequency; remaining columns (2 to n)=power, amplitude or probability; titles for columns 2 to n must be the location (depth or height). Note that this format is ouput by function eha. |
threshold |
Threshold level for filtering peaks. By default all peak maxima reported. |
pick |
Pick the peaks of interest using a graphical interface? (T or F). Only activated if genplot=T. |
fmin |
Minimum frequency for analysis. |
fmax |
Maximum frequency for analysis. |
dmin |
Minimum depth/height for analysis. NOT ACTIVATED YET! |
dmax |
Maximum depth/height for analysis. NOT ACTIVATED YET! |
xmin |
Minimum frequency for PLOTTING. |
xmax |
Maximum frequency for PLOTTING. |
ymin |
Minimum depth/height for PLOTTING. |
ymax |
Maximum depth/height for PLOTTING. |
h |
Height of plot in inches. |
w |
Width of plot in inches. |
ydir |
Direction for y-axis in plots (depth or height). -1 = values increase downwards (slower plotting!), 1 = values increase upwards. |
palette |
What color palette would you like to use? (1) rainbow, (2) grayscale, (3) blue, (4) red, (5) blue-white-red, (6) viridis |
ncolors |
Number of colors to use in plot. |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
## Not run: # Check to see if this is an interactive R session, for compliance with CRAN standards. # YOU CAN SKIP THE FOLLOWING LINE IF YOU ARE USING AN INTERACTIVE SESSION. if(interactive()) { # Generate example series with 3 terms using function 'cycles'. # Then convert from time to space with sedimentation rate that increases from 1 to 5 cm/ka, using # function 'sedramp'. # Finally interpolate to median sampling interval using function 'linterp'. dat=linterp(sedRamp(cycles(freqs=c(1/100,1/40,1/20),start=1,end=2500,dt=5))) # EHA anlaysis, output probability results out=eha(dat,output=4) ## Isolate peaks with probability >= 0.8 freq=trackFreq(out,0.8) } ## End(Not run)
## Not run: # Check to see if this is an interactive R session, for compliance with CRAN standards. # YOU CAN SKIP THE FOLLOWING LINE IF YOU ARE USING AN INTERACTIVE SESSION. if(interactive()) { # Generate example series with 3 terms using function 'cycles'. # Then convert from time to space with sedimentation rate that increases from 1 to 5 cm/ka, using # function 'sedramp'. # Finally interpolate to median sampling interval using function 'linterp'. dat=linterp(sedRamp(cycles(freqs=c(1/100,1/40,1/20),start=1,end=2500,dt=5))) # EHA anlaysis, output probability results out=eha(dat,output=4) ## Isolate peaks with probability >= 0.8 freq=trackFreq(out,0.8) } ## End(Not run)
A tool to interactively select points to track peak trajectories on plots, for results from functions such as eTimeOpt, EHA, eAsm.
trackPeak(dat,threshold=NULL,pick=T,minVal=NULL,maxVal=NULL,dmin=NULL,dmax=NULL, xmin=NULL,xmax=NULL,ymin=NULL,ymax=NULL,h=6,w=4,ydir=-1, palette=6,ncolors=100,genplot=T,verbose=T)
trackPeak(dat,threshold=NULL,pick=T,minVal=NULL,maxVal=NULL,dmin=NULL,dmax=NULL, xmin=NULL,xmax=NULL,ymin=NULL,ymax=NULL,h=6,w=4,ydir=-1, palette=6,ncolors=100,genplot=T,verbose=T)
dat |
Data frame with results to evaluate. It must have the following format: column 1=parameter to track (e.g., frequency, sedimentation rate, etc.; x-axis of plot); remaining columns (2 to n)=parameter to evaluate for peak identification (color on plot); titles for columns 2 to n must be the location (depth/height/time; y-axis of plot). Note that this format is ouput by functions eha, eTimeOpt, eAsm. |
threshold |
Threshold level for filtering peaks. By default all peak maxima reported. |
pick |
Pick the peaks of interest using a graphical interface? (T or F). Only activated if genplot=T. |
minVal |
Minimum parameter value for analysis (e.g., frequency, sedimentation rate, etc.). |
maxVal |
Maximum parameter value for analysis (e.g., frequency, sedimentation rate, etc.). |
dmin |
Minimum depth/height/time for analysis. NOT ACTIVATED YET! |
dmax |
Maximum depth/height/time for analysis. NOT ACTIVATED YET! |
xmin |
Minimum parameter value for PLOTTING. |
xmax |
Maximum parameter value for PLOTTING. |
ymin |
Minimum depth/height/time for PLOTTING. |
ymax |
Maximum depth/height/time for PLOTTING. |
h |
Height of plot in inches. |
w |
Width of plot in inches. |
ydir |
Direction for y-axis in plots (depth or height). -1 = values increase downwards (slower plotting!), 1 = values increase upwards. |
palette |
What color palette would you like to use? (1) rainbow, (2) grayscale, (3) blue, (4) red, (5) blue-white-red, (6) viridis |
ncolors |
Number of colors to use in plot. |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
Automatically remove outliers from stratigraphic series, using 'boxplot' algorithm.
trim(dat,c=1.5,genplot=T,verbose=T)
trim(dat,c=1.5,genplot=T,verbose=T)
dat |
Stratigraphic series for outlier removal. First column should be location (e.g., depth), second column should be data value. |
c |
'c' defines the 'coef' variable for boxplot.stats. For more information: ?boxplot.stats |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
Remove outliers from stratigraphic series, using specified threshold value.
trimAT(dat,thresh=0,dir=2,genplot=T,verbose=T)
trimAT(dat,thresh=0,dir=2,genplot=T,verbose=T)
dat |
Stratigraphic series for outlier removal. First column should be location (e.g., depth), second column should be data value. |
thresh |
Threshold value for outlier detection. |
dir |
Remove values (1) smaller than or (2) larger than this threshold? |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
Identify minima of troughs in any 1D or 2D series, filter at desired threshold value.
trough(dat,level,plateau=F,genplot=T,verbose=T)
trough(dat,level,plateau=F,genplot=T,verbose=T)
dat |
1 or 2 dimensional series. If 2 dimesions, first column should be location (e.g., depth), second column should be data value. |
level |
Threshold level for filtering troughs. By default all trough minima reported. |
plateau |
Output plateau points not evaluated? If T, identified troughs will not be output. (T or F) |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
ex=cycles(genplot=FALSE) trough(ex,level=-0.02)
ex=cycles(genplot=FALSE) trough(ex,level=-0.02)
Tune stratigraphic series from space to time, using specified control points
tune(dat,controlPts,extrapolate=F,genplot=T,check=T,verbose=T)
tune(dat,controlPts,extrapolate=F,genplot=T,check=T,verbose=T)
dat |
Stratigraphic series for tuning. First column should be location (e.g., depth), second column should be data value. |
controlPts |
Tuning control points. A data frame or matrix containing two columns: depth, time |
extrapolate |
Extrapolate sedimentation rates above and below 'tuned' interval? (T or F) |
genplot |
Generate summary plots? (T or F) |
check |
Conduct compliance checks before processing? (T or F) In general this should be activated; the option is included for Monte Carlo simulation. |
verbose |
Verbose output? (T or F) |
# generate example series with 3 precession terms using function 'cycles' ex1=cycles() # then convert from time to space using a sedimentation rate that increases from 1 to 7 cm/ka ex2=sedRamp(ex1,srstart=0.01,srend=0.07) # assemble tuning control points (this is the depth-time map) controlPts=cbind(ex2[,1],ex1[,1]) # tune record ex3=tune(ex2,controlPts=controlPts)
# generate example series with 3 precession terms using function 'cycles' ex1=cycles() # then convert from time to space using a sedimentation rate that increases from 1 to 7 cm/ka ex2=sedRamp(ex1,srstart=0.01,srend=0.07) # assemble tuning control points (this is the depth-time map) controlPts=cbind(ex2[,1],ex1[,1]) # tune record ex3=tune(ex2,controlPts=controlPts)
'unbioturb' is a function to remove bioturbation effects from a time series given the bioturbation parameters. It implements the method outlined in Liu et al. (2021), which builds on the approaches of (Guinasso and Schink, 1975), Goreau (1977), and Goreau (1980). 'unbioturb' is the inverse of the function 'bioturb', both of which model bioturbation as a diffusive process (Guinasso and Schink, 1975). In 'unbioturb', the proxy series is deconvolved from an impulse response function determined by the bioturbation characteristics, G = D/ML/v.
unbioturb(dat, G, ML, v, pt = 0.2, wiener = TRUE, fhigh=NULL, output = 1, genplot = TRUE, check = TRUE, verbose = TRUE)
unbioturb(dat, G, ML, v, pt = 0.2, wiener = TRUE, fhigh=NULL, output = 1, genplot = TRUE, check = TRUE, verbose = TRUE)
dat |
Stratigraphic series to be bioturbated. First column should be age (kyr), second column should be data value. |
G |
Control parameter in Guinasso and Schinck, 1975. G = D/ML/v |
ML |
Mix layer depth (cm) |
v |
Sedimentation rate (cm/kyr) |
pt |
Cosine-tapered window parameter: pt is the percent of the data series tapered (choose 0-1). When pt=1, this is equivalent to a Hann taper. |
wiener |
Apply Wiener filter for deconvolution stabilization? (T or F) |
fhigh |
Taner filter cut-off frequency for deconvolution stabilization. By default, no Taner lowpass filter is applied. |
output |
Which results would you like to return to the console? (0) no output; (1) return unbioturbated series; (2) return impulse response |
genplot |
Generate summary plots? (T or F) |
check |
Conduct compliance checks before processing? (T or F) In general this should be activated; the option is included for Monte Carlo simulation. |
verbose |
Verbose output? (T or F) |
Guinasso, N.L. and Schinck, D.R., 1975, Quantitative estimates of biological mixing rates in abyssal sediments, J. Geophys. Res., 80, 3032-3043.
Goreau, T.J., 1977, Quantitative effects of sediment mixing on stratigraphy and biogeochemistry: a signal theory approach, Nature, 256, 730-732.
Goreau, T.J., 1980, Frequency sensitivity of the deep-sea climatic record, Nature, 287, 620-622.
Liu, H., Meyers, S.R., and Marcott, S.A., 2021, Unmixing dee-sea paleoclimate records: A study on bioturbation effects through convolution and deconvolution, Earth and Planetary Science Letters, 564, 116883.
# as a test series, use the three dominant precession terms from Berger et al. (1992) ex1=cycles() # mix it res1 <- bioturb(ex1, G=4, ML=10, v=1, genplot = TRUE) # un-mix it res2=unbioturb(res1, G=4, ML=10, v=1, genplot = TRUE) pl() plot(ex1,type="l",main="black=signal, blue=bioturbated, red=unbioturbated",lwd=3) lines(res2,col="red") lines(res1,col="blue")
# as a test series, use the three dominant precession terms from Berger et al. (1992) ex1=cycles() # mix it res1 <- bioturb(ex1, G=4, ML=10, v=1, genplot = TRUE) # un-mix it res2=unbioturb(res1, G=4, ML=10, v=1, genplot = TRUE) pl() plot(ex1,type="l",main="black=signal, blue=bioturbated, red=unbioturbated",lwd=3) lines(res2,col="red") lines(res1,col="blue")
Write data frame as file with comma separated values
writeCSV(filename,output)
writeCSV(filename,output)
filename |
Desired filename, in quotes: "result.csv" |
output |
Data frame to write to file. |
Write data frame as file with tab-delimited values
writeT(filename,output)
writeT(filename,output)
filename |
Desired filename, in quotes: "result.tab" |
output |
Data frame to write to file. |
The wtMean function is designed for Ar/Ar Geochronology, but is also useful as a general purpose weighted mean estimator. It will calculate weighted mean age, age uncertainty, and other helpful statistics/plots (with interactive graphics for data culling). The function includes the option to generate results using the approach of IsoPlot 3.70 (Ludwig, 2008) or ArArCALC (Koppers, 2002).
wtMean(dat,sd=NULL,unc=1,lambda=5.463e-10,J=NULL,Jsd=NULL,CI=2,cull=-1,del=NULL, sort=1,output=F,idPts=T,size=NULL,unit=1,setAr=95,color="black", genplot=T,verbose=T)
wtMean(dat,sd=NULL,unc=1,lambda=5.463e-10,J=NULL,Jsd=NULL,CI=2,cull=-1,del=NULL, sort=1,output=F,idPts=T,size=NULL,unit=1,setAr=95,color="black", genplot=T,verbose=T)
dat |
dat must contain one of the following: (1) a vector of dates/values for weighted mean calculation, (2) a matrix with two columns: date or value and uncertainty (one or two sigma), or (3) a matrix with six columns, as follows: date, date uncertainty (one or two sigma), K/Ca, %Ar40*, F, and F uncertainty (one or two sigma). NOTE: F is the ratio Ar40*/Ar39K (see Koppers, 2002). See "details" for more information. |
sd |
Vector of uncertainties associated with each date or value in 'dat', as one or two sigma. This option is ignored if dat has more than one column |
unc |
What is the uncertainty on your input dates/values? (1) one sigma, or (2) two sigma. DEFAULT is one sigma. This also applies to the F uncertainty, and the J-value uncertainty (if specified) |
lambda |
Relevant for Ar/Ar only- Total decay constant of K40, in units of 1/year. The default value is 5.463e-10/year (Min et al., 2000). |
J |
Relevant for Ar/Ar only- Neutron fluence parameter |
Jsd |
Relevant for Ar/Ar only- Uncertainty for J-value (neutron fluence parameter; as one or two sigma) |
CI |
Which convention would you like to use for the 95% confidence intervals? (1) ISOPLOT (Ludwig, 2008), (2) ArArCALC (Koppers, 2002) (see below for details) |
cull |
Would you like select dates/data with a graphical interface? (0=no, 1=select points to retain, -1=select points to remove) |
del |
A vector of indices indicating data points to remove from weighted mean calculation. If specified, this takes precedence over cull. |
sort |
Sort by date/values? (0=no; 1=sort into increasing order; 2=sort into decreasing order) |
output |
Return weighted mean results as new data frame? (T or F) |
idPts |
Identify datum number on each point? (T or F) |
size |
Multiplicative factor to increase or decrease size of symbols and fonts for plot. |
unit |
Relevant for geochronology only- The time unit for your results. (1) = Ma, (2) = Ka |
setAr |
Relevant for Ar/Ar only- Set the %Ar40* level to be illustrated on the plot. The default is 95%. |
color |
Color to use for symbols. Default is black. |
genplot |
Generate summary plots? (T or F) |
verbose |
Verbose output? (T or F) |
This function performs weighted mean age calculations, including estimation of age uncertainties, mean square weighted deviation, and probability of fit, following the approaches used in IsoPlot 3.70 (Ludwig, 2008) and ArArCALC (Koppers, 2002). It is also useful as a general purpose weighted mean estimator.
The function accepts input in three formats:
(1) each date/value and its uncertainty can be entered as individual vectors ('dat' and 'sd').
(2) a two column matrix can be input as 'dat', with each date or value (first column) and its uncertainty (second column).
(3) a six column matrix can be input as 'dat', with each date, its uncertainty, the associated K/Ca value, %Ar40*, F, and F uncertainty (one or two sigma). This option must be used if you wish to calculate and include the uncertainty associated with J. The uncertainty is calculated and propagated following equation 18 of Koppers (2002).
The following plots are produced:
(1) A normal Q-Q plot for the dates/values (in essence this is the same as IsoPlot's linearized probability plot).
(2) A cumulative Gaussian plot for the dates/values (a.k.a. cumulative probability plot). This is derived by summing the individual normal distributions for each date/value.
(3) A plot of each date/value with its 2-sigma uncertainties.
In addition, K/Ca and Ar40* data are plotted if provided.
A NOTE regarding confidence intervals: There are two conventions that can be used to calculate the confidence intervals, selected with the option 'CI':
(1) ISOPLOT convention (Ludwig, 2008). When the probability of fit is >= 0.15, the confidence interval is based on 1.96*sigma. When the probability of fit is < 0.15, the confidence interval is based on t*sigma*sqrt(MSWD).
(2) ArArCALC convention (Koppers, 2002). When MSWD <=1, the confidence interval is based on 1.96*sigma. When MSWD > 1, the confidence interval is based on 1.96*sigma*sqrt(MSWD).
ADDITIONAL ADVICE: Use the function readMatrix to load your data in R (rather than the function read).
A.A.P. Koppers, 2002, ArArCALC- software for 40Ar/39Ar age calculations: Computers & Geosciences, v. 28, p. 605-619.
K.R. Ludwig, 2008, User's Manual for Isoplot 3.70: A Geochronological Toolkit for Microsoft Excel: Berkeley Geochronology Center Special Publication No. 4, Berkeley, 77 p.
I. McDougall and T.M. Harrison, 1991, Geochronology and Thermochronology by the 40Ar/39Ar Method: Oxford University Press, New York, 269 pp.
K. Min, R. Mundil, P.R. Renne, and K. Ludwig, 2000, A test for systematic errors in 40Ar/39Ar geochronology through comparison with U/Pb analysis of a 1.1-Ga rhyolite: Geochimica et Cosmochimica Acta, v. 64, p. 73-98.
I. Wendt and C. Carl, 1991, The statistical distribution of the mean squared weighted deviation: Chemical Geology, v. 86, p. 275-285.
## Not run: # Check to see if this is an interactive R session, for compliance with CRAN standards. # YOU CAN SKIP THE FOLLOWING LINE IF YOU ARE USING AN INTERACTIVE SESSION. if(interactive()) { # Sample NE-08-01 Ar/Ar data from Meyers et al. (2012) supplement age <- c(93.66,94.75,94.6,94.22,86.87,94.64,94.34,94.03,93.56,93.85,88.55,93.45,93.84, 94.39,94.11,94.48,93.82,93.81,94.18,93.78,94.41,93.49,95.07,94.19) sd2<- c(5.83,4.10,8.78,2.5,8.86,3.37,4.63,3.18,8.35,5.73,4.23,2.56,2.3,1.7,3.1,2.78, 1.62,.92,.98,1.41,1.21,1.38,1.48,0.93) sd <- sd2/2 wtMean(age,sd) # to calculate the weighted mean without interactive plots and data culling wtMean(age,sd,cull=0,output=TRUE,genplot=FALSE,verbose=FALSE) } ## End(Not run)
## Not run: # Check to see if this is an interactive R session, for compliance with CRAN standards. # YOU CAN SKIP THE FOLLOWING LINE IF YOU ARE USING AN INTERACTIVE SESSION. if(interactive()) { # Sample NE-08-01 Ar/Ar data from Meyers et al. (2012) supplement age <- c(93.66,94.75,94.6,94.22,86.87,94.64,94.34,94.03,93.56,93.85,88.55,93.45,93.84, 94.39,94.11,94.48,93.82,93.81,94.18,93.78,94.41,93.49,95.07,94.19) sd2<- c(5.83,4.10,8.78,2.5,8.86,3.37,4.63,3.18,8.35,5.73,4.23,2.56,2.3,1.7,3.1,2.78, 1.62,.92,.98,1.41,1.21,1.38,1.48,0.93) sd <- sd2/2 wtMean(age,sd) # to calculate the weighted mean without interactive plots and data culling wtMean(age,sd,cull=0,output=TRUE,genplot=FALSE,verbose=FALSE) } ## End(Not run)
Generate a cross-plot with kernel density estimates on axes. If multiple data points are superposed in cross-plot, transparency of points reflects data density. Custom axes titles optional.
xplot(x,y,xlab=NULL,ylab=NULL,main=NULL,fill=T)
xplot(x,y,xlab=NULL,ylab=NULL,main=NULL,fill=T)
x |
Variable 1 |
y |
Variable 2 |
xlab |
Label for the x-axis, in quotes |
ylab |
Label for the y-axis, in quotes |
main |
Label for the plot, in quotes |
fill |
Use gray fill for density plots? (T or F) |
# random numbers from a normal distribution ex1<-rnorm(1000) # random numbers from an exponential distribution ex2<-rexp(1000) xplot(ex1,ex2)
# random numbers from a normal distribution ex1<-rnorm(1000) # random numbers from an exponential distribution ex2<-rexp(1000) xplot(ex1,ex2)
Dynamically explore cross-plot, zoom-in into specfied region. Accepts one dataframe/matrix with two columns, or two dataframes/vectors with one column.
zoomIn(dat1,dat2=NULL,ptsize=0.5,xmin=NULL,xmax=NULL,ymin=NULL,ymax=NULL,plotype=1, verbose=T)
zoomIn(dat1,dat2=NULL,ptsize=0.5,xmin=NULL,xmax=NULL,ymin=NULL,ymax=NULL,plotype=1, verbose=T)
dat1 |
Data frame with one or two columns. If one column, dat2 must also be specified. |
dat2 |
Data frame with one column. |
ptsize |
Size of plotted points. |
xmin |
Minimum x-value (column 1) to plot |
xmax |
Maximum x-value (column 1) to plot |
ymin |
Minimum y-value (column 2) to plot |
ymax |
Maximum y-value (column 2) to plot |
plotype |
Type of plot to generate: 1= points and lines, 2 = points, 3 = lines |
verbose |
Verbose output? (T or F) |