AngularDistance: Angular distance metrics

View source: R/AngularDistance.R

AngularDistanceR Documentation

Angular distance metrics

Description

Calculates the angular distance between a matrix of the track records of various assets/strategies. The sign of the correlation can be ignored for long/short portfolios.

Usage

AngularDistance(returns_matrix, long_short = FALSE)

Arguments

returns_matrix

a matrix containing the track records of the underlying assets/strategies.

long_short

a boolean value which results in the sign of the correlation being ignored, default value is FALSE

Value

A matrix containing the angular distance values.

Author(s)

Tasos Grivas <tasos@openriskcalculator.com>

References

Lopez de Prado, Marcos, Codependence (Presentation Slides) (January 2, 2020). Available at SSRN: https://ssrn.com/abstract=3512994

Examples


## calling AngularDistance() 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")]
angular_distance = AngularDistance(returns_matrix, long_short=FALSE)


Trading documentation built on Feb. 13, 2024, 3 a.m.