roll_absorp_ratio: Rolling absorption ratio

Description Usage Arguments Details Value Examples

View source: R/QuantAnalysis.R

Description

Rolling absorption ratio

Usage

1
2
3
4
5
6
7
8
roll_absorp_ratio(
  ret,
  n_pc = 2,
  roll_win = 252,
  cov_win = list(long = 252, med = 63, short = 21),
  cov_wgt = list(long = 0.5, med = 0.25, short = 0.25),
  delta_win = list(long = 252, short = 15)
)

Arguments

ret

data.frame containing return time-series

n_pc

number of pc for absorption ratio calculation, see details

roll_win

window for rolling calculation

cov_win

list of windows for covariance calculation, see details

cov_wgt

list of weights for covariance calculation, see details

delta_win

list of weights for standardized change calc, see details

Details

See 2010 Kritzman, et al paper Principal Components as a Measure of Systemic Risk, https://papers.ssrn.com/sol3/papers.cfm?abstract_id=1582687. The ratio is equal to the proportion of risk explained by the first n_pc eigenvalues. A higher ration indicates higher systemic risk in the universe of the ret parameter. The paper uses a weighted covariance calculation with a half life decay, this function slightly differes by using a simple weighted average covariance calculation, see cov_wgt_avg. There are three covariance weights: long (default 252 observations and 0.5 weight), med (default 63 observations and 0.25 weight), and short (default 21 observations and 0.25 weight). This allows for flexibality, e.g., if you wanted a standard cov calculation you would set the cov_win$long to the same number as roll_win and set the cov_wgt$long to 1 and the med and short weights to 0. Note the cov_win and cov_wgt arguments are lists with the names long, med, and short. The delta_win calculates a standardized change (zscore) of the rolling absorption ratio defined as (mean of short window - mean of long window) / standard devation of the long window.

Value

data.frame with dates, absorption ratio, and standardized change in the absorption ratio.

Examples

1
2
3
4
5
6
7
8
9
data(ret)
# use standard parameters
roll_absorp_ratio(ret)

# use regular cov() covariance calculation
roll_absorp_ratio(ret, cov_wgt = list(long = 1, med = 0, short = 0))

# use 500 day rolling window instead
roll_absorp_ratio(ret, roll_win = 500, cov_win = list(long = 500, med = 63, short = 21))

alejandro-sotolongo/InvestmentSuite documentation built on Jan. 19, 2020, 5:20 p.m.