Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

Spectrum

Estimates Frequency Spectrum


Description

This function estimates the frequency spectrum of the xdata array together with its 95% and 99% significance level. The output is provided as an array with dimensions c(number of frequencies, 4). The column contains the frequency values, the power, the 95% significance level and the 99% one.
The spectrum estimation relies on a R built-in function and the significance levels are estimated by a Monte-Carlo method.

Usage

Spectrum(xdata)

Arguments

xdata

Array of which the frequency spectrum is required.

Value

Frequency spectrum with dimensions c(number of frequencies, 4). The column contains the frequency values, the power, the 95% significance level and the 99% one.

Author(s)

History:
0.1 - 2012-02 (V. Guemas, virginie.guemas@ic3.cat) - Original code
1.0 - 2013-09 (N. Manubens, nicolau.manubens@ic3.cat) - Formatting to CRAN

Examples

# Load sample data as in Load() example:
example(Load)

ensmod <- Mean1Dim(sampleData$mod, 2)
for (jstartdate in 1:3) {
 spectrum <- Spectrum(ensmod[1, jstartdate, ])
 for (jlen in 1:dim(spectrum)[1]) {
   if (spectrum[jlen, 2] > spectrum[jlen, 4]) {
     ensmod[1, jstartdate, ] <- Filter(ensmod[1, jstartdate, ],  
                                       spectrum[jlen, 1])
   }
 }
}
 
PlotAno(InsertDim(ensmod, 2, 1), sdates = startDates, fileout =
       'filtered_ensemble_mean.eps')

s2dverification

Set of Common Tools for Forecast Verification

v2.10.0
Apache License 2.0
Authors
BSC-CNS [aut, cph], Virginie Guemas [aut], Nicolau Manubens [aut], An-Chi Ho [ctb, cre], Nuria Perez-Zanon [ctb], Javier Garcia-Serrano [aut], Neven Fuckar [aut], Louis-Philippe Caron [aut], Omar Bellprat [aut], Luis Rodrigues [aut], Veronica Torralba [aut], Alasdair Hunter [aut], Chloe Prodhomme [aut], Martin Menegoz [aut], Domingo Manubens [ctb], Constantin Ardilouze [ctb], Lauriane Batte [ctb], Fabian Lienert [ctb], Julia Giner [ctb], Jean-Philippe Baudouin [ctb], Nube Gonzalez [ctb], Ludovic Auger [ctb], Nicola Cortesi [ctb], Eleftheria Exarchou [ctb], Ruben Cruz [ctb], Isabel Andreu-Burillo [ctb], Ramiro Saurral [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.