From 2e6492a85d6831912ec791e0da3b03459a24cfdb Mon Sep 17 00:00:00 2001 From: CJ Yetman Date: Tue, 30 Nov 2021 11:58:02 +0100 Subject: [PATCH] filter out short and null holdings This is @FrederickFa's suggested (quick but not ideal) change to address the problem discussed in #499. This is also discussed in ADO#661, where there seems to be still some debate on the proper long term solution. --- 3_run_analysis.R | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/3_run_analysis.R b/3_run_analysis.R index 69a3621a..c72d7eb2 100644 --- a/3_run_analysis.R +++ b/3_run_analysis.R @@ -52,6 +52,8 @@ if (file.exists(equity_input_file)) { port_raw_eq <- port_raw_all_eq %>% filter(investor_name == investor_name_select) port_eq <- calculate_weights(port_raw_eq, "Equity", grouping_variables) + + port_eq <- port_eq %>% filter(port_weight > 0) # filter out short and null holdings port_eq <- merge_in_ald(port_eq, ald_scen_eq) @@ -152,6 +154,8 @@ if (file.exists(bonds_inputs_file)) { port_raw_cb <- port_raw_all_cb %>% filter(investor_name == investor_name_select) port_cb <- calculate_weights(port_raw_cb, "Bonds", grouping_variables) + + port_cb <- port_cb %>% filter(port_weight > 0) # filter our short and null holdings port_cb <- merge_in_ald(port_cb, ald_scen_cb)