calc_active_risk: Calculate active risk given return of strategies and weight...

Description Usage Arguments Value Examples

Description

Calculate active risk given return of strategies and weight of the strategies

Usage

1
2
calc_active_risk(unwt_ret, curr_wt, start_date = today() - years(10),
  end_date = today(), annualize_factor = 250)

Arguments

unwt_ret

dataframe of returns of strategies with columns 'date', 'strategy', 'return'

curr_wt

dataframe of weights with columns 'strategy', 'size'

start_date

start_date for calc of active risk

end_date

end_date

annualize_factor

factor to multiply by to convert to annual. 250 for daily data (default) and 12 for monthly data

Value

list containing 'cov_matrix', 'port_sd' (portfolio std dev), 'active_risk', 'marginal_risk'

Examples

1
2
3
4
5
6
7
8
9
portfolios <- build_strategies(demo_strategies,
  start_date = as.Date("2016-01-01"),
  end_date = as.Date("2018-12-07"))
sim_pf_size <- convert_dur_size(portfolios$sim, portfolios$summary, demo_duration)
wt_return <- calc_strat_wt_return(sim_pf_size, demo_return)
headline_size <- calc_strat_headline_size(sim_pf_size)
unwt_return <- calc_strat_unwt_return(wt_return, headline_size)
curr_wt <- get_strat_size(headline_size, as.Date("2018-01-05"))
calc_active_risk(unwt_return, curr_wt, as.Date("2017-06-01"), as.Date("2018-06-01"))

yunching/tidymas documentation built on Nov. 17, 2019, 6:03 a.m.