Tutorial: Using Correlation Analysis to Identify Inputs: Create a Time Series Prediction
Create a Time Series Prediction
i Tutorial Task
Use correlation results to create a prediction.
We can now use the Correlation Analysis page to create predictions of the closing price. Let’s start by creating a prediction using the most highly correlated fields.
Step-by-step Instructions
1. On the Modify Field Dialog: Correlation Analysis page, hold down the Ctrl key and select “%Change in Bellsouth Cp:Close” “%Change in DJ Industrial Avg:Close”, and “%Change in S&P 500 Index:Close” with a lag of 0.
The following entries should be at or near the top of the correlation analysis.
%Change in Bellsouth Cp:Close Lag 0
%Change in DJ Industrial Avg:Close Lag 0
%Change in S&P 500 Index:Close Lag 0
Ä Note: If a different date range or additional data was used, your results may differ.
It is worth noting that these are all negative correlations. This means that when the price of BellSouth, the Dow Jones Industrial Average, and/or the S&P 500 Index increased or decreased one day, the value of BellSouth often moved in the opposite direction on the next day by a similar amount.
Ä Note: This is often a characteristic of a stock in a “trading” pattern. In other words, the value of the stock typically remains near what it is believed to be worth. Because of this, changes in price are followed by corrections to return it to its perceived value, particularly when it has moved with the broader market.
Ä Note: This exercise can also provide some insight into how some stocks can be predicted using only their closing price. In this case, the highest correlation between the closing price and the values we tested is with its previous value.
Let’s use these fields as inputs to a prediction of the closing price of BellSouth. Select these fields with the mouse by clicking on one of them, then hold down the control (Ctrl) key and click on the other two. Then, release the control key. All three fields should now be selected.
2. Press the Create a New Prediction from the Selected Fields… button.
Press the Create a New Prediction from the Selected Fields… button. This will display the Predict a Value Wizard.
3. On the Predict a Value Wizard, proceed through the panels to the Select Inputs page. Notice that the selected fields have been added. Press Next.
Since we requested to create a new prediction from the selected fields, the desired output and all of the inputs have already been set in the Predict a Value Wizard.
4. On the Select Options page, notice that the default model is for predicting “As a Time Series”. Press Next.
Like the inputs we have selected manually, these inputs do not have any lag associated with them. Lag is the number of days prior to today that the value occurs. In this case, we are using three values from today to predict tomorrow’s close.
Since we selected inputs without any lag, the Predict a Value Wizard will default to using a model that is pre-configured to predict price data as a time series. This means that the neural network will actually be keeping a memory of recent previous values for all of the inputs.
5. On the Create Prediction page, press Finish.
Press the Finish button to create the prediction.
6. TradingSolutions will ask if you would like to view an analysis of this prediction when training has completed. Press Yes.
After the prediction is created, TradingSolutions will ask if you want to train the prediction and analyze the results. This is optional since you may want to create other predictions based on this correlation analysis. Since this is the only prediction we want to create at the moment, press the Yes button.
7. On the Modify Data Series Dialog: Predictions page, numbers will appear next to the new prediction when the analysis is ready. At this time, select the prediction and press Analyze….
Ä Note: On faster computers, the analysis may already be ready when you reach this page.
8. On the Modify Field Dialog: Training Analysis page, review the analysis. In particular, look at the Correlation page and notice that the Correlation of Percent Changes over the Training range is fairly high, but it not as good over other ranges.
When TradingSolutions has finished processing, the training analysis for the prediction will appear. The analysis text will probably indicate this is a poor model. Switch to the Correlation sub-page. According to this, the correlation of percent changes was good in the training set, but declined significantly in the cross validation and testing sets. This is probably due to the changing market conditions over the last two years of data.
9. When you are finished with the analysis, press the OK button on the Modify Field dialog for the prediction and the Close button on the Modify Data Series dialog. This should return you toe the Modify Field dialog for the Close field, looking at the Correlation Analysis page.
Congratulations, you have used correlation analysis to determine potential inputs to a prediction. The remainder of this task looks at additional issues concerning creating predictions in this manner.