Choosing parameters/model for stock data prediction.
5. Residual.
Here is the model that will be used in this section:
Previous model used highpass and lowpass filters. But after subtracting highpass and lowpass filter outputs from original data there will be some small signal which was dicarded before but will be used in this model. So now the model has 3 signal lines and 3 PNNs. Plus I put on the picture above differencing which gives better results as we saw in the previous part.
Using residual dramastically improved training error.
I did 3 tests with the following parameters.
1. Lead 0-1 Lag Low 0.1 0.01 High 0.1 0.01
2. Lead 0-4 Lag Low 0.1 0.01 High 0.1 0.01
3. Lead 0-4 Lag Low 0.1 0.01 High 0.11 0.01
Here Low 0.1 0.01 means lowpass filter with frequency 0.1 and width 0.01.
I ran this model on friday to predict prices for next 5 days. The best results were obtained with test 3.
The data output for this test for several weeks is shown below in the table.
Each row in this table represent the errors for one run from day 1 (Monday) to day 5 (Friday).
The errors obviously are random values but looks like if we know error on first two days we can improve our forecast using ajustment based on prev. errors.
| Day: | 1 | 2 | 3 | 4 | 5 |
| Week1 Error: | 0.16 | -0.125 | 0.18 | 0.401 | 0.11 |
| Week2 Error: | 0.25 | 0.30 | 0.94 | 1.27 | 1.25 |
| Week2 Error: | 0.17 | 0.04 | -0.1 | -0.05 | -0.13 |
The model still can not predict big jumps in the prices (week 2, on day 3 there was increase of 0.71). As result on some days the error is big. We will explore how the prediction can be improved in the following parts.
Prev Next