0% found this document useful (0 votes)
22 views12 pages

Berl2244_Forecast_Lab2_23

Uploaded by

Samz Adrian
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views12 pages

Berl2244_Forecast_Lab2_23

Uploaded by

Samz Adrian
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

FAKULTI TEKNOLOGI KEJURUTERAAN

ELEKTRIK DAN ELEKTRONIK


UNIVERSITI TEKNIKAL MALAYSIA MELAKA

TECHNOLOGY OPERATION MANAGEMENT

BEEL2244 SEMESTER 2 SESI 2023/2024

LAB 2: FORECAST

NO. STUDENTS' NAME MATRIC. NO.

1.

2.

3.

PROGRAMME BEEL

SECTION /
GROUP

DATE

1. ZULHAIRI OTHMAN
NAME OF
INSTRUCTOR(S)
2.

EXAMINER’S COMMENT(S) TOTAL MARKS

1
Rev Date Author(s) Description
.
No.
1. Zulhairi Othman 1. New online lab
1.0 10
APRIL
2023

1.
2.

2
1. INTRODUCTION

Time series forecasting is a method to make predictions based on historical time series data.
Examples of time series analysis are weather data, heart rate monitoring (EKG), quarterly
sales data and stock prices.

2. OBJECTIVE

 To generate simple moving average forecast and chart using Excel average function
and data analysis tool
 To generate exponential smoothing forecast and chart using Excel data analysis tool for 2
smoothing constants

3. PROCEDURE

Problem 1.1: Moving Average using Average() Formula

a) Start Microsoft Excel software.


b) The sales data for this problem is as shown in Table 1.1.
Table 1.1: Monthly Sales Data
Month Sales
Jan 3240
Feb 2987
Mar 3740
Apr 4160
May 3809
Jun 3719
July 3480
Aug 3764
Sep 3389
Oct 4442
Nov 4029
Dec 3854

c) Copy or create Table 1.1 in your Excel Sheet1.


d) Then create a new sheet – Sheet2.
e) Rename Sheet2 as ‘MA’ as in Figure 1.2. Rename Sheet1 as ‘Data’
f) Copy Table 1.1 in Sheet1 and ‘Paste Link’ it into Sheet2. Format the table on Sheet2
with borders or ‘fill’ or any format to make it look nice.
Inserting a Function
g) Add a column next to ‘Sales’ column in Sheet2 with header ‘3 MA’ as in Table 1.2.
h) The 3 MA column will calculate and display 3 months simple moving
average forecast using the equation:

3
𝐴𝑡−𝑛 + ⋯ + 𝐴𝑡−𝟐𝟐 + 𝐴𝑡−𝟑𝟑 + 𝐴𝑡−𝟐𝟐 +
𝐹𝑡 = 𝑀𝐴𝑛 = 𝐴𝑡−𝟏𝟏
= 𝐴𝑡−𝟏𝟏
𝑛
𝟑𝟑
One calculation technique is to insert an Excel function ‘=SUM(B2:B4)/3’ in cell C4.

Figure 1.2: Monthly Sales Data with 3 MA Column

i) But for this problem, you are going to use another function: in the 4th row e.g. cell
C6 in Figure1.2, type ‘=AVERAGE(B3:B5)’ as in Figure 1.2 – which is the same
equation as using ‘=SUM(B3:B5)/3’.
j) For video reference, you can click this YouTube tutorial – but it shows a 4 period
moving average instead.
k) Copy and paste this function to other cells – for example from C6 until C15.
l) Now change the number format of the Sales and 3 MA data to Currency with
2 decimal places.

Calculating Errors
m) To calculate forecast errors MAD, MSE and MAPE, make the following columns
next to column ‘3 MA’ as in the YouTube tutorial: Error, |Error|, Error2 and % Error –
as in the YouTube tutorial video.
n) In column ‘Error’, calculate the difference between Sales and 3 MA values.
o) In column ‘|Error|’, use function ‘=abs()’ to force negative values to be positive.
p) In column ‘Error2’, use ‘^2’ to square numbers.

4
q) In column ‘% Error’, divide numbers in column ‘|Error|’ by Sales. Then change
its number format to ‘Percentage’ by right-clicking the cell, select Format Cells…,
Number and then Percentage.
r) To calculate mean absolute deviation MAD, MSE and MAPE, add these error
names under the chart and then calculate the average of the respective errors as in
Figure 1.3.

Figure 1.3: Inserting MAD, MSE and MAPE errors

Creating a Chart
s) Select the whole data set – from Month to 3 MA.
t) In the main menu, click Insert > Charts > 2D Line chart icon.

u) Then choose 2D Line chart. Don’t forget to add the chart title appropriately.

Calculating 5 month Moving Average


v) Copy the whole table you have created and paste it underneath that table.
w) You need to paste link the ‘Month’ and ‘Sales’ from your Data sheet for this
new table.
x) Change the column name of 3 MA to 5 MA in the new pasted table.
y) Change the formula in Excel accordingly.
z) Which moving averages have bigger errors for our Sales data – 3 MA or 5 MA?

5
Problem 1.2: Moving Average using Data Analysis

a) Copy and paste link the table in Table 1.1 in your Data sheet to another Excel sheet.
Rename the new sheet ‘MA DA’. DA stands for Data Analysis that will overwrite
cells next to this table.
b) Before starting with this analysis, check if your Excel already have ‘Data
Analysis’ available as below. Click Data in the main menu:

c) If the Data Analysis tool is not shown in your Excel, activate this tool by following
the steps in the appendix on the last page of this lab sheet. Once this tool is activated,
go to the next step below.

3-month Moving Average


d) In the main menu, select Data > in Analysis area > Data Analysis.
e) In the Data Analysis dialog box, select Moving Average and click OK.

6
f) In the Moving Average dialog box, enter the Input Range – which is the Sales data. If
you select the cell with text ‘Sales’ as well, put a tick on Labels in First Row. The

‘Interval’ is number of data used to calculate moving average. Since we are


calculating 3-month MA, set the interval to 3.
g) Next for the Output Range, select the column you want the calculate average to be
displayed (for example, the column starting from C21 to C33).
h) Then click on Chart Output to display the chart and click on Standard Errors
to display the calculated forecasting errors.
i) Data Analysis tool should display the same forecast as in Problem 1.1 with addition of
square root of squared error (Standard Errors). It also generates the output chart
almost similar to the chart in Problem 1.1.

*Note: in our lecture slide, forecast value for 3-month moving


average is placed next to the 4th data (which is at excel cell C5).
However, in MS Excel Moving Average data analysis, the first
forecast is placed next to the 3rd data
– which is cell C4.

5-month Moving Average


a) For 5-month moving average forecast, select again Data > in Analysis area > Data
Analysis. Again choose Moving Average in the Data Analysis dialog box.

7
b) In the Moving Average dialog box, the input range is the same as for 3-month
moving average. But the interval is 5.

c) For the output range, set it next to standard error of the 3-month moving average data
as was calculated above. For example, set it to cell E21 until E32 if your table is as in
Figure 1.2 below:

Figure 1.2: Example of Table for Moving Average Data Analysis


For your table, add appropriate column headers (or series name – as Excel called it)
and other formats that you like.

d) Check the Standard Errors but we don’t need the Chart Output. You are going
to insert a 2D chart with 3-month and 5-month MA as below.

Creating a Chart
e) There are several ways to display the 3-month and 5-month forecast data on the same
2D line chart. The technique below create Sales and 3-month MA chart first and then
edit into the chart the 5-month MA forecast.
f) For video reference, click this YouTube multiple line plot tutorial.
g) First select the whole data set that include Month, Sales and 3-month MA – for
example from A20 to C32 as in Figure 1.2.
h) Next in the main menu, click Insert > in Charts area > 2D Line chart icon.

8
i) Then click on your chart so that it is highlighted and select Design in the main
menu and click on the Select Data icon in the toolbar.

You can also right-click on your chart and choose Select Data.
j) To add the 5-month MA data in Select Data Source dialog box, click on Add
under Legend Entries (Series).

k) In the Edit Series dialog box, select the Series name – which is the column header
for your 5-month MA (e.g. cell E20 in Figure 1.2). Then select your Series values –
which is the 5-month MA data (e.g. cell E21 until E32).
Click OK.

l) Click OK in the Select Data Source dialog box to generate a chart that include all
3 line charts.
(If you want, you can rectify the Horizontal (Category) Axis Labels for the 5-month
MA. But it won’t affect your chart.)
m) On your chart, manually change the chart title to appropriate title.
n) You can also change your chart style by clicking on the chart style icon and
selecting the style you want.

9
In Your Lab Report…
o) Add proper table headers to your calculated forecast and error table and add proper
chart title.
p) Copy and paste the whole table to your report that shows Month, Sales, 3-month
MA and Error, 5-month MA and Error.
q) Then paste your moving average chart that display all 3 line charts.
r) Then add a short discussion below the chart – comparing the 3-month and 5-month
moving averages.

Problem 1.3: Exponential Smoothing

a) Copy and paste the table in Table 1.1 to another Excel sheet. Rename this
sheet ‘SES’ – for simple exponential smoothing.
b) You will generate 2 exponential smoothing forecasts using Excel’s Data Analysis
with smoothing constants α = 0.3 and α = 0.7.
The technique is the same as in Problem 1.2 above.

Smoothing constants α = 0.3


c) Similarly as in problem 1.2, click on Data Analysis but this time choose
Exponential Smoothing in the dialog box.
d) Enter your input range, output range and click on Standard Errors.
e) Excel exponential smoothing calculation use Damping factor instead of

𝐷𝑎𝑚𝑝𝐷𝐷𝑛𝑔 𝑓𝑓𝑎𝑐𝑡𝑜𝑟 = 𝑆𝑚𝑜𝑜𝑡ℎ𝐷𝐷𝑛𝑔 𝑐𝑜𝑛𝑠𝑡𝑎𝑛𝑡 − 1 = 𝛼 − 1


smoothing constant. The relation is:

f) So for α = 0.3, damping factor is set at 0.7.


g) Click OK to generate the forecast.

Smoothing constants α = 0.7

10
h) Similarly as in problem 1.2, click on Data Analysis and choose Exponential
Smoothing in the dialog box.
i) Enter your input range, new output range and click on Standard Errors.
j) Set the appropriate damping factor for α = 0.7.
k) Click OK to generate the forecast.

Creating a Chart
l) Similarly as in problem 1.2, create one proper chart that display sales, forecast for α =
0.3 and α = 0.7.

In Your Lab Report…


m) Add proper table headers to your calculated forecast and error table and add proper
chart title.
n) Copy and paste the whole table to your report that shows Month, Sales, α = 0.3 and α
= 0.7 with errors.
o) Then paste your exponential smoothing chart that display all 3 line charts.
l) Then add a short discussion below the chart – comparing α = 0.3 and α = 0.7
exponential smoothing forecasts. Which exponential simple exponential smoothing
is a better forecast for our Sales data – α = 0.3 or α = 0.7?

11
4. APPENDIX

Activating Excel Data Analysis


(From https://exceltable.com/en/analyses-reports/regression-correlation-
analysis#analys)

a) Push the menu button «FILE», then «Options».


b) In the Excel Options window, select « Add-Ins ».
c) Below the drop-down list in the «Manage:» field is the inscription
«Excel Add-Ins» (if it is not, click on the checkbox to the right and
select).
d) And click the «Go» button. Hit.

e) In the Add-Ins window, you’ll see the list of


available add-ins. Select the «Analysis
ToolPak» and click OK.
f) After activating the superstructure will
be available on the «DATA» tab.

Figure 4.1: Data Analysis becomes available

12

You might also like