FreqRep-class: Class for Frequency Representation.

Description Details Slots Examples

Description

FreqRep is an S4 class that encapsulates, for a multivariate time series Y_0i,…,Y_{n-1,i}, i=1,...,d the data structures for the storage of a frequency representation. Examples of such frequency representations include

Examples are realized by implementing a sub-class to FreqRep. Currently, implementations for the two examples mentioned above are available: ClippedFT and QRegEstimator.

Details

It is always an option to base the calculations on the pseudo data R_tni / n where R_tnj denotes the rank of Y_ti among Y_0,…,Y_{n-1}.

To allow for a block bootstrapping procedure a number of B estimates determined from bootstrap replications of the time series which are yield by use of a BootPos-object can be stored on initialization.

The data in the frequency domain is stored in the array values, which has dimensions (J,P,K,B+1), where J is the number of frequencies, P is the dimension of the time series, K is the number of levels and B is the number of bootstrap replications requested on intialization. In particular, values[j,i,k,1] corresponds to the time series' frequency representation with frequencies[j], dimension i and levels[k], while values[j,i,k,b+1] is the for the same, but determined from the bth block bootstrapped replicate of the time series.

Slots

Y

The time series of which the frequency representation is to be determined.

frequencies

The frequencies for which the frequency representation will be determined. On initalization frequenciesValidator is called, so that it will always be a vector of reals from [0,pi]. Also, only Fourier frequencies of the form 2 pi j / n with integers j and n the length(Y) are allowed.

levels

The levels for which the frequency representation will be determined. If the flag isRankBased is set to FALSE, then it can be any vector of reals. If isRankBased is set to TRUE, then it has to be from [0,1].

values

The array holding the determined frequency representation. Use a getValues method of the relevant subclass to access it.

isRankBased

A flag that is FALSE if the determined values are based on the original time series and TRUE if it is based on the pseudo data as described in the Details section of this topic.

positions.boot

An object of type BootPos, that is used to determine the block bootstrapped replicates of the time series.

B

Number of bootstrap replications to perform.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Y       <- rnorm(32)
freq    <- 2*pi*c(0:31)/32 
levels  <- c(0.25,0.5,0.75)
cFT     <- clippedFT(Y, freq, levels)

plot(cFT)

# Get values for all Fourier frequencies and all levels available.
V.all    <- getValues(cFT)

# Get values for every second frequency available
V.coarse <- getValues(cFT, frequencies = 2*pi*c(0:15)/16, levels = levels)

# Trying to get values on a finer grid of frequencies than available will
# yield a warning and then all values with frequencies closest to that finer
# grid.
V.fine   <- getValues(cFT, frequencies = 2*pi*c(0:63)/64, levels = levels)

# Finally, get values for the available Fourier frequencies from [0,pi] and
# only for tau=0.25
V.part   <- getValues(cFT, frequencies = 2*pi*c(0:16)/32, levels = c(0.25))

# Alternatively this can be phrased like this:
V.part.alt <- getValues(cFT, frequencies = freq[freq <= pi], levels = c(0.25))

quantspec documentation built on July 15, 2020, 1:07 a.m.