NIC Maharashtra
LSTM BASED MODEL FOR FORECASTING OF DAILY MAXIMUM & MINIMUM
NIC Maharashtra has initiated an AI based model
for prediction of daily maximum and minimum temperature using ANN.
ANNs are composed of multiple nodes.
Each node represents an artificial neuron. The neurons are connected by links and they
interact with each other.
The nodes can take input data and perform
simple operations on the data.
The result of these operations is passed to other
neurons.
The output at each node is called
A Recurrent Neural Network (RNN) is a class
of Artificial Neural Network where
connections between nodes form a directed graph along a temporal sequence.
A sequence can be of vectors (or scalars)
which depend on time t.
Data with scalars:
{ x ( t 0 ), x ( t 1 ), · · · x ( t i − 1 ), x ( t i ), x ( t i+1 ), · · · }
It’s the output of some process P that is to be modelled.
Optimization is the task of finding the arguments
to a function which yield its minimum or maximum value.
The function which is to be optimized is called
the objective function. When the particular optimization is minimization, the function may also be referred to as a cost, loss, or error function.
Optimization Algorithms:
1.Stochastic Gradient Decent 2.Adagrad
A Time Series is a series of data points
indexed (or listed or graphed) in time order. Most commonly, a time series is a sequence taken at successive equally spaced points in time. Thus it is a sequence of discrete-time data.
Time Series analysis can be applied to
real-valued, continuous data, discrete numeric data, or discrete symbolic data.
Continuous: A time series is continuous when
observations are made continuously through time, even when the measured variable can only take a discrete set of values.
Example: Physical quantities such as
temperature, pressure, and light intensity change continuously. Observations of these values form a continuous time series.
Variable t is real-valued, and x(t) is a
continuous signal.
To get a series {x[t]}, signal must be sampled
at discrete points. In uniform sampling, if sampling period is ∆t, then {x[t]}={x(0), x(∆t), x(2∆t), x(3∆t), · · ·} (1).
To ensure that x(t) can be recovered from
x[t], ∆t must be chosen according to the Nyquist sampling theorem.
If fmax is the highest
frequency component of x ( t), then we must sample at a rate at
least twice as high.
Prediction : Predict future values of x[t]
Classification :Classify a series into one of a
few classes.eg.
1“Temperature will go up”
2 “Temperature will go down” 3 “no change”
Regression : Describe a series using a few
parameter values of some model
Transform one time series into another
The idea behind RNNs is to make use of sequential information. In a traditional neural network, it is assumed that all inputs (and outputs) are independent of each other. To predict the next word in a sentence it is better know which words came before it. RNNs are called recurrent because they perform the same task for every element of a sequence, with the output being depended on the previous computations. Another way to think about RNNs is that they have a “memory” which captures information about what has been calculated so far.
Images below illustrate the difference in the information flow between a RNN and a Feed-Forward Neural Network.
LSTM networks have some internal contextual
state cells that act as long-term or short-term memory cells.
The output of the LSTM network is modulated
by the state of these cells. This is a very
important property where it is required that the prediction of the neural network to
depend on the historical context of inputs, rather than only on the very last input.
The first step in our LSTM is to decide what information is going to be thrown away from the cell state. This decision is made by a sigmoid layer called the “forget gate layer.” It looks at h(t−1) and x(t), and outputs a number between 0 and 1 for each number in the cell state C(t−1). A 1 represents “completely keep this” while A 0 represents “completely get rid of this.”
Presently, weather forecasting is done through physical simulations in which the atmosphere is modeled as a fluid, the future state is computed by numerically solving the equations of fluid dynamics and thermodynamics. This model is unstable and the complex atmospheric processes restrict the extent of accurate weather forecasting. Therefore, ANN model is proposed for forecasting of weather parameter using the AI/ML technology- Python 3.6.5, SciPy , NumPy, Matplotlib, Pandas, scikit-learn , keras and tensorflow environment.
Model is developed using Keras for prediction
of daily maximum and minimum temperature data.
Keras is an Open Source Neural Network
library written in Python that runs on top of Theano or Tensorflow.
In a Keras sequential model an instance of
the Sequential class is created and model layers are created and added to it.
Specimen reading of temperature data for IMD –
Colaba Mumbai for the period 2011-2018
Daily Max Temp. (x) Max Temp. next 24 Hrs(y)
(X in Deg. Cent.) (Y in Deg. Cent.)
1 28.0 29.0
2 29.0 30.4
3 30.4 30.2
Univariate time series prediction for next
24hrs maximum and minimum daily
temperature studied.
Multivariate time series prediction with
forecasting of weather parameters for
next 24hrs, 48hrs,72hrs,96 hrs in
process.