Database Reference
In-Depth Information
Figure 11.6
Neural Network Methods
Like the regression method, the neural network can be used to forecast
time-series data. As with the regression method, the inputs are lagged
observed values, and the output is a prediction of the next n values. For
example, the following test code uses a simple neural network that uses the
previous k observed values as its input. The output is a prediction for the
next point in the time series.
The neural network itself is initialized with k input units, a hidden layer
containing an arbitrarily chosen five units and a single output layer:
int k = 14;
double [] x = new double [k];
double [] y = new double [1];
double t = 0.0;
MersenneTwisterFast twist = new MersenneTwisterFast();
NeuralNetwork nn = NeuralNetwork. build ()
.inputs(k)
.layer(5)
.layer(1)
.initialize();
Inthisexample,simulateddataisgeneratedfromasinewaveandthennoise
is added to the signal:
 
Search WWH ::




Custom Search