cross_spectrum {kitagawa} | R Documentation |
Calculate the cross-spectrum of two timeseries
Description
Calculate the cross-spectrum of two timeseries
Usage
cross_spectrum(x, ...)
## S3 method for class 'mts'
cross_spectrum(x, ...)
## Default S3 method:
cross_spectrum(
x,
y,
k = 10,
samp = 1,
q,
adaptive = FALSE,
verbose = FALSE,
...
)
Arguments
x |
numeric; timeseries |
... |
additional arguments to |
y |
numeric; timeseries. if missing, assumed to be column no. 2 in |
k |
integer; the number of sine tapers, unless this is |
samp |
numeric; the sampling rate (e.g., |
q |
numeric; the probability quantile [0,1] to calculate coherence significance levels; if missing, a
pre-specified sequence is included. This is will be ignored for Welch-based spectra (see |
adaptive |
logical; should adaptive multitaper estimation be used? |
verbose |
logical; should messages be printed? |
Examples
require(stats)
require(psd)
n <- 1000
ramp <- seq_len(n)
parab <- ramp^2
set.seed(1255)
X <- ts(rnorm(n) + ramp/2)
Y <- ts(rnorm(n) + ramp/10 + parab/100)
# Calculate the multitaper cross spectrum
csd <- cross_spectrum(X, Y, k=20)
[Package kitagawa version 3.1.2 Index]