jdanalyze: Function to analyze the predictive power of a joint...

Description Usage Arguments Details

Description

This function is used to gain insights into a joint distribution x, y and its predictive power over the third variable, the target.

Usage

1
2
jdanalyze(target, x = NULL, y = NULL, window = NULL, qsize = NULL,
  qtiles = list(Top = c(0.9, 1, 0.01), Bottom = c(0, 0.1, -0.01)))

Arguments

target,

x, y These are the 3-D data points to perform the scatter plot. X and y are the scatterplot x and y coordinates respectively, whereas target is the third dimension that is expressed as a pch and/or color on the 2D scatterplot based on its quantile / cluster. There are two ways to specify this data: either each of target, x and y are single column xts matrices, or a single 3 column xts matrix is provided as target and x and y are NULL.

window

The window width to perform the rollapply to compute the rolling quantile. If left to NULL, then no windowing is performed and the quantiles are computed from the entire data set.

qsize

If specified, this modifies the qtiles 'Top' and 'Bottom' arguments to the specified percentage. qsize should be specified as a decimal i.e. 0.10

qtiles

A named list containing the quantiles to analyze and a cutoff threshold used in rolling window mode. The cutoff thresholds are applicable only to Top and Bottom quantiles and ignored otherwise. All other quantile names can be anything meaningful to identify the quantiles, except that Top and Bottom are reserved for Top and Bottom quantiles respectively. Each quantile is assigned a vector length of either 2 or 3, where the first two values express the bottom and upper limit of the quantile. These limits are expressed as a number between 0 and 1. In cases where a third argument is provided (in rolling window mode), it is a percentage value (expressed as a fraction between -1 and +1) above or below which the data vector is either accepted or rejected in the quantile. For example, if Top is set between 0.75 and 1.0, with a window length of 100, then we would normally expect the top 25 points in that quantile. By adding the threshold, then only the top 25 points that are also above that threshold are reported. For example, during a bear market lasting the entire window, it's possible that only a few or even no vectors exist in that quantile that also exceed 10 percent. So a cutoff threshold of 10pct would reject most (or all) vectors in such a case.

Details

The function prepares an xts matrix to associate each vector to a quantile, based upon a set of quantile specifications.

As an additional option, the quantile subsets may also be grouped into clusters. Each such cluster should be given a unique color and/or point character (pch) for easy identification. This is specified in a dataframe in argument qstyle.

A shortcut is provided to get top and bottom quantiles at a given percentage. The default is set to Top = 95 qsize argument.


jeanmarcgp/xtsanalytics documentation built on May 19, 2019, 12:38 a.m.