Stochastic volatility example prediction

Dear all @fonnesbeck , @twiecki
I am try to understand and working further on this example and wish to get some hints from you guys.

I am trying to implement based on current stock close price to predict new stock price.

Based on my understanding, the current model prediction can be done based on volatility from Gaussian Random Walk and obtain the future return[‘change’].

My question is, how can we use current stock price as input to predict the return since we can observe or know the previous return and predict the future.
Unless we are doing in sample prediction, we can trace back the volatility based on index of train test split.

My purpose is similar to out of sample prediction, but in strictly not really out of sample, because I try to use previous return as input instead of volatility to make prediction.

Can anyone please give me some hints?

Thank you very much

I also have an interest in this notebook and was wondering why the prediction for new stock prices is not included in the example. Somehow this is missing.

Actually the prediction could be done if we are doing in sample prediction, by split the data into train and test. Since we know the index, we can trace back the current volatility and predict future returns.

But what I am interest is using current stock price as input instead of volatility since volatility is calculated rather than observed from the data available.

More details can be found from links below:

Hello Cobraz!

Thank you for your answer. The Link you provide is really good. Here is a Link were Buy or Sell is predicted with Close price.

Would you like to build a Trading bot together. I am looking to team up with somebody with the same interests like me :smiley:

my email is

Hi @waudihaudi ,

Thanks for the invitation, but I am doing my master thesis and I will only be free after Feb 2022.

I see than you really have a lot to do! Good luck :smiley: Please let me know if you find a way to use the close price.

Ah and one question if possible? What you think about a system based on PyMC3 for trend following instead of prediction … could this be a good idea?