# A Predictive Method for Temperature Based on Ensemble EMD with Linear Regression
## 2 Ensemble EMD with LR Related Works
### Gradient Descent  
The purpose of gradient descent is to find the minimum value of the cost function. The cost functions primarily include the mean squared error (MSE), the calculation formula for which is shown in Equation (10), and the cross-entropy loss (CEL) function, which is shown in Equation (20). The mean squared error is commonly employed to measure the error between predicted values and true values in prediction tasks. The CEL is frequently employed to measure the error between predicted probabilities and true labels in classification tasks. \[L=\sum_{i=1}^{n}\sum_{k=1}^{m}\left(y_{k}log\widehat{y_{k}}\right) \tag{20}\]  
where \(\widehat{y_{k}}\) represents the predicted probability, \(y_{k}\) represents the true label, \(m\) denotes the quantity of categories, and \(n\) denotes the quantity of samples. Suppose that there is a function \(z=f(x,y)\) that is defined in a neighborhood \(U(P)\) of point \(P(x,y)\). From point \(P\), let us draw a ray \(l\). If the limit shown in Equation (21) exists, it is called the directional derivative of point (\(x,y\)) along the direction of \(l\), and is denoted by \(\partial f/\partial l\). \[\frac{\partial f}{\partial l}=\lim_{\Delta x\to 0,\Delta y\to 0}\frac{f(x+\Delta x,y+\Delta y)-f(x,y)}{ \sqrt{\left(\Delta x\right)^{2}+\left(\Delta y\right)^{2}}} \tag{21}\]  
Clearly, numerous rays, \(l\), can be found, which indicates that there are infinite directional derivatives. However, the focus is typically on the maximum one, which signifies the direction in which the function changes the fastest; this is what is commonly referred to as the gradient. The derivative of the loss function is the focal point of attention. The direction of the smallest negative gradient of the loss is the quickest path to reduction. If this direction is optimized, the loss decreases even faster. Sometimes, it is not necessary for the line fitted through a large set of data to pass through the origin. In such cases, an additional parameter \(\theta\) needs to be introduced. Consequently, the graph of \(l(\theta_{0},\theta_{1})\) forms a surface. Gradient descent can be imagined as descending a mountain, as shown in Figure 3. How do you descend from a high mountain to its base as quickly as possible? The answer is to start from any position, find the steepest direction at that point, walk a distance along that direction, and then, at each step, reassess the steepest direction at the current position. Continue this process, walking along the newly identified direction, to descend to the base of the mountain as quickly as possible. During this descent, it is crucial to confirm the steepest direction at each step. The key lies in determining the \"steepest direction,\" with the direction of the largest gradient indicating the steepest descent direction. Figure 3: Gradient descent process diagram. During the descent down the mountain, at each step, a new direction needs to be determined. Constantly determining new directions implies that the parameters of the cost function are continuously changing. To obtain new parameters, it is necessary to update them based on the known old parameters. This requires repeatedly updating the parameters, a process known as batch gradient descent, as shown in Equations (22)-(24). \[h_{\theta}(x)=\theta_{0}+\theta_{1}x \tag{22}\]  
\[J(\theta_{0},\theta_{1})=\frac{1}{2n}{\sum_{i=1}^{n}}(h_{\theta}(x^{i})-y^{i} )^{2} \tag{23}\]  
\[\theta_{i}\coloneqq\theta_{i}-\alpha\frac{\varphi}{\varphi\theta_{i}}J(\theta _{0},\theta_{1}) \tag{24}\]  
where \(\alpha\) is the learning rate, determining how large the steps are that are taken during the descent. The purpose of the derivative \(\varphi/(\theta_{0},\theta_{1})/\varphi\theta_{i}\) is to determine the direction of the descent. The \(\theta_{i}\) on the right side is the old parameter, while the \(\theta_{i}\) on the left side is the new parameter. At each step (each iteration), a new parameter needs to be determined, and only by updating the parameters can the direction for the next step be determined.