drl-portfolio-management icon indicating copy to clipboard operation
drl-portfolio-management copied to clipboard

Results can not be replicated

Open yanxurui opened this issue 5 years ago • 8 comments

In the file ddpg_experiments.ipynb you have shown 2 plots of the results in testing_history, one for imitation, one for ddpg, which is very attractive. For example, ddpg with window 3, cnn, and batch norm achieves 3 fold return.

However, after training it myself using the same code, same model, same config and same data, I fail to replicate the results. The return is always below the market.

yanxurui avatar Feb 20 '19 23:02 yanxurui

Your pretrained model, render0

After training it by myself render1

yanxurui avatar Feb 23 '19 20:02 yanxurui

It is one of the major issues known in many fields using deep learning models, especially RL. I suggest you try different random seeds and train for longer period. Here is a reference How Many Random Seeds? Statistical Power Analysis in Deep Reinforcement Learning Experiments

vermouth1992 avatar Feb 25 '19 09:02 vermouth1992

Thanks for you reply. I don't think seed and training period are to blame. Since I am using the exactly same config including seed and training data as you did, the results should not be too different.

yanxurui avatar Feb 25 '19 10:02 yanxurui

Hi, I like to know if we change our data, I am downloading for yf and I am getting exactly same as market portfolio. I have transferred the data into required shape, of around 4000 data points (Open,Close,low, high, Adj Close) and have tried config changes, window length, Epochs and batch size. @yanxurui and @vermouth1992, I will be very thankful if you could inform if the data need to be changed before application of DDPG (both LSTM and CNN is giving exactly equity weighted porfolio) P.S : with 28 stocks with 15 year of data and model is taking approximately 5 minutes to build the graphs. Thank you, Best regards.

NarendarK29 avatar Jan 09 '20 16:01 NarendarK29

Hi, @NarendarK29 I'd like to help but I failed to get your point. Could you please state it clearly what your goal is and what your problem is? Thanks.

yanxurui avatar Jan 13 '20 08:01 yanxurui

Hi, @yanxurui Thank you for replying. Unfortunately, not all the folder were forked and it was not getting trained model parameters. It is an excellent work and I like to contribute toward it. I like to get your point of view that if I am trying to incorporate other features, as the P/E and rolling variance to make the model prone to value-based indicators and volatility of stock, where should I begin. I will deeply appreciate if you can provide me any guidance over where I can incorporate these changes. I am currently working on these models with intention to incorporate it into my master thesis project. I will deeply appreciate your help and please consider the request. Regards.

NarendarK29 avatar Jan 13 '20 19:01 NarendarK29

I think you should make sure this model (the model in this repo) works and then apply your improvements. If it does not work, you will not get satisfying results no matter what fancy features you add.

yanxurui avatar Jan 14 '20 00:01 yanxurui

Hello @yanxurui Below are the results European stock: Training image Testing image

NarendarK29 avatar Jan 14 '20 16:01 NarendarK29