1 of 22

Project Plan

Auto regression Forecast Model for Electricity Production

Farchan Hakim, Milzam Wafi, Adventus Ridwan

Computer Science and Information Engineering

National Central University

Taiwan

2 of 22

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 %.

3 of 22

Motivation

Impact

  • Increased costs due to excess electricity production
  • Global Warming
  • Electricity becomes scarce

4 of 22

Process

5 of 22

Data Source

Electricity Production Forecast (KAGGLE)

  • This archive contains 400 measurements .
  • From January, 1 1085 until January, 1 2018

  • Id – a sequence number
  • Date – a data collection per month
  • Power (MW) – a result of electricity production

Attribute

Example of the data

6 of 22

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.

7 of 22

Data Exploratory

Checking Stationarity

Mean of data : 77.497

Variance of data : 123.226

8 of 22

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.

  • Null Hypothesis: Time Series is non-stationary. It gives a time-dependent trend.�Alternate Hypothesis: Time Series is stationary. In another term, the series doesn’t depend on time.
  • ADF or t Statistic < critical values: Reject the null hypothesis, time series is stationary.
  • ADF or t Statistic > critical values: Failed to reject the null hypothesis, time series is non-stationary.

9 of 22

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.

10 of 22

Explore-Autocorrelation Analysis

CHOOSE THE BEST ARIMA MODEL ?

Explore Data

11 of 22

Explore-Autocorrelation Analysis

 

12 of 22

ARIMA Model

  • ARMA
    • ARIMA(p, 0,q)

  • ARIMA
    • ARIMA(p, d,q)

  • AR (Autoregressive model)
    • ARIMA(p, 0,0)

  • MR (Moving Average model)
    • ARIMA(0, 0,q)

13 of 22

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.

14 of 22

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

15 of 22

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

16 of 22

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

17 of 22

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.

18 of 22

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

19 of 22

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

20 of 22

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 pd, 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

21 of 22

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

  • Analyze the electricity production
  • Predict and estimate electricity production
  • Determine polices based on data to reduce electricity production

Suggestion Next Project

22 of 22

No. 300, Zhongda Rd, Zhongli District, Taoyuan City, 320

Phone: 03 422 7151