Last chance! 50% off unlimited learning
Sale ends in
spectrum
function, which returns spectral values that are adjusted so that the
integral of those values equals the variance of the input x
.oceSpectrum(x, ...)
spectrum
, a univariate or multivariate
time series.spectrum
.spectrum
.x <- rnorm(1e3)
s <- spectrum(x, plot=FALSE)
ss <- oceSpectrum(x, plot=FALSE)
cat("variance of x=", var(x), "")
cat("integral of spectrum=", sum(s$spec)*diff(s$freq[1:2]), "")
cat("integral of oceSpectrum=", sum(ss$spec)*diff(ss$freq[1:2]), "")
Run the code above in your browser using DataLab