ZhengyaoJiang / PGPortfolio

PGPortfolio: Policy Gradient Portfolio, the source code of "A Deep Reinforcement Learning Framework for the Financial Portfolio Management Problem"(https://arxiv.org/pdf/1706.10059.pdf).
GNU General Public License v3.0
1.75k stars 752 forks source link

model predicts equal weights in portfolio #87

Open Amarchuk opened 6 years ago

Amarchuk commented 6 years ago

Hi there,

I try to apply you project for forex data. While it is obviously different from crypto market, the differences are not that big and can be neglected or solved. Interesting, that all experiments with different assets (USD-based portfolio with 10 pairs for example) produce the models, which predicts near the same weight for all pairs in portfolio on every step. I interpreted this like the model can't generalize and can't prefer one pair to another.In other words every trained agent show behaviour similar to CRP.

Generally speaking, my question is - do you have some clues/ideas why this might happen? I think about number of steps (I don't use millions - just try 15k and 80k) as an obvious candidate along with fee can be big enough (I try to shrink it size without luck) or the situation where prices itself act in unison (check that, not all pairs correlate with each other). Thanks

dexhunter commented 6 years ago

do you have some clues/ideas why this might happen?

There are many reasons this might happen. Like configuration of hyperparameters, technical bugs, etc. I am not sure what's the specific problem in your case.

I try to shrink it size without luck

What do you mean by shrink its size? Are you referring to reduce the commission fee or steps?

not all pairs correlate with each other

The assets in EIIE topology are actually independent. So I don't think that's the reason for uniform behavior.

kumkee commented 6 years ago

Although this is a different problem, batch normalization, proposed to solve Issue #55, would also help weight variation across the time axis.

Amarchuk commented 6 years ago

@DexHunter Yes, I try to reduce the commission fee as possible cause of such behaviour.

There are many reasons this might happen. Like configuration of hyperparameters, technical bugs, etc. I am not sure what's the specific problem in your case.

Sure you can't, but assuming that everything is ok - it is very strange that different pairs/number of steps/initial vector allocation/fee size - all results in such models. So you doesn't experienced such equally-distributed model in any of your experiments? Interesting.

Amarchuk commented 6 years ago

@kumkee Thanks, I read original issue and found it very informative, but not sure how batch normalization can help in my situation.

dexhunter commented 6 years ago

So you doesn't experienced such equally-distributed model in any of your experiments?

Not really, the PVM initialization is uniform, so it seems to me the uniform behavior is like the agent didn't learn anything.

ALevitskyy commented 6 years ago

Got the same problem after training on ForEx data from histdata.com

@Amarchuk Did you manage to figure out what`s happening?

ALevitskyy commented 6 years ago

After playing around with parameters, the model seems to converge to full cash and no trading after enough iterations. Seems like a good case for weak version of efficient market hypothesis or for my lack of skills

joddm commented 6 years ago

@ALevitskyy I am experiencing the same, that either it goes full cash or around 0.8 cash. I am trying to figure out how I can restrict cash bias to 0.