Forecasting Methods in Various Applications Using Algorithm of Estimation Regression Models and Converting Data Sets into Markov Model
Algorithm 1
Algorithm of estimation regression models (AERMs).
(1)
Input n “n is the number of elements in the sample.”
(2)
Input M “where M > 4 is the total number of data points for the element (i).”
(3)
For i = 1 to n.
(4)
let Q = M : r = 1.
(5)
For j = r to M.
(6)
For k = 4 to 2 Step 1 “k is the number of data points.”
(7)
If k ≤ Q then read k points (Xj, Yj) from data.
(8)
Estimate the model of nonlinear regression form the determinant:
(9)
Compute R-square (R2), the total sum of squares (SST), the regression sum of squares (SSR), and the error sum of squares (SSE) from: . is the estimated value from the equation by the determinant in the Step 8, and Yj is the actual data of the element (i).
(10)
If R2 ≥ 0.95 then: {print the equation in Step 8, r = r + k, Q = Q − r + 1, Return to the loop in Step 5}, else: Return to the loop in Step 6 where k will be equal to k − 1.
(11)
When k = 2, estimate the simple linear regression equation similarly as in the determinant of Step 8. As well r = r + k, Q = Q − r + 1 then return to Step 5.
(12)
If r = M or Q = Q − M + 1 then: {Return to the loop in the Step 3 and move to the next element (i + 1)}.
(13)
The algorithm ends after the loop in Step 3 has finished; thus, all prediction equations are obtained for all elements in the given sample.