mtm.coh: Compute and plot the multitaper magnitude-squared coherence.

Description Usage Arguments References Examples

View source: R/multitaper.R

Description

Computes and plots the adaptive multitaper spectrum estimate.

Usage

1
mtm.coh(mtm1, mtm2, fr=NULL, tau=0, phcorr = TRUE, plot=TRUE, ...) 

Arguments

mtm1

An object created with spec.mtm(... ,returnInternals=TRUE).

mtm2

An object created with spec.mtm(... ,returnInternals=TRUE). Note mtm1 and mtm2 must be created with the same frequency resolution. They both must have the same values for nFFT and returnZeroFreq.

fr

The frequency values for the mtm object. This can be null by default (which results in computation for the full frequency range) or it can be a subset of frequency values.

tau

Phase-correction factor, if known.

phcorr

Correct phase (unwrap). By default, set to TRUE; set to FALSE if you would prefer the phase to be untouched.

plot

Boolean value indicating if a plot should be drawn.

...

Additional parameters, such as xaxs="i" which are passed through to the plotting function.

References

Thomson, DJ (1991) Jackknifed error estimates for spectra, coherences, and transfer functions, Advances in Spectrum Estimation 58–113.

Thomson, D.J (1982) Spectrum estimation and harmonic analysis. Proceedings of the IEEE Volume 70, number 9, pp. 1055–1096.

Percival, D.B. and Walden, A.T. (1993) Spectral analysis for physical applications Cambridge University Press.

Examples

1
2
3
4
5
6
7
8
9
data(HadCRUTnh)
data(mlco2)
spec1 <- spec.mtm(HadCRUTnh, nw=5.0, k=8, plot=FALSE,
    returnInternals=TRUE, dtUnits="month", deltat=1.0)
spec2 <- spec.mtm(mlco2, nw=5.0, k=8, plot=FALSE, returnInternals=TRUE,
    dtUnits="month", deltat=1.0)
resCoh <- mtm.coh(spec1, spec2, plot=FALSE)
plot(resCoh)
plot(resCoh, cdfQuantilesTicks=1-10^(-(6:12)))

Example output

$sigProb
[1] 0.1 0.2 0.5 0.8 0.9

$sigNT
[1] 0.4596196 0.6698233 1.1871493 1.8286873 2.2052458

$sigProb
[1] 0.1 0.2 0.5 0.8 0.9

$sigNT
[1] 0.4596196 0.6698233 1.1871493 1.8286873 2.2052458

multitaper documentation built on Nov. 17, 2017, 4:02 a.m.