McNelis chose to work in MATLAB because of its programming facility, ease of use, and ability to handle vast data sets. As for methodology, he believed that he would achieve more accurate results by combining linear models and neural network analysis. An advantage of using neural networks, he explains, is that “the estimation involves not only sequential processing of the data, using inputs x to forecast the output y, but also simultaneous parallel processing, since the inputs are processed by several neurons in the hidden layer.”
Central to his analysis was a genetic algorithm that he developed jointly with Professor John Duffy of the University of Pittsburgh. In developing the algorithm, McNelis and Duffy used Statistics and Machine Learning Toolbox extensively. They also used the vectorization functions in MATLAB for faster processing. “The coefficients that are obtained by the algorithm,” McNelis explains, “can be used as the starting values for the more common local search methods.” For his search method, he used the nonlinear minimization function in Optimization Toolbox.
After completing the data collection, McNelis set out to produce the best results he could obtain with a traditional linear model. He then used the input from this model to build the neural network.
In defining a neural network, McNelis says that he likes to “start with a simple network, such as three or four neurons in one hidden layer. I train the model with a hybrid method, first using a genetic algorithm to find a set of coefficients for the neural network, and then switch, with these coefficients, to a nonlinear gradient descent method.”
McNelis used the feed-forward architecture in Deep Learning Toolbox to relate input to output. He explains, “Though I have experimented with different neural network architectures in a variety of economic applications, I have found that the best one is the feed-forward model with one hidden layer.” He used the toolbox’s log sigmoid activation function for the hidden layer for each of the neurons. The input was transmitted to the hidden layer and squashed by the log sigmoid function. Finally, the neurons were transmitted to the output layer as linear combinations.
He was able to increase the forecasting power of neural networks even further by using a time-varying GARCH model to proxy exchange rate risk for the dramatic Indonesian currency declines during November and December 1997.
He used Spreadsheet Link for getting in-sample and out-of-sample performance. Spreadsheet Link allowed him to take out-of-sample predictions and import them into Microsoft® Excel® and calculate the errors in the out-of-sample predictions. It was then easy to transfer the results from MATLAB into a presentation spreadsheet format.