## 3 DBN for Time Series Forecasting  
Machine learning modelling based on DBN has emerged as a technique to improve measurement data. DBNs are deep neural network models comprising of multiple layers of hidden nodes representing latent variables for detecting features extracted from the original multi-dimensional input data [38]. These models can be trained in a generative unsupervised manner where the model learns to probabilistically reconstruct the inputs from abstracted features extracted at each layer [38]. Following this learning step the DBN can be further trained as a discriminative supervised learning model to perform classification or time series prediction. There are three main reasons for using DBN as follows: They take numerous non-linear hidden layers, have the ability to be pre-trained in an unsupervised manner and allow the hidden state to be factored in an arbitrary way. The traffic prediction algorithm is designed based on current and historical traffic flows data derived from a database of RSUs. We propose a strategy that predicts the activity time for every one of the 5 highways links over a brief time horizon in a transportation network which comprises of two stages: (1) traffic time information fulfilment and (2) Short-term traffic flow forecasting. In stage 1, trip distribution estimation is derived from the TP matrix to create traffic time information at each link based on demand and recorded information in the initial TP matrix. In stage 2, we utilize the traffic volume data at each link produced from stage 1 to anticipate traffic flow recursively by a network using two RBMs by adjusting in historical information to account for unpredictable changes. In this study, we designed a three-layer DBN constructed by using two stacked RBMs [25,26] to propose the traffic flow time series prediction model. When high dimension data are input to the units of visible layer of an RBM, the units in the RBM's hidden layer detects the feature of data among different classes according to the connection weights. The connection of units of RBM is restricted to different layers, which means that no connections exits between the units of same layer, so the paired layers are termed as a restricted Boltzman machine. When the hidden layer of one RBM is used as a visible input layer for a second RBM, the second RBM's hidden layer determines \"the feature of features\" of the original input data. Therefore, the two stacked RBMs are able to determine a restricted set of features derived from the original higher dimensional input parameters. In the initial step of the training process, the data units for each layer are set randomly to values of 0 or 1. For training the algorithm we randomly selected 30 training instances and evaluated the model on 30 test instances respectively. The weights \(w_{ij}\) among data units for each layer are set to values between 0 and 1. There is no connections between units of each layer of RBMs. The input units \(v_{i}\) of visible layer of RBMs are shown as \(x(t-\alpha),\ x(t-2\alpha),\ldots,\ x(t-n\alpha)\) for input data \(x(t)\), \(t=1,2,3,\ldots,T\). We calculate the expectation of data by \(p_{ij}^{data}=\left\langle x(t-i\alpha)h_{j}\right\rangle\). Then, we calculate the expectation for reconstruction by \(p_{ij}=\left\langle v_{i}h_{j}\right\rangle\), where \(h_{j}\) refers to the values of unites in the hidden layer of the RBM, \(\alpha\) is a positive integer and \(v_{i}\) is the binary state of input \(x(t)\), \(i=1,2,3,\ldots,\ n\) where \(n\) is defined as the dimension of the input data which shows the number of units on visible layer of RBMs. After this initial step, the weights \(w_{ij}\) should be updated by \(\Delta w_{ij}=\beta(p_{ij}^{data}-p_{ij})\), where \(\beta\) is a rate of learning (0 \(<\beta<\) 1). The hidden layer of first RBM then feeds in as the visible layer of second RBM.