Project Plan
Auto regression Forecast Model for Electricity Production
Farchan Hakim, Milzam Wafi, Adventus Ridwan
Computer Science and Information Engineering
National Central University
Taiwan
Motivation
Electricity is an important element in human life.
Household is one of the most consumers of electricity in the world.
Kitchen, microwave, water-heater, air-conditioner, etc. need electricity as the main power source.
World Energy Council, the global average of household electricity is 3.500kWh or year ( increase 4-8 % / year).
survey (RECS), air conditioning (AC) as the highest consumption reaching 17 %.
Motivation
Impact
Process
Data Source
Electricity Production Forecast (KAGGLE)
Attribute
Example of the data
Data Exploratory
Rolling Statistic
The first thing to do in any data analysis task is to plot the data. Graphs enable many features of the data to be visualized, including patterns, unusual observations, changes over time, and relationships between variables. The features that are seen in plots of the data must then be incorporated, as much as possible, into the forecasting methods to be used.
Data Exploratory
Checking Stationarity
Mean of data : 77.497
Variance of data : 123.226
Data Exploratory
Augmented Dickey-Fuller Test
Augmented Dickey-Fuller Test is a common statistical test used to test whether a given time series is stationary or not. We can achieve this by defining the null and alternate hypothesis.
Data Exploratory
Augmented Dickey-Fuller Test
ADF Statistic: -2.257
p-value: 0.186
##################################
Critical Values:
1%: -3.448
5%: -2.869
10%: -2.571
##################################
ADF > Critical Values
Failed to reject null hypothesis, time series is non-stationary.
The p-value is obtained is greater than significance level of 0.05 and the ADF statistic is higher than any of the critical values.
Clearly, there is no reason to reject the null hypothesis. So, the time series is in fact non-stationary.
Explore-Autocorrelation Analysis
CHOOSE THE BEST ARIMA MODEL ?
Explore Data
Explore-Autocorrelation Analysis
ARIMA Model
ARIMA Model
How to find out the data is correlated with p
PACF
It can be imagined as the correlation between the series and its lag
Lags = 365
Lags = 20
Note: Cross correlation presents a technique for comparing two time series and finding objectively how they match up with each other, and in particular where the best match occurs. The lag refers to how far the series are offset, and its sign determines which series is shifted.
ARIMA Model
How find out the data is correlated with q
ACF
tells how many MA terms are required to remove any autocorrelation in the stationaries series
Lags = 365
Lags = 20
ARIMA Model
Result | Model |
ACF dying down, PACF cut off | AR MODEL |
ACF cutt off, PACF dying down | MA MODEL |
ACF dying down, PACF dying down Followed by oscilation | Combination of AR and MA - ARIMA |
ARIMA Model
Result | Model |
ACF dying down, PACF cut off | AR MODEL |
ACF cutt off, PACF dying down | MA MODEL |
ACF dying down, PACF dying down | Combination of AR and MA - ARIMA |
ACF & PACF
Autocorrelation and partial autocorrelation plots are heavily used in time series analysis and forecasting.
These are plots that graphically summarize the strength of a relationship with an observation in a time series with observations at prior time steps.
Forecasting Models
Let’s say that we want to develop a model to predict the last 10 days of electric production in the dataset given all prior observations. The simplest model that we could use to make predictions would be to persist the last observation. We can call this a persistence model and it provides a baseline of performance for the problem that we can use for comparison with an auto regression model.
Persistence Model
Persistence MSE : 0.0084
Forecasting Models
An autoregression model is a linear regression model that uses lagged variables as input variables.
We could calculate the linear regression model manually using the LinearRegession class in scikit-learn and manually specify the lag input variables to use.
Alternately, the statsmodels library provides an autoregression model where you must specify an appropriate lag value and trains a linear regression model. It is provided in the AutoReg class.
Auto regression Model
AR MSE : 0.0211
MA MSE : 0.0117
Forecasting Models
The statsmodels library provides the capability to fit an ARIMA model.
An ARIMA model can be created using the statsmodels library as follows:
1. Define the model by calling ARIMA() and passing in the p, d, and q parameters.�2. The model is prepared on the training data by calling the fit() function.�3. Predictions can be made by calling the predict() function and specifying the index of the time or times to be predicted.
Let’s start off with something simple. We will fit an ARIMA model to the entire Electric Production dataset.
ARIMA Model
ARIMA MSE : 0.0019
Conclusion
Comparing the result forecasting model using Persistence Model, Auto regression Model, and ARIMA Model, we have conclusion the best forecasting is using ARIMA Model. Hopefully using this forecasting can predict and estimate electricity production.
ARIMA MSE : 0.0019
Suggestion Next Project
No. 300, Zhongda Rd, Zhongli District, Taoyuan City, 320
Phone: 03 422 7151