Learn R Programming

Trading (version 2.0)

CrossSampleEntropy: Angular distance metrics

Description

Calculates the cross sample entropy between two track records of various assets/strategies.

Usage

CrossSampleEntropy(returns_matrix, m = 2, r = 0.2)

Arguments

returns_matrix

a matrix containing the track records of the underlying assets/strategies. These will be normalized during the algorithm

m

an integer value defining the embedding dimension , default value is 2

r

a double value defining the tolerance, default value is 0.2

Value

The value of cross sample entropy

References

https://physoc.onlinelibrary.wiley.com/doi/epdf/10.1113/expphysiol.2007.037150

Examples

Run this code
# NOT RUN {
## calling CrossSampleEntropy() without an argument loads the historical edhec data
## for the "Short Selling" and "Convertible Arbitrage" strategies
returns_matrix = PerformanceAnalytics::edhec[,c("Short Selling","Convertible Arbitrage")]
Cross_Sample_Entropy = CrossSampleEntropy(returns_matrix,m=2,r=0.2)

# }

Run the code above in your browser using DataLab