C++ Neural Networks and Fuzzy Logic
by Valluru B. Rao M&T Books, IDG Books Worldwide, Inc. ISBN: 1558515526 Pub Date: 06/01/95 |
Previous | Table of Contents | Next |
Now lets look at the rest of this table, which is made up of the new 10 values of ROC indicators (Table 14.3).
Date | ROC3_3Mo | ROC3_Bond | ROC10_AD | ROC3_H/L | ROC3_SPC |
---|---|---|---|---|---|
1/4/80 | |||||
1/11/80 | |||||
1/18/80 | |||||
1/25/80 | |||||
2/1/80 | |||||
2/8/80 | 0.002238 | 0.030482 | -0.13026 | -0.39625 | 0.029241 |
2/15/80 | 0.011421 | 0.044406 | -0.55021 | -0.96132 | 0.008194 |
2/22/80 | 0.041716 | 0.045345 | -0.47202 | -0.91932 | 0.001776 |
2/29/80 | 0.0515 | 0.069415 | 0.358805 | -0.81655 | -0.00771 |
3/7/80 | 0.089209 | 0.047347 | -0.54808 | -1 | -0.03839 |
3/14/80 | 0.073273 | 0.026671 | -0.06859 | -0.96598 | -0.03814 |
3/21/80 | 0.038361 | 0.001622 | -0.15328 | -0.51357 | -0.04203 |
3/28/80 | 0.065901 | -0.00748 | 0.766981 | -0.69879 | -0.03816 |
4/3/80 | -0.00397 | 0.005419 | -0.26054 | 0.437052 | -0.01753 |
4/11/80 | -0.03377 | -0.00438 | 0.008981 | 0.437052 | -0.01753 |
4/18/80 | -0.0503 | -0.02712 | -0.23431 | 0.803743 | 0.001428 |
4/25/80 | -0.08093 | -0.0498 | -0.37721 | 0.58831 | 0.015764 |
5/2/80 | -0.14697 | -0.04805 | -0.25956 | 0.795146 | 0.014968 |
5/9/80 | -0.15721 | -0.05016 | -0.37625 | -0.10178 | 0.00612 |
5/16/80 | -0.17695 | -0.0555 | 0.127944 | 0.823772 | 0.016043 |
5/23/80 | -0.10874 | -0.02701 | 0.515983 | 0.86112 | 0.027628 |
ROC10_3Mo | ROC10_Bnd | ROC10_AD | ROC10_HL | ROC10_SP | |
0.15732 | 0.084069 | 0.502093 | -0.99658 | -0.04987 | |
0.111111 | 0.091996 | -0.08449 | -0.96611 | -0.05278 | |
0.087235 | 0.069553 | 0.268589 | -0.78638 | -0.04964 | |
0.055848 | 0.030559 | 0.169062 | -0.84766 | -0.06888 | |
0.002757 | -0.01926 | -0.06503 | -0.39396 | -0.04658 | |
-0.10345 | -0.0443 | 0.183309 | 0.468658 | -0.03743 | |
-0.17779 | -0.0706 | -0.127 | 0.689919 | -0.03041 | |
-0.25496 | -0.0996 | 0.319735 | 0.980756 | -0.0061 | |
-0.25757 | -0.0945 | 0.299569 | 0.996461 | 0.02229 | |
NOTE: Note that you dont get completed rows until 3/28/90, since we have a ROC indicator dependent on a Block Average value 10 weeks before it. The first block average value is generated 1/1/80, two weeks after the start of the data set. All of this indicates that you will need to discard the first 12 values in the dataset to get complete rows, also called complete facts.
We now have values in the original five data columns that have a very large range. We would like to reduce the range by some method. We use the following function:
new value = (old value - Mean)/ (Maximum Range)
This relates the distance from the mean for a value in a column as a fraction of the Maximum range for that column. You should note the value of the Maximum range and Mean, so that you can un-normalize the data when you get a result.
Weve taken care of all our inputs, which number 15. The final piece of information is the target. The objective as stated at the beginning of this exercise is to predict the percentage change 10 weeks into the future. We need to time shift the S&P 500 close 10 weeks back, and then calculate the value as a percentage change as follows:
Result = 100 X ((S&P 10 weeks ahead) - (S&P this week))/(S&P this week).
This gives us a value that varies between -14.8 to and + 33.7. This is not in the form we need yet. As you recall, the output comes from a sigmoid function that is restricted to 0 to +1. We will first add 14.8 to all values and then scale them by a factor of 0.02. This will result in a scaled target that varies from 0 to 1.
scaled target = (result + 14.8) X 0.02
The final data file with the scaled target shown along with the scaled original six columns of data is shown in Table 14.4.
Date | S_3MOBill | S_LngBnd | S_A/D |
---|---|---|---|
3/28/80 | 0.534853 | -0.01616 | 0.765273 |
4/3/80 | 0.391308 | 0.055271 | -0.06356 |
4/11/80 | 0.331578 | 0.009483 | 0.049635 |
4/18/80 | 0.273774 | -0.09674 | -0.03834 |
4/25/80 | 0.168765 | -0.21396 | -0.08956 |
5/2/80 | -0.01813 | -0.2451 | -0.0317 |
5/9/80 | -0.12025 | -0.29455 | -0.15503 |
5/16/80 | -0.22912 | -0.37696 | 0.006205 |
5/23/80 | -0.1954 | -0.34583 | 0.349971 |
S_H/L | S_SPC | Result | Scaled Target |
-0.07089 | -0.51328 | 12.43544 | 0.544709 |
-0.07046 | -0.49236 | 12.88302 | 0.55366 |
-0.06969 | -0.46901 | 9.89498 | 0.4939 |
-0.07035 | -0.51513 | 15.36549 | 0.60331 |
-0.06903 | -0.44951 | 11.71548 | 0.53031 |
-0.06345 | -0.44353 | 11.61205 | 0.528241 |
-0.06903 | -0.45577 | 16.53934 | 0.626787 |
-0.04372 | -0.41833 | 12.51048 | 0.54621 |
0.033901 | -0.37179 | 9.573314 | 0.487466 |
Previous | Table of Contents | Next |