Chapter 5. Forecasting Weather

This chapter presents an application of neural networks to the prediction of future weather data. We are going to walk through the entire process of designing a neural network to be applied to this problem, how to choose the neural architecture, the number of neurons, as well as selecting and preprocessing data. Then, the reader will be presented with a dataset on which our neural network is going to make predictions of weather variables using the Java programming language. The topics covered in this chapter are as follows:

  • Neural networks for prediction problems
  • Selecting data
    • Input/Output variables
    • Filtering
  • Preprocessing
    • Normalization
  • Java implementation
    • Adaptations
  • Empirical design of neural networks

Neural networks for prediction problems

So far, the reader has been presented with a number of neural network implementations and architectures, so now; it is time to get into more complex cases. The power of neural networks in predictions is really astonishing, since they can perform "learning" from historical data in a fashion in which the neural connections are adapted to produce the same results according to some input data. For example, for a given situation (cause), there is a consequence (result) and this is coded as data; the neural network can be used to learn the nonlinear function that maps the situation to the consequence (or the cause to the result).

Prediction problems are an interesting category to apply neural networks to. Let's take a look at a sample table containing weather data:

Date

Avg. temperature

Pressure

Humidity

Precipitation

Wind speed

July 31

23° C

880 mbar

66%

16 mm

5 m/s

August 1

22° C

881 mbar

78%

3 mm

3 m/s

August 2

25° C

884 mbar

65%

0 mm

4 m/s

August 3

27° C

882 mbar

53%

0 mm

3 m/s

     

December 11

32° C

890 mbar

64%

0 mm

2 m/s

The preceding table depicts five variables containing hypothetical values of weather data collected from a hypothetical city, only for the purpose of this example. Now, let's suppose that each of the variables contains a list of values sequentially taken over time. We can think of each list as a time series. On a time-series chart, one can see how they evolve along with time:

Neural networks for prediction problems

The relationship between these time series denotes a dynamic representation of weather in a certain city, as depicted in the preceding chart. We indeed want the neural network to learn these dynamics; however, it is necessary to understand a little bit more about the phenomena, because we need to structure this data in a way that neural networks can process it.

Only after structuring the data can we structure the neural network, that is, the number of inputs, outputs, and hidden nodes. However, there are many other architectures that may be suitable for prediction problems, such as radial basis functions and feedback networks. In this chapter, we will deal with the feedforward multi layer perceptron with backpropagation learning algorithm, to demonstrate how this architecture can be simply exploited to predict weather variables. Also, this architecture presents very good generalized results with good selected data and there is little complexity involved in the design process.

The overall process for designing neural networks for prediction processes is depicted in the following figure:

Neural networks for prediction problems

If the neural network fails to be validated (step 5), then usually, a new structure (step 3) is defined, although sometimes, steps 1 and 2 may be repeated. Each of the steps in the figure will be addressed in the following sections of this chapter.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset