MATLAB Answers


How to code a simple machine learning model?

Asked by Pierre Lonfat on 14 Mar 2018
Latest activity Commented on by Pierre Lonfat on 26 Mar 2018
Hello everyone, machine learning is completely new to me and I was wondering if anyone could help me.
If you consider the following graph, we have the market risk premium in blue, and the stock market index in green. Risk premium is generally used to forecast future stock performance.
My idea was, if it is feasible, to use a machine learning tools that will extract all the explanatory information of the risk premium and use it to make the best forecast for the next 3 months (either positive or negative).
Once I know how to do the core code I will be able to play around a bit.
Can anyone describe me how he would handle this problem?
Many thanks in advance,


Sign in to comment.

1 Answer

Answer by Bernhard Suhm on 25 Mar 2018
 Accepted Answer

This is a regression problem. You could build a simple regression model using your risk premium as predictor, or better that risk premium from a couple points in the past (the last few days / weeks etc). Once you have built a table with those predictors and the stock index as response, you can use the Regression Learner app to build the actual model without coding. To get a good model, you'll probably want to use predictors aside from your risk premium, but I'm not experienced in financial modeling, so I'll leave it here - though there's a lot of additional advice how to build a stock market prediction model out there, good luck!

  1 Comment

Thank you very much !

Sign in to comment.