Tutorial: Using Correlation Analysis to Identify Inputs: Create a Prediction with Pre-lagged Inputs

Create a Prediction with Pre-lagged Inputs

i   Tutorial Task
Use correlation results to create a prediction with pre-lagged inputs.

 

Now, let’s create a different type of prediction using correlation fields with a lead of more than 1.

Step-by-step Instructions

1.    On the Modify Field Dialog: Correlation Analysis page, using the Ctrl key, add the “%Change in MBNA Cp:Close” with a Lag of 4 to the already selected inputs.

Ä    Note: If you have exited the dialogs from the previous task, you can return to the Correlation Analysis page by selecting Analyze Correlations… from the context menu for BellSouth, then selecting the Close field.

Ä    Note: If you have lost your previous selections, you will want to hold down the Ctrl key and reselect “%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 entry should also be near the top of the correlation analysis.

%Change in MBNA Cp:Close Lag 4

This weaker correlation is less easy to explain. Based on the correlation analysis, it appears that five days after “MBNA Cp” stock increases or decreases, BellSouth will more often than not move in the opposite direction. However, since its value is larger than the 99% confidence level, we can be reasonably sure that a correlation between these values exists.

 

To add it to our prediction, hold down the control key and click on this field in addition to the other three fields. All four of our discussion fields should now be selected.

 

Ä    Note: If you lost the previous selections, you will need to reselect the other fields.

Bellsouth Cp:Close Lag 0

DJ Industrial:Close Lag 0

S&P 500 Index:Close Lag 0

 

2.    Press the Create a New Prediction from the Selected Fields… button.

Press Create a New Prediction from the Selected Fields and advance through the Predict a Value Wizard to the Select Inputs page.

 

3.    On the Predict a Value Wizard, proceed through the panels to the Select Inputs page. Notice that “%Change in MBNA Cp: Close” has an “(n-4)” next to it. Press Next.

When you reach the Select Inputs page of the Predict a Value Wizard, notice that an input for MBNA Cp: Close has been added, labeled (n-4). This means that the input is lagged by four days. In other words, the value from four days ago will be used for this input.

Ä    Note: If the names of an input is truncated in the input list, you can display the entire input name by positioning the mouse over the truncated name. However, this support only exists for newer versions of Windows or when Internet Explorer version 5 is installed.

Ä    Note: You can also manually add lagged inputs. When you want to do this when you are adding an input, select the Lag Input option and specify the range of lagged values you would like to add.

 

4.    On the Select Options page, notice that the default model is for “Pre-lagged Inputs”. Press Next.

For this prediction, we are using inputs with specific lags. Because of this, the Select Options page will default to using a model that has been pre-configured to predict price data with pre-lagged inputs. This model differs from the one pre-configured for predicting time series in that it does not contain any memory within the neural network itself. This means that only the values listed in the input list will be examined, rather than those values and with their recent previous values.

 

What if we wanted to use memory in this situation? You would simply select to use the model pre-configured for predicting price data as time series. Note that this would apply the memory to the inputs after they are lagged. Therefore, you might also want to return to the Select Inputs page replace the lagged inputs with normal inputs so that the current values of those inputs are examined, as well.

 

In this case, let’s see what happens when we accept the default of modeling using pre-lagged inputs.

Ä    Note: The important difference to realize here is that although we have added an input to the prediction, this neural network will actually be looking at less data than in our previous prediction. This is because our previous prediction included memory that effectively allowed it to examine the last five values of each input. In other words, the last prediction used the equivalent of 15 inputs (3 inputs at 5 points in time). This prediction will use only 4 inputs.

 

5.    On the Create Prediction page, press Finish.

6.    TradingSolutions will ask if you would like to view an analysis of this prediction when training has completed. Press Yes.

This prediction typically has a good correlation to the desired value, but not as good as the previous prediction. This is probably due to it working with less information. However, this may also be due, in part, to the Procter & Gamble inputs providing less useful information. This is because non-informative inputs can reduce the ability of a neural network to train well by making it process extra information.

 

7.    On the Modify Data Series Dialog: Predictions page, numbers will appear next to the new prediction (typically #2) 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.

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 learned how to use correlation analysis and pre-lagged inputs to create a different type of prediction. You also should have a better understanding of the relationship between the inputs and the default neural network models.

 

As an additional exercise, you may want to apply the “Predicted Percent Change System” to these predictions. This will allow you to see how trading using this information compares to a buy and hold strategy. Look at the percent gain and number of trades based on both predictions, both overall and for the accuracy testing set.

 

10.  On the Modify Field Dialog: Correlation Analysis page, press the OK button.

In conclusion, correlation analysis is a powerful way to identify potential inputs. Fields with a high correlation between their previous values and the current value of the field you would like to predict can make very informative inputs.

 

However, it is important to understand the limitations of this method. Correlation analysis identifies only a subset of potentially good inputs. Furthermore, inputs based on fields in the correlation analysis may be pre-lagged, causing different default methodologies to be used. Finally, even highly ranked fields in the correlation analysis may not provide enough information to make good inputs.