convert_dur_size | R Documentation |
Converts size in months to size in percent of portfolio terms
convert_dur_size(strat_df, strat_id_sizetype, duration_df, convert_to_decimal = TRUE)
strat_df |
A gathered dataframe containing 'date', 'strategy', 'instrument', and 'size' in percent or month-weighted sizes. |
strat_id_sizetype |
A dataframe containing the columns of 'strategy', 'identifier' and 'size_type' that correspondings to those in strat_df. 'size_type' must be 'months' or 'percent' |
duration_df |
A dataframe containing timeseries duration of assets, can be generated from 'get_dur_bbg' |
convert_to_decimal |
A boolean indicating if all final percent numbers be converted to decimal form ie. divide by 100 |
A dataframes with same structure as 'strat_df', but sizes converted to percent form
data(demo_strategies) data(demo_duration) portfolios <- build_strategies(demo_strategies, as.Date("2016-01-01"), as.Date("2018-12-07")) actual_pf_size <- convert_dur_size(portfolios$actual, portfolios$summary, demo_duration)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.