roll_cor: Calculate & Plot Rolling Correlation for two assets.

Description Usage Arguments Details Examples

View source: R/roll_cor.R

Description

This function will caculate and plot rolling correlation between return of two assets.

Usage

1
roll_cor(Ra, Rb, width)

Arguments

Ra

an xts, vector, matrix, data frame, timeSeries or zoo object of asset returns

Rb

an xts, vector, matrix, data frame, timeSeries or zoo object of asset returns

width

number of periods to apply rolling function window over

Details

This Package is based on PerformanceAnalytics

Examples

1
2
  ret = asset_data[,c(1,5)]
  roll_cor(ret[,1], ret[,2], width = 360)

hyunyulhenry/HenryQuant documentation built on Nov. 15, 2019, 2:28 a.m.