mk.its.exceedances.vector {QRMlib}R Documentation

Extract Exceedances over Threshold into Irregular Time Series for Plotting when Input is Vector

Description

Builds an irregular time series object of the ‘its’ class to hold the exceedances above a specified threshold ordered according to date. The ‘its’ time series may then be plotted easily to show clustering effects (“volatility clustering”).

Usage

mk.its.exceedances.vector(datavector, paralleltimeseriesPos, thresholdValue)

Arguments

datavector a data vector for which you wish to plot exceedances over a threshold
paralleltimeseriesPos a vector of length equal to the datavector containing the positions (time-date) attribute from an R-Metrics type timeSeries object
thresholdValue the minimum data value above which you want to collect exceedances into the irregular time series (‘its’ object); calculate by calling QRM function findthreshold()

Details

This function passes a vector (not a matrix or timeSeries) containing the data. It passes a separate positions slot from a timeSeries for associating dates with Data when building the irregular time series.

See mk.its.exceedances.tS() for a method which passes a timeSeries object containing both data and position.

Value

An irregular time series ‘its’ object requiring the ‘its’ package to be loaded with exceedances ordered according to date. Input ‘its’ into plot function to graph the exceedances

Author(s)

documentation by Scott Ulman for R-language distribution

References

See pages 117-8 of QRM. Chapter 4 discusses the usefulness of graphing exceedances to display “volatility clustering”.

See Also

timeSeriesClass, mk.its.exceedances.tS, mk.returns

Examples

## Not run: 
#In this example, a simulated data series tdata was 
#generated using parameters derived from fitting a timeSeries 
#for the SP500 index called rseries over a specified period. 
#tdata was randomly generated from the t-distribution using 
#parameters estimated from the actual SP500 time series of data 
#returns (log differences). Thus tdata is a VECTOR (one column) 
#rather than a timeSeries or matrix.  If you have a matrix, pass 
#only the single column you want to analyze. 
#set threshold so we have 50 observations above threshold from tdata.
kval <- 50;
upper <- findthreshold(tdata,kval); 
#Create an its (irregular time series) associated with observations 
#above threshold upper. We pass the simulated data vector tdata, 
#the dates (positions slot) from a separate timeseries over the same 
#period for which we are considering the simulated data, 
#and the threshold value for our data vector. 
itsSample <- mk.its.exceedances.vector(tdata,rseries@positions,upper); 
#Plot the irregular time series of exceedances 
plot(itsSample,type="h", main="Clustering Evidence-Simulated t data",
   ylab="Large Returns"); 
## End(Not run)

[Package QRMlib version 1.4 Index]