Attempt to replicate the R PerformanceAnalytics package