divergence {tawny}R Documentation

Measure the divergence and stability between two correlation matrices

Description

The Kullback-Leibler distance function can be used to measure the divergence between two correlation matrices. Although originally designed for probability density functions, the literature shows how this can be extended to correlation matrices. By using this function, one can determine objectively the effectiveness of a particular filtering strategy for correlation matrices.

Usage

divergence(h, count, window = NULL, filter = getCorFilter.RMT(), measure = 'information')
divergence.information(h, count, window, filter)
divergence.stability(h, count, window, filter)
divergence.kl(sigma.1, sigma.2)
divergenceLimit.kl(m, t = NULL)
stabilityLimit.kl(m, t = NULL)
plotDivergenceLimit.kl(m, t.range, ..., overlay = FALSE)

Arguments

h A zoo object representing a portfolio with dimensions T x M
count The number of bootstrap observations to create
window The number of samples to include in each observation. Defaults to the anylength of h.
filter The correlation filter to measure
measure The type of divergence to calculate. Possible choices are information (default) or stability.
sigma.1 The sample correlation matrix
sigma.2 The model correlation matrix (aka the filtered matrix)
m The number of assets
t The number of samples (dates) in an observation
t.range A range of date samples. This can be a simple interval so long as it matches the number of samples per asset in the measured correlation matrix.
overlay Overlay the divergence limit plot on an existing plot. Default is FALSE.
... Additional parameters to pass to plot or lines

Value

A summary of the results of the divergence calculation including the mean divergence and an effective limit based on a random matrix.

Author(s)

Brian Lee Yung Rowe

Examples

data(sp500.subset)

plotDivergenceLimit.kl(100, 80:499, col='green', ylim=c(0,55))

divergence(sp500.subset, 25, filter=getCorFilter.RMT())
divergence(sp500.subset, 25, filter=getCorFilter.Shrinkage())


[Package tawny version 1.1.0 Index]