Top Banner
1 FYP 1 REPORT TITLE : CRIPS STOCK FORECAST SYSTEM USING LEAST SQUARE METHOD (CASE STUDY: USAHA GIGIH ENTERPRISE COMPANY) NAME : MUHAMMAD HAFIZZUDDIN BIN NASRUDDIN MATRIC NO : BTAL 15039528 PROGRAMME : BACHELOR OF COMPUTER SCIENCE ( SOFTWARE DEVELOPMENT ) SUPERVISOR : EN. ABD. RASID BIN MAMAT
47

FYP 1 REPORT - myfik.unisza.edu.my · fyp 1 report title : crips stock forecast system using least square method (case study: usaha gigih enterprise company) name : muhammad hafizzuddin

Oct 10, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: FYP 1 REPORT - myfik.unisza.edu.my · fyp 1 report title : crips stock forecast system using least square method (case study: usaha gigih enterprise company) name : muhammad hafizzuddin

1

FYP 1 REPORT

TITLE :

CRIPS STOCK FORECAST SYSTEM USING LEAST SQUARE METHOD

(CASE STUDY: USAHA GIGIH ENTERPRISE COMPANY)

NAME : MUHAMMAD HAFIZZUDDIN BIN NASRUDDIN

MATRIC NO : BTAL 15039528

PROGRAMME : BACHELOR OF COMPUTER SCIENCE

( SOFTWARE DEVELOPMENT )

SUPERVISOR : EN. ABD. RASID BIN MAMAT

Page 2: FYP 1 REPORT - myfik.unisza.edu.my · fyp 1 report title : crips stock forecast system using least square method (case study: usaha gigih enterprise company) name : muhammad hafizzuddin

2

ABSTRACT

Usaha Gigih Enterprise is a small industrial company that produce many type of

chips. Technological advancement towards Industrial Revolution 4.0 provides an idea

to help this company grow its business using modern technology. Usaha Gigih

Enterprise manages its business manually like most other small businesses. Basically,

this company runs a crips business for supplying to buyers. The process involved in this

business is the sale of crips and record the inventory of crips.

Due to the fact that this business process is being run manually, it is difficult for

the company to run the data recording process. Businesses need to record every stock

inventory that has been produced and also record the sales and orders from customers.

The company is difficult to estimate the amount in producing each product for each

month. Product revenue estimates are the main thing in the company to avoid excessive

production and ensure the supply is always sufficient in meeting customers' needs.

To overcome the problems faced, there are techniques that can be implemented

to assist the company's business operations. The methods and techniques that can be

used to solve the problem are by using time series modeling that is data with a pattern

or trend. There are two stages in time series modelling that is Univariate Forecasting

for one variable and Multivariate Forecasting for many variables. This project will use

Univariate Forecasting because it will forecast one variable from trend alone in

forecasting techniques. It will predict the amount of production that must be produced

by the company with the appropriate quantity and be able to avoid excess or deficiency

in production.

Page 3: FYP 1 REPORT - myfik.unisza.edu.my · fyp 1 report title : crips stock forecast system using least square method (case study: usaha gigih enterprise company) name : muhammad hafizzuddin

3

Table of Contents

ABSTRACT .............................................................................................................................. 2

CHAPTER 1 ............................................................................................................................. 5

1.1 Background............................................................................................................... 5

1.2 Problem Statement ................................................................................................... 7

1.3 Objective ................................................................................................................... 8

1.4 Scope .......................................................................................................................... 8

1.1 Admin .................................................................................................................... 8

1.2 Staff ....................................................................................................................... 9

1.3 Customer ............................................................................................................... 9

1.5 Implementing and Planning .................................................................................. 10

1.6 Limitation of Works ............................................................................................... 12

1.7 Expected Result ...................................................................................................... 12

CHAPTER 2 ........................................................................................................................... 13

2.1 Introduction .................................................................................................................. 13

2.2 Related Research Techniques and Tools .................................................................... 14

2.3 Least Square Method ................................................................................................... 17

2.4 Summary ....................................................................................................................... 19

CHAPTER 3 ........................................................................................................................... 20

3.1 Introduction .................................................................................................................. 20

3.2 Spiral Model ................................................................................................................. 21

3.3 Methodology Phase ...................................................................................................... 22

3.3.1 Initial Planning Phase ........................................................................................... 22

3.3.2 Planning Phase ...................................................................................................... 22

3.3.3 Analysis and Design Phase ................................................................................... 23

3.3.4 Implementation Phase .......................................................................................... 24

3.3.5 Testing Phase ......................................................................................................... 24

3.3.6 Deployment and Evaluation Phase ...................................................................... 24

3.4 Hardware and Software Requirement ....................................................................... 25

3.4.1 Hardware Requirement ........................................................................................ 25

3.4.2 Software Requirement .......................................................................................... 26

3.5 Trend Analysis.............................................................................................................. 27

3.5.1 Linear Trend ......................................................................................................... 27

3.5.2 Estimation of Trend Analysis by Least Square Method ............................. 28

3.5.3 Example data and calculation ....................................................................... 29

Page 4: FYP 1 REPORT - myfik.unisza.edu.my · fyp 1 report title : crips stock forecast system using least square method (case study: usaha gigih enterprise company) name : muhammad hafizzuddin

4

3.6 Context Diagram .......................................................................................................... 32

3.7 Data Flow Diagram ...................................................................................................... 33

Data Flow Diagram Level 0 ........................................................................................... 33

Data Flow Diagram Level 1 ........................................................................................... 36

3.8 Entity Relationship Diagram ...................................................................................... 39

3.9 Data Dictionary ............................................................................................................ 40

1. Table user................................................................................................................ 41

2. Table staff ............................................................................................................... 41

3. Table customer ....................................................................................................... 42

4. Table address .......................................................................................................... 42

5. Table chips .............................................................................................................. 43

6. Table purchase ....................................................................................................... 43

7. Table order ............................................................................................................. 44

8. Table payment ........................................................................................................ 44

9. Table chipsmanagement ........................................................................................ 45

REFERENCES ....................................................................................................................... 46

Page 5: FYP 1 REPORT - myfik.unisza.edu.my · fyp 1 report title : crips stock forecast system using least square method (case study: usaha gigih enterprise company) name : muhammad hafizzuddin

5

CHAPTER 1

INTRODUCTION

1.1 Background

Crips refer to a kind of snack that is cut thin and fried until crisp. Crips are made

from various materials and named according to the type of material used to produce the

crips. Most crips companies are located in the village area and business processes have

been conducted traditionally or manually. Usaha Gigih Enterprise is a small industrial

company that produces many types of crips. Technological advancement towards

Industrial Revolution 4.0 provides an idea to help this company grow its business using

modern technology.

Page 6: FYP 1 REPORT - myfik.unisza.edu.my · fyp 1 report title : crips stock forecast system using least square method (case study: usaha gigih enterprise company) name : muhammad hafizzuddin

6

Usaha Gigih Enterprise manages its business manually like most other small

businesses. Basically, this company runs a crips business for supplying to buyers. The

process involved in this business is the sale of crips and record the inventory of chips.

In this system, it is proposed to use the least square method forecasting technique to

predict the amount of production that needs to be produced based on current trends.

Page 7: FYP 1 REPORT - myfik.unisza.edu.my · fyp 1 report title : crips stock forecast system using least square method (case study: usaha gigih enterprise company) name : muhammad hafizzuddin

7

1.2 Problem Statement

1.2.1 Management of crips order system

Customers need to book directly from the factory or by contacting the

company's operators via telephone. Booking by phone will cause the customer

to be confused with the booking. The potential loss of reservation information.

The manual method employed by Gigih Enterprise Company by recording the

booking information in the booklet will potentially lost information while

booking through the phone will cause the company's manager to be misled and

misinformed by the customer.

1.2.2 Difficulties in estimates production of crips

The increase in orders every month will affect the production of the

product. The company needs product information that is a customer's favorite.

At the same time, they need an effective method of identifying customers'

favorite products. Based on product sales data on a monthly basis, the company

also needs a method to get an estimate of the exact amount of product produced

in order to avoid excessive or lack of production in producing the product so

that it can always meet customer demand.

Page 8: FYP 1 REPORT - myfik.unisza.edu.my · fyp 1 report title : crips stock forecast system using least square method (case study: usaha gigih enterprise company) name : muhammad hafizzuddin

8

1.3 Objective

1.3.1 To design a process flow, structure of user interface and database from the Crips

Stock Forecast System (CSFoS).

1.3.2 To develop a system that can manage the user order and forecast stock of crips

1.3.3 To test the capabilities of the Crips Stock Forecast System (CSFoS) and generate

the report to the user.

1.4 Scope

The scope is important to set a boundary on what the area will cover in the

system development. Thus CSFoS using Least Square Method is focused on online and

walk in purchase by customer to Usaha Gigih Enterprise premise. The forecast will be

produced using the sales data collected from online order dan walk in purchased.

Forecasting will generate the expected stock will be produced on the next month.

Scope of this system is Admin, Staff and Customer of Usaha Gigih Enterprise.

1.1 Admin

1.1.1 Login

1.1.2 Manage Profile

1.1.3 Manage Stock

1.1.4 Cash Purchase

1.1.5 Manage Stock Prediction

1.1.6 View Report

Page 9: FYP 1 REPORT - myfik.unisza.edu.my · fyp 1 report title : crips stock forecast system using least square method (case study: usaha gigih enterprise company) name : muhammad hafizzuddin

9

1.2 Staff

1.2.1 Login

1.2.2 Manage Profile

1.2.3 Manage Stock

1.2.4 Cash Purchase

1.2.5 View Report

1.3 Customer

1.3.1 Login

1.3.2 Manage Profile

1.3.3 Order

1.3.4 Payment

1.3.5 View Report

Page 10: FYP 1 REPORT - myfik.unisza.edu.my · fyp 1 report title : crips stock forecast system using least square method (case study: usaha gigih enterprise company) name : muhammad hafizzuddin

10

1.5 Implementing and Planning

Using a Gantt Chart that describes key of activities and timescales involves in

implementing this project as shown in Table 1.1

Table 1.1 : Gantt Chart

No Task Week

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

1 FYP Briefing

2 Project Title Proposal

and Registration

3 Proposal Writing

(Introduction)

4 Proposal Writing

(Literature Review)

5 Proposal Progress

Presentation and

Evaluation

6 Discussion and

Correction of the

Proposal

7 Proposed Solution –

Methodology

8 Proof of Concept

Page 11: FYP 1 REPORT - myfik.unisza.edu.my · fyp 1 report title : crips stock forecast system using least square method (case study: usaha gigih enterprise company) name : muhammad hafizzuddin

11

9 Seminar Preparation –

Project Poster and

Slide

10 Seminar Registration

– Project Poster and

Slide

11 Seminar Presentation

and Evaluation

12 Finalizing Report of

the Proposal

13 Final Report

Submission and

Evaluation

Page 12: FYP 1 REPORT - myfik.unisza.edu.my · fyp 1 report title : crips stock forecast system using least square method (case study: usaha gigih enterprise company) name : muhammad hafizzuddin

12

1.6 Limitation of Works

This system only involves customer in order crips process and staff in

managing the order and stock. From this system, only admin is allowed to view the

stock prediction and make a forecasting in order to make a new stock production.

1.7 Expected Result

The expected results of the project are facilitating the each party-

CUSTOMER, ADMIN and STAFF in manage the crips order and view the prediction

of chips production. The system has been designed keeping in view the present and

future requirements in mind and made very flexible.

The goals that are achieved by the system are:-

1. Instant access

2. Improved productivity

3. Efficient management of records

4. Simplification of the operations

5. Less processing time and getting required information

6. User friendly and flexible for further enhancement

Page 13: FYP 1 REPORT - myfik.unisza.edu.my · fyp 1 report title : crips stock forecast system using least square method (case study: usaha gigih enterprise company) name : muhammad hafizzuddin

13

CHAPTER 2

LITERATURE REVIEW

2.1 Introduction

A literature review is a body of text that aims to review the critical point of

current knowledge and particular topic. In my research its related to the method on

forecasting. It is an evaluative report of studies found in the literature that related to my

selected area. In this chapter, the idea of previous research is compared to make clear

description of the least square method as an added value in this system. There are so

many methods that had been used in order to make an accurate forecasting but each

method are different approach for different business.

Page 14: FYP 1 REPORT - myfik.unisza.edu.my · fyp 1 report title : crips stock forecast system using least square method (case study: usaha gigih enterprise company) name : muhammad hafizzuddin

14

2.2 Related Research Techniques and Tools

A review of the research paper has been conducted to study on how others

implemented the least square method techniques into their system. As a result, a few

research papers have been found.

The first article is conduct by author [1], the research stated performance

evaluation of an organization at certain intervals helps to keep pace with the market.

For developing models to achieve better policy and planning results, forecast of sales

volume is a must. The objective of this study is to apply forecasting techniques to a

beverage production company and notice whether the forecast errors are irrationally

large and require an improvement in the statistical models and process of producing

these forecasts. Statistical time series modeling techniques like – Moving Average,

Simple Exponential Smoothing and Least Square methods are used for the study which

is compared with the value of actual sales volume and a large gap is found between

forecasted value and actual one. There are three forecasting models, namely, Winter’s,

decomposition, and Auto-Regressive Integrated Moving Average (ARIMA), were

applied to forecast the product demands and it is found that the decomposition and

ARIMA models provide lower forecast errors in all product groups which minimizes

the total overtime and inventory holding costs based on a fixed workforce level and an

available overtime.

Page 15: FYP 1 REPORT - myfik.unisza.edu.my · fyp 1 report title : crips stock forecast system using least square method (case study: usaha gigih enterprise company) name : muhammad hafizzuddin

15

The author [2] applied various statistical time series models to observe forecast

errors in the demand of juice production are within the expected limit and to select a

forecasting technique which has a less relative error. The author [2] showed that Least

Square Method is more accurate than the others. To forecast milk production in India

using statistical time series modeling- Double Exponential Smoothing and Auto-

Regressive Integrated Moving Average and concluded that ARIMA performed better

than the other one [3]. Next, the author [4] applied methods to forecast the demand for

products of a food industry, which directs its sales to the foodservice market, in order

to base the short to medium term production planning. The forecasts were evaluated

using the error measure MAPE and compared to the demand considered by the

company. Authors concluded that the HoltWinters method, which was applied in the

time series analyzed in their work, showed its effectiveness for forecasting demand of

products that present trend and seasonality patterns in sales history.

A hybrid forecasting model for nonlinear time series by combining ARIMA with

genetic programming (GP) to improve upon both the ANN and the ARIMA forecasting

models is proposed by [5], meanwhile [6] proposed a framework which serves as a

guide for practitioners when initiating and conducting long-term collaborative

forecasting partnerships. After reviewing the literature it has found that many works

have done on forecasting but sales forecasting of beverage product is in a very few

number.

Page 16: FYP 1 REPORT - myfik.unisza.edu.my · fyp 1 report title : crips stock forecast system using least square method (case study: usaha gigih enterprise company) name : muhammad hafizzuddin

16

The study conducted by [7], most manufacturing organizations are in a

continuous effort for increasing their profits and reducing their costs. Accurate sales

forecasting is certainly an inexpensive way to meet the aforementioned goals, since this

leads to improved customer service, reduced lost sales and product returns and more

efficient production planning. Especially for the food industry, successful sales

forecasting systems can be very beneficial, due to the short shelf-life of many food

products. Production needs a long-term forecast for planning the development of the

plant and equipment and a more detailed short-term forecast for arranging the

production plan. Marketing needs a view of the future market in order to plan its actions

and assess the impact of changes in the marketing strategy on sales volumes. Food

companies are more concerned with sales forecasting due to their special characteristics,

such as the short shelf-life of their products, the need to maintain high product quality

and the uncertainty and fluctuations in consumer demands.

The third article conducted by [4], supply chain activities planning and control

depend on accurate estimates of the volumes of products and services to be processed

and the estimates come as forecasts.

Time series analysis is very important in a wide range of applications, especially

when it comes to forecasting, and it encloses many different forecasting models.

However, it is necessary to determine which model best suits each [8]. Besides choosing

the best technique, the forecasting to be generated by the model chosen should be as

close to real as possible [9]. In other words, the errors of forecasting should be

minimized, so the production managers plan the production inattention to the market

and minimizing the costs.

Page 17: FYP 1 REPORT - myfik.unisza.edu.my · fyp 1 report title : crips stock forecast system using least square method (case study: usaha gigih enterprise company) name : muhammad hafizzuddin

17

2.3 Least Square Method

A time series is a sequence of data points, measured typically at successive times

spaced at uniform time intervals usually weekly, monthly, quarterly or yearly. An

analysis of past history can be used by management to make decisions, long term

forecasting and even planning. Time series forecasting employs various models to

predict future events based on past events.

The estimation of trend analysis can be use least square method as one of the

time series models. Least square method is a method of constructing a straight line

equation through data points to obtain the best fitting line.

This is the mathematical method of obtaining the line of best fit between the

dependent variable and an independent variable. In this, the sum of the square of the

deviations of the various points from the line of best fit is minimum or least. For straight

line,

𝑌′ = 𝑎 + 𝑏𝑡

where 𝑌′ is equal to forecast for period 𝑡 and 𝑡 is the number of time periods from 𝑡 =

0, 𝑎 is the value of y at 𝑡=0 (y – intercept ) and b is slope of the line.

(1)

Page 18: FYP 1 REPORT - myfik.unisza.edu.my · fyp 1 report title : crips stock forecast system using least square method (case study: usaha gigih enterprise company) name : muhammad hafizzuddin

18

The above process can be summarized as below. However, the coefficient

computation between parameters a and b can be calculated using the least-squares

method, which minimizes the sum of squared errors. Steps to forecast using linear line

are as shown below :

Step 1 : Compute parameter 𝑏

𝒃 =∑ 𝒕𝒀 − (∑ 𝒀) (𝜮𝒕) 𝒏⁄

𝜮𝒕𝟐 − (∑ 𝒕)𝟐 𝒏⁄

Step 2 : Compute parameter 𝑎

𝒂 =∑ 𝒀

𝒏− 𝒃 (∑

𝒕

𝒏)

Step 3 : Generate the linear trend line

𝒀′ = 𝒂 + 𝒃𝒕

Step 4 : To make a forecast for dependent variable 𝑌′, substitute the appropriate

value for the independent variable 𝑡 .

(2)

(3)

(1)

Page 19: FYP 1 REPORT - myfik.unisza.edu.my · fyp 1 report title : crips stock forecast system using least square method (case study: usaha gigih enterprise company) name : muhammad hafizzuddin

19

2.4 Summary

In conclusion, the selection of accurate technique is very important to make sure

that the system successfully implemented and achieved the objective. The selected

technique is least square method that can be able to predict the chips forecast correctly.

Based on the research study, it can be conclude that the least square method is suitable

for Chips Stock Forecast System Using Least Square Method.

Page 20: FYP 1 REPORT - myfik.unisza.edu.my · fyp 1 report title : crips stock forecast system using least square method (case study: usaha gigih enterprise company) name : muhammad hafizzuddin

20

CHAPTER 3

METHODOLOGY

3.1 Introduction

The methodology is the set of the complete guideline that includes the models

of tools to carry out activities in the Software Development Life Cycle (SDLC). Which

splitting the work into the phases of activity for better planning and management of the

system development.

Page 21: FYP 1 REPORT - myfik.unisza.edu.my · fyp 1 report title : crips stock forecast system using least square method (case study: usaha gigih enterprise company) name : muhammad hafizzuddin

21

3.2 Spiral Model

The methodology that will be used in Crips Stock Forecast System (CSFoS)

Using Least Square Method is Spiral Model. Spiral model is a combination of sequential

and prototype model. There are specific activities that are done in one iteration which

is spiral where the output is the small prototype of the large software. Thus, the same

activities are repeated for all the spirals until the whole software is built.

There are six phases involved in the spiral model which is initial planning phase,

planning phase, analysis and design phase, implementation phase, testing phase,

deployment and evaluation phase.

Figure 3.1 : Spiral Model

Page 22: FYP 1 REPORT - myfik.unisza.edu.my · fyp 1 report title : crips stock forecast system using least square method (case study: usaha gigih enterprise company) name : muhammad hafizzuddin

22

3.3 Methodology Phase

The explanation of each phase involves for developing Crips Stock Forecast

System (CSFoS) Using Least Square Method as below :-

3.3.1 Initial Planning Phase

At this phase, the process occurred is brainstorming the project idea and

proposed the title of the project. Then, Chips Stock Forecast System Using Least

Square Method Time Series Analysis and Forecasting was decided.

3.3.2 Planning Phase

Planning phase is the most important phase as a guideline to develop the system.

During this phase, objectives of the system are identified and all the requirements

are gathered in order to develop the system. Research for the system are being

allocated and designing a schedule to ensure that the system follow the timeline

made. Research for the system is made by reading articles and journals related to

the system and the method used. System scheduling is created using a gantt chart to

ensure that the system will developed systematically and to make sure the project

can be done on time. In planning phase also getting the business and user

requirement by interview and collecting business document from Usaha Gigih

Enterprise to meet the functionality requirement of the system that will develop.

Page 23: FYP 1 REPORT - myfik.unisza.edu.my · fyp 1 report title : crips stock forecast system using least square method (case study: usaha gigih enterprise company) name : muhammad hafizzuddin

23

3.3.3 Analysis and Design Phase

During analysis phase, some research has been done through articles, journals

in order to choose the best approach and added value in Crips Stock Forecast System

(CSFoS) Using Least Square Method Time Series Analysis and Forecasting. This

leads to selecting Least Square Method Time Series Analysis and Forecasting and

hence doing more research to understand the concept on it and how to applied in the

system. All of the disadvantages of the system are listed and come out with the

solution in developing this system. Methodology, techniques, hardware and

software requirements are also analyzed in this phase. This is to ensure that every

requirement and any related things need to be done are suitable with the system.

Design phase of the system is done based on the output produced during analysis

phase. First, all the required hardware and software requirements for the proposed

system are working properly. Design the Context Diagram (CD), Data Flow

Diagram (DFD), and Entity Relationship Diagram (ERD) to translate the process

flow of the Chips Stock Forecast System Using Least Square Method. Interface and

database designed based on the requirements stated during analysis phase. Then the

working prototype designed to get another further improvement to be added into the

proposed system.

Page 24: FYP 1 REPORT - myfik.unisza.edu.my · fyp 1 report title : crips stock forecast system using least square method (case study: usaha gigih enterprise company) name : muhammad hafizzuddin

24

3.3.4 Implementation Phase

In this phase, all activities that have been planned during phase before are

executed. The system is developed using XAMPP, MySQL and Notepad++ .

Database and interface designed during design phase are started to be developed.

The process of writing the coding are being done and the progress of the system are

reported from time to time.

3.3.5 Testing Phase

When the system is fully developed, system are being tested. For this system,

the black box testing and white box testing is used to test the correctness of the

implementation coding and search for any errors and bug. If there are any errors, it

must be recheck and come out with the solution.

3.3.6 Deployment and Evaluation Phase

During this phase, the system is released to be used by the user. The users use

the system and give their feedback whether it needs to be improved or there is

anything that needs to be modify. Then the modifications are being made based on

the feedback from the user to make sure the system is completely fulfilling the

requirements.

Page 25: FYP 1 REPORT - myfik.unisza.edu.my · fyp 1 report title : crips stock forecast system using least square method (case study: usaha gigih enterprise company) name : muhammad hafizzuddin

25

3.4 Hardware and Software Requirement

In developing a system, hardware and software play a great role as a standard

requirement which determines the accomplishment of the system. This standard

requirement relates to each other to build a successful system.

3.4.1 Hardware Requirement

Table 3.4.1 : Hardware Requirement

Hardware Description / Purpose

Microsoft Office Word 2010 Prepare documentation of the report

Draw.io An online software to create and design

Context Diagram and Data Flow

Diagram

PHPMyAdmin As a system database and generate the

Entity Relationship Diagram

Dropbox Storage and backup on all the document

Microsoft Powerpoint 2010 Prepare slide presentation

Page 26: FYP 1 REPORT - myfik.unisza.edu.my · fyp 1 report title : crips stock forecast system using least square method (case study: usaha gigih enterprise company) name : muhammad hafizzuddin

26

3.4.2 Software Requirement

Table 3.4.2 : Software Requirement

Hardware Type

Asus Ultrabook Windows edition : Windows 8.1 Single

Language

Processor : Intel® Core ™ i5-3317U @

1.7- GHz

Installed memory (RAM) : 8.00GB

System type : 64-bit Operating System

Page 27: FYP 1 REPORT - myfik.unisza.edu.my · fyp 1 report title : crips stock forecast system using least square method (case study: usaha gigih enterprise company) name : muhammad hafizzuddin

27

3.5 Trend Analysis

The concept of gathering information and spotting a pattern (or trend) in the

information is referred to as the trend analysis. Even though it is frequently applied to

foresee future events, it could also be applied to estimate uncertainties based on past

events.

3.5.1 Linear Trend

The long term trend of various business and economic time series such as sales

frequently approximates a straight line. The equation of straight line may be written as :

𝑌′ = 𝑎 + 𝑏𝑡

Where

• 𝑌′ represents the represent the estimated value of the variable 𝑌′ for a given

value of 𝑡

• 𝑎 is the intercept on Y-axis (estimated value of Y at 𝑡 = 0)

• 𝑏 is a slope of the line

• 𝑡 is any value of time that is selected

A straight line was drawn on a scatter diagram to approximate a regression line.

This method of assessment should only be used when a fast approach is needed.

(1)

Page 28: FYP 1 REPORT - myfik.unisza.edu.my · fyp 1 report title : crips stock forecast system using least square method (case study: usaha gigih enterprise company) name : muhammad hafizzuddin

28

3.5.2 Estimation of Trend Analysis by Least Square Method

The common method of constructing straight line equation through data points

to obtain the best fitting line is called the least squares method. It uses calculus to

determine the minimum sum of squares of the vertical differences of each point from

the suggested straight line. To estimate two unknown parameters (a and b) that give the

least squares equation, two equations need to be solved simultaneously.

• 𝑏 =∑ 𝑡𝑌−(∑ 𝑌)(𝛴𝑡) 𝑛⁄

𝛴𝑡2−(∑ 𝑡)2 𝑛⁄

• 𝑎 =∑ 𝑌

𝑛− 𝑏 (∑

𝑡

𝑛)

(2)

(3)

Page 29: FYP 1 REPORT - myfik.unisza.edu.my · fyp 1 report title : crips stock forecast system using least square method (case study: usaha gigih enterprise company) name : muhammad hafizzuddin

29

3.5.3 Example data and calculation

The sales of Sedap Foods, 2005 – 2009, are shown in Table 3.5.3

Table 3.5.3.1 : Annual sales of Sedap Foods

Year Sales ($ millions)

2005 7

2006 10

2007 9

2008 11

2009 13

Determine the least squares trend line equation.

To simplify the calculations, as shown in Table 3.5.3, the years are replaced by coded

values. That is, we let 2005 be 1, 2006 be 2, and so forth. This reduces the size of the

values of ∑𝒕 , ∑𝒕𝟐 and ∑𝒕𝒀 , this is often referred to as the coded method.

Page 30: FYP 1 REPORT - myfik.unisza.edu.my · fyp 1 report title : crips stock forecast system using least square method (case study: usaha gigih enterprise company) name : muhammad hafizzuddin

30

Table 3.5.3.2 : Computations for determining the trend equation

Year Sales ($ millions) 𝒕 𝒕𝒀 𝒕𝟐

2005 7 1 7 1

2006 10 2 20 4

2007 9 3 27 9

2008 11 4 44 16

2009 13 5 65 25

∑ 50 15 163 55

𝑏 =∑ 𝑡𝑌−(∑ 𝑌)(𝛴𝑡) 𝑛⁄

𝛴𝑡2−(∑ 𝑡)2 𝑛⁄ =

163−50(15) 5⁄

55−(15)2 5⁄ = 1.30

𝑎 =∑ 𝑌

𝑛− 𝑏 (∑

𝑡

𝑛) =

50

5− 1.30 (

15

5) = 6.1

The trend equation is therefore : 𝑌′ = 6.1 + 1.30𝑡.

Sales are in millions of dollars. The origin, or year 0, is in the middle of 2004,

and t increases by one unit for each year.

The value 6.1 is the eastimated sales when t = 0. That is, the estimated sales

amount for 2004 (the zero year) is $6.1 million.

Page 31: FYP 1 REPORT - myfik.unisza.edu.my · fyp 1 report title : crips stock forecast system using least square method (case study: usaha gigih enterprise company) name : muhammad hafizzuddin

31

The least squares equation can be used to find the points on the straight line

going through the middle of the data. To get the coordinates of the points on the straight

line, insert the t valuesof 1 to 5 in the equation as shown in Table 3.5.3.3

Table 3.5.3.3 : Calculations for determining the points on the straight line

using coded method

Year Sales ($ millions) 𝒕 𝒀′

2005 7 1 6.1+1.30(1) = 7.4

2006 10 2 6.1+1.30(2) = 8.7

2007 9 3 6.1+1.30(3) = 10.0

2008 11 4 6.1+1.30(4) = 11.3

2009 13 5 6.1+1.30(5) = 12.6

The actual sales and the straight line trend are plotted in Figure 3.5.3

If the sales, production, or other data over a period of time trend to approximate

a straight line trend, the equation developed by the least squares method can be used to

estimate sales for some future period.

Page 32: FYP 1 REPORT - myfik.unisza.edu.my · fyp 1 report title : crips stock forecast system using least square method (case study: usaha gigih enterprise company) name : muhammad hafizzuddin

32

3.6 Context Diagram

Figure 3.2 shows Context Diagram

Figure 3.2 shows the context diagram for Chips Stock Forecast System Using

Least Square Method is shown above. There are three entities are involves in the

system, ADMIN, STAFF and CUSTOMER.

Page 33: FYP 1 REPORT - myfik.unisza.edu.my · fyp 1 report title : crips stock forecast system using least square method (case study: usaha gigih enterprise company) name : muhammad hafizzuddin

33

3.7 Data Flow Diagram

Data Flow Diagram Level 0

Figure 3.3 Data Flow Diagram Level 0 for Admin

Based on Figure 3.3 above, there are seven processes involve in admin module.

Admin can be login to the system as a first step to get into the system. After login,

process that involve admin is Manage Chips, Manage Staff, Cash Purchase, Forecast

Stock and generate a report from the system. At the end on the process, admin can be

logout from the system.

Page 34: FYP 1 REPORT - myfik.unisza.edu.my · fyp 1 report title : crips stock forecast system using least square method (case study: usaha gigih enterprise company) name : muhammad hafizzuddin

34

Figure 3.4 Data Flow Diagram Level 0 for Staff

Based on Figure 3.4 above, there are six processes involve in staff module. Staff

can be login to the system as a first step to get into the system. After login, process that

involve admin is Manage Chips, Manage Staff, Cash Purchase and generate a report

from the system. At the end on the process, staff can be logout from the system.

Page 35: FYP 1 REPORT - myfik.unisza.edu.my · fyp 1 report title : crips stock forecast system using least square method (case study: usaha gigih enterprise company) name : muhammad hafizzuddin

35

Figure 3.5 Data Flow Diagram Level 0 for Customer

Based on Figure 3.5 above, there are five processes involve in customer module.

Customer can be login to the system as a first step to get into the system. After login,

process that involve admin is Manage Order, Payment and generate a report from the

system. At the end on the process, customer can be logout from the system.

Page 36: FYP 1 REPORT - myfik.unisza.edu.my · fyp 1 report title : crips stock forecast system using least square method (case study: usaha gigih enterprise company) name : muhammad hafizzuddin

36

Data Flow Diagram Level 1

Figure 3.6 Data Flow Diagram Level 1 for Manage Chips

Based on Figure 3.6 above, there are four processes involve in Manage Chips.

Admin can register new chip, update chip’s details, remove chips. Admin and Staff

share the role to update or add the new quantity of chips.

Page 37: FYP 1 REPORT - myfik.unisza.edu.my · fyp 1 report title : crips stock forecast system using least square method (case study: usaha gigih enterprise company) name : muhammad hafizzuddin

37

Figure 3.7 Data Flow Diagram Level 1 for Manage Staff

Based on Figure 3.7 above, there are four processes involve in Manage Staff.

Admin can register new staff, update staff profile and remove chips.

Page 38: FYP 1 REPORT - myfik.unisza.edu.my · fyp 1 report title : crips stock forecast system using least square method (case study: usaha gigih enterprise company) name : muhammad hafizzuddin

38

Figure 3.8 Data Flow Diagram Level 1 for Manage Order

Based on Figure 3.8 above, there are three processes involve in Manage Order.

Customer can make a new order chip, update order and cancel order.

Page 39: FYP 1 REPORT - myfik.unisza.edu.my · fyp 1 report title : crips stock forecast system using least square method (case study: usaha gigih enterprise company) name : muhammad hafizzuddin

39

3.8 Entity Relationship Diagram

Figure 3.9 Entity Relationship Diagram

An entity relationship diagram (ERD) illustrates an information system’s

entities and the relationship between those entities. ERD composed of three things such

as identifying and defining the entities, determine entities interaction and the cardinality

of the relationship.

Page 40: FYP 1 REPORT - myfik.unisza.edu.my · fyp 1 report title : crips stock forecast system using least square method (case study: usaha gigih enterprise company) name : muhammad hafizzuddin

40

3.9 Data Dictionary

A data dictionary is a file or a set of files that contains a database's metadata.

The data dictionary contains records about other objects in the database, such as data

ownership, data relationships to other objects, and other data. The data dictionary is a

crucial component of any relational database. Ironically, because of its importance, it is

invisible to most database users. For most relational database management systems

(RDBMS), the database management system software needs the data dictionary to

access the data within a database.

1. TABLE user

2. TABLE staff

3. TABLE customer

4. TABLE address

5. TABLE chips

6. TABLE purchase

7. TABLE order

8. TABLE payment

9. TABLE chipsmanagement

Page 41: FYP 1 REPORT - myfik.unisza.edu.my · fyp 1 report title : crips stock forecast system using least square method (case study: usaha gigih enterprise company) name : muhammad hafizzuddin

41

1. Table user

Table 3.9.1 : Table user

No Column Type Length Null Key Description

1 username varchar 50 No PK

2 password varchar 10 No

3 rule varchar 10 No

2. Table staff

Table 3.9.2 : Table staff

No Column Type Length Null Key Description

1 staffID varchar 10 No PK

2 staffName varchar 50 No

3 staffIC varchar 12 No

4 phoneNo varchar 12 No

5 position varchar 10 No

6 username varchar 50 No

Page 42: FYP 1 REPORT - myfik.unisza.edu.my · fyp 1 report title : crips stock forecast system using least square method (case study: usaha gigih enterprise company) name : muhammad hafizzuddin

42

3. Table customer

Table 3.9.3 : Table customer

No Column Type Length Null Key Description

1 customerID varchar 10 No PK

2 customerName varchar 50 No

3 customerIC varchar 12 No

4 phoneNo varchar 12 No

5 username varchar 50 No

4. Table address

Table 3.9.4 : Table address

No Column Type Length Null Key Description

1 username varchar 50 No PK

2 line1 varchar 50 No

3 line2 varchar 50 No

4 postcode varchar 6 No

5 city varchar 50 No

6 state varchar 50 No

Page 43: FYP 1 REPORT - myfik.unisza.edu.my · fyp 1 report title : crips stock forecast system using least square method (case study: usaha gigih enterprise company) name : muhammad hafizzuddin

43

5. Table chips

Table 3.9.5 : Table chips

No Column Type Length Null Key Description

1 chipID varchar 10 No PK

2 chipName varchar 50 No

3 pricePerKG int 5 No

4 image blob No

6. Table purchase

Table 3.9.6 : Table purchase

No Column Type Length Null Key Description

1 staffID varchar 10 No PK

2 chipID varchar 10 No PK

3 datePurchase date No PK

4 quantity int 11 No

Page 44: FYP 1 REPORT - myfik.unisza.edu.my · fyp 1 report title : crips stock forecast system using least square method (case study: usaha gigih enterprise company) name : muhammad hafizzuddin

44

7. Table order

Table 3.9.7 : Table order

No Column Type Length Null Key Description

1 orderID varchar 10 No PK

2 customerID varchar 10 No

3 chipID varchar 10 No

4 dateOrder date 10 No

5 quantity int 11 No

8. Table payment

Table 3.9.8 : Table payment

No Column Type Length Null Key Description

1 orderID varchar 10 No PK

2 customerID varchar 10 No PK

3 datePaid date No PK

Page 45: FYP 1 REPORT - myfik.unisza.edu.my · fyp 1 report title : crips stock forecast system using least square method (case study: usaha gigih enterprise company) name : muhammad hafizzuddin

45

9. Table chipsmanagement

Table 3.9.9 : Table chipsmanagement

No Column Type Length Null Key Description

1 chipID varchar 10 No PK

2 staffID varchar 10 No PK

3 dateUpdate varchar 10 No PK

4 quantity varchar 5 No

Page 46: FYP 1 REPORT - myfik.unisza.edu.my · fyp 1 report title : crips stock forecast system using least square method (case study: usaha gigih enterprise company) name : muhammad hafizzuddin

46

REFERENCES

[1] Akhter, S., Rahman, M. A., Koushik, M. R. P., & Hossain, M. M. (2016).

Selection of a Forecasting Technique for Beverage Production: A Case

Study. World, 6(3), 148-159.

[2] Kumar, R and Mahto, D 2013, ‘A case study : Application of Proper Forecasting

Technique in Juice Production’, Global Journal of Researches in Engineering,

vol. 13, no. 4, pp. 1-6

[3] Pal, S, Ramasubramanian, V and Mehta, SC 2007, ‘Statistical Models for

Forecasting Milk Production in India’, Journal of Indian Society of Agricultural

Statistics, vol.61, no.2, pp. 80-83.

[4] Barbosa, N de P, Christo, E da S and Costa, KA 2015, ‘Demand Forecasting for

Production Planning in a Food Company’, ARPN Journal of Engineering and

Applied Sciences, vol. 10, no. 16, pp. 7137-7141.

[5] Lee, Y and Tong, L 2011, ‘Forecasting time series using a methodology based

on autoregressive integrated moving average and genetic programming’

Knowledge-Based Systems, vol. 24, pp. 66–72.

Page 47: FYP 1 REPORT - myfik.unisza.edu.my · fyp 1 report title : crips stock forecast system using least square method (case study: usaha gigih enterprise company) name : muhammad hafizzuddin

47

[6] Eksoz, C, Mansouri, SA and Bourlakis, M 2014, ‘Collaborative Forecasting in

the Food Supply Chain: A Conceptual Framework’, International Journal of

Production Economics, vol.158, pp.120–135.

[7] Doganis, P., Alexandridis, A., Patrinos, P., & Sarimveis, H. (2006). Time series

sales forecasting for short shelf-life food products based on artificial neural

networks and evolutionary computing. Journal of Food Engineering, 75(2),

196-204.

[8] De Oliveira Silva R., Da Silva Christo E. and Alonso Costa K. 2014. 'Analysis

of Residual Autocorrelation in Forecasting Energy Consumption through a Java

Program', Advanced Materials Research. Trans Tech Publ.

[9] Junior M. L. and Filho M. G. 2012. 'Production planning and control for

remanufacturing: literature review and analysis', Production Planning &

Control, Vol. 23, pp. 419-35.