| FreqRep-class {quantspec} | R Documentation |
Class for Frequency Representation.
Description
FreqRep is an S4 class that encapsulates, for a multivariate time
series (Y_{t,i})_{t=0,\ldots,n-1},
i=1,\ldots,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
(\{I\{Y_{t,i} \leq q\}), orthe weighted
L_1-projection of(Y_{t,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.
Details
It is always an option to base the calculations on the pseudo data
R_{t,n,i} / n where R_{t,n,i} denotes the rank of
Y_{t,i} among (Y_{t,i})_{t=0,\ldots,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
YThe time series of which the frequency representation is to be determined.
frequenciesThe frequencies for which the frequency representation will be determined. On initalization
frequenciesValidatoris called, so that it will always be a vector of reals from[0,\pi]. Also, only Fourier frequencies of the form2\pi j / nwith integersjandnthelength(Y)are allowed.levelsThe levels for which the frequency representation will be determined. If the flag
isRankBasedis set toFALSE, then it can be any vector of reals. IfisRankBasedis set toTRUE, then it has to be from[0,1].valuesThe array holding the determined frequency representation. Use a
getValuesmethod of the relevant subclass to access it.isRankBasedA flag that is
FALSEif the determinedvaluesare based on the original time series andTRUEif it is based on the pseudo data as described in the Details section of this topic.positions.bootAn object of type
BootPos, that is used to determine the block bootstrapped replicates of the time series.BNumber of bootstrap replications to perform.
Examples
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))