saeedmarzban / waveCorr

waveCorr policy gradient model for portfolio management
5 stars 3 forks source link

portfolio vector sum #1

Closed m1996 closed 2 years ago

m1996 commented 3 years ago

Hi, Thank you so much for sharing your code. I ran the code with your own dataset, can, after a few epochs the sum of pvm (the values that print in every epoch) will become more than 1. Is that OK? Are these not the portfolio weights? Best Regards.

saeedmarzban commented 3 years ago

How far bigger than one? These values are rounded to two decimals and it may happen that the values get bigger than one.

Saeed

On Sat, Nov 20, 2021 at 3:26 AM m1996 @.***> wrote:

Hi, Thank you so much for sharing your code. I ran the code with your own dataset, can, after a few epochs the sum of pvm (the values that print in every epoch) will become more than 1. Is that OK? Are these not the portfolio weights? Best Regards.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/saeedmarzban/waveCorr/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGALZCXIIGE26KI7RIAHIETUM5LRTANCNFSM5INWUDVA .

m1996 commented 3 years ago

Thanks for your response. for example, this is in the output1.txt that you shared: epoch:999 [0.05 0.06 0.06 0.07 0.07 0.07 0.07 0.08 0.13 0.16] [0.03 0.03 0.04 0.06 0.07 0.1 0.11 0.14 0.16 0.16] [0.03 0.03 0.04 0.04 0.06 0.11 0.11 0.11 0.19 0.2 ] [0.02 0.03 0.03 0.03 0.06 0.07 0.08 0.15 0.21 0.23] [0.02 0.02 0.03 0.03 0.04 0.04 0.11 0.13 0.19 0.32] [0.04 0.04 0.04 0.06 0.07 0.08 0.11 0.13 0.18 0.18] [0.04 0.06 0.06 0.07 0.08 0.08 0.13 0.13 0.14 0.15] [0.04 0.04 0.05 0.08 0.09 0.1 0.1 0.13 0.15 0.17] [0.03 0.03 0.05 0.05 0.05 0.11 0.13 0.13 0.16 0.17] [0.04 0.05 0.06 0.08 0.08 0.1 0.11 0.11 0.16 0.17] ---------train APV : 554.9299805343385 ---------max test APV : 6.15576136 ---------test APV : 6.04711387 ---------min test APV : 0.95333638 ---------test turnover : 0.2224275 ---------time : 0:00:05 Annual return :0.3660104184459503 Annual return EW:0.03484517869719683 Annual vol :0.13511784386610648 Annual vol EW :0.14740656920759102 SR :2.7088237050958583 SR :0.23638823482910562 MDD :-0.1283119267034939 MDD EW :-0.4106325855628622 Daily hit rate :0.5368203716448727 Turnover :0.22242749794230424 ------------------------------------

as you see, the sum of them is 9.17. if the issue was caused by rounding, the difference should have been smaller, right?

saeedmarzban commented 3 years ago

These numbers show the 10 highest weight allocated to the stocks at each period. For example [0.05 0.06 0.06 0.07 0.07 0.07 0.07 0.08 0.13 0.16] is for one period and [0.03 0.03 0.04 0.06 0.07 0.1 0.11 0.14 0.16 0.16] is for another period. The periods are chosen randomly to be reported only to give an idea of how the investment is done. You should not sum up all the numbers as in that case you are summing the investments in multiple periods.

Saeed

On Sat, Nov 20, 2021 at 8:06 AM m1996 @.***> wrote:

Thanks for your response. for example, this is in the output1.txt that you shared: epoch:999 [0.05 0.06 0.06 0.07 0.07 0.07 0.07 0.08 0.13 0.16] [0.03 0.03 0.04 0.06 0.07 0.1 0.11 0.14 0.16 0.16] [0.03 0.03 0.04 0.04 0.06 0.11 0.11 0.11 0.19 0.2 ] [0.02 0.03 0.03 0.03 0.06 0.07 0.08 0.15 0.21 0.23] [0.02 0.02 0.03 0.03 0.04 0.04 0.11 0.13 0.19 0.32] [0.04 0.04 0.04 0.06 0.07 0.08 0.11 0.13 0.18 0.18] [0.04 0.06 0.06 0.07 0.08 0.08 0.13 0.13 0.14 0.15] [0.04 0.04 0.05 0.08 0.09 0.1 0.1 0.13 0.15 0.17] [0.03 0.03 0.05 0.05 0.05 0.11 0.13 0.13 0.16 0.17] [0.04 0.05 0.06 0.08 0.08 0.1 0.11 0.11 0.16 0.17] ---------train APV : 554.9299805343385 ---------max test APV : 6.15576136 ---------test APV : 6.04711387 ---------min test APV : 0.95333638 ---------test turnover : 0.2224275 ---------time : 0:00:05 Annual return :0.3660104184459503 Annual return EW:0.03484517869719683 Annual vol :0.13511784386610648 Annual vol EW :0.14740656920759102 SR :2.7088237050958583 SR :0.23638823482910562 MDD :-0.1283119267034939 MDD EW :-0.4106325855628622 Daily hit rate :0.5368203716448727 Turnover :0.22242749794230424 ------------------------------------

as you see, the sum of them is 9.17. if the issue was caused by rounding, the difference should have been smaller, right?

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/saeedmarzban/waveCorr/issues/1#issuecomment-974647732, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGALZCUVP2U2SLZ37PZOXS3UM6MN7ANCNFSM5INWUDVA .

m1996 commented 3 years ago

Oh, that makes everything clear. Thank you for so much.

On Sat, Nov 20, 2021, 4:48 PM Saeed Marzban @.***> wrote:

These numbers show the 10 highest weight allocated to the stocks at each period. For example [0.05 0.06 0.06 0.07 0.07 0.07 0.07 0.08 0.13 0.16] is for one period and [0.03 0.03 0.04 0.06 0.07 0.1 0.11 0.14 0.16 0.16] is for another period. The periods are chosen randomly to be reported only to give an idea of how the investment is done. You should not sum up all the numbers as in that case you are summing the investments in multiple periods.

Saeed

On Sat, Nov 20, 2021 at 8:06 AM m1996 @.***> wrote:

Thanks for your response. for example, this is in the output1.txt that you shared: epoch:999 [0.05 0.06 0.06 0.07 0.07 0.07 0.07 0.08 0.13 0.16] [0.03 0.03 0.04 0.06 0.07 0.1 0.11 0.14 0.16 0.16] [0.03 0.03 0.04 0.04 0.06 0.11 0.11 0.11 0.19 0.2 ] [0.02 0.03 0.03 0.03 0.06 0.07 0.08 0.15 0.21 0.23] [0.02 0.02 0.03 0.03 0.04 0.04 0.11 0.13 0.19 0.32] [0.04 0.04 0.04 0.06 0.07 0.08 0.11 0.13 0.18 0.18] [0.04 0.06 0.06 0.07 0.08 0.08 0.13 0.13 0.14 0.15] [0.04 0.04 0.05 0.08 0.09 0.1 0.1 0.13 0.15 0.17] [0.03 0.03 0.05 0.05 0.05 0.11 0.13 0.13 0.16 0.17] [0.04 0.05 0.06 0.08 0.08 0.1 0.11 0.11 0.16 0.17] ---------train APV : 554.9299805343385 ---------max test APV : 6.15576136 ---------test APV : 6.04711387 ---------min test APV : 0.95333638 ---------test turnover : 0.2224275 ---------time : 0:00:05 Annual return :0.3660104184459503 Annual return EW:0.03484517869719683 Annual vol :0.13511784386610648 Annual vol EW :0.14740656920759102 SR :2.7088237050958583 SR :0.23638823482910562 MDD :-0.1283119267034939 MDD EW :-0.4106325855628622 Daily hit rate :0.5368203716448727 Turnover :0.22242749794230424 ------------------------------------

as you see, the sum of them is 9.17. if the issue was caused by rounding, the difference should have been smaller, right?

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub < https://github.com/saeedmarzban/waveCorr/issues/1#issuecomment-974647732>, or unsubscribe < https://github.com/notifications/unsubscribe-auth/AGALZCUVP2U2SLZ37PZOXS3UM6MN7ANCNFSM5INWUDVA

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/saeedmarzban/waveCorr/issues/1#issuecomment-974649305, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEWCL3GNSM4ZOO2RHQ5FSPLUM6N2DANCNFSM5INWUDVA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.