FreqRep is an S4 class that encapsulates, for a multivariate time series Y0i,…,Yn−1,i, i=1,...,d
the data structures for the storage of a frequency representation. Examples of such frequency representations include
the Fourier transformation of the clipped time series (IYti\<=q), or
the weighted L1-projection of (Yt,i) onto an harmonic basis.
Examples are realized by implementing a sub-class to FreqRep. Currently, implementations for the two examples mentioned above are available: ClippedFT and QRegEstimator.
class
Details
It is always an option to base the calculations on the pseudo data Rtni/n where Rtnj denotes the rank of Yti among Y0,…,Yn−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 2pij/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
Y <- rnorm(32)freq <-2*pi*c(0:31)/32levels <- 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 availableV.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.25V.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))