Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Mini Project Linear Algebra II

Download as pdf or txt
Download as pdf or txt
You are on page 1of 31

FACULTY OF COMPUTER AND MATHEMATICS

MATHEMATICS MAT523 – LINEAR ALGEBRA II

2021 MINI PROJECT ASSIGNMENT

TITLE : Mall Customers

(The Relationship Between Customers’ Annual Incomes

and Spending Scores Shopping Mall)

Prepared by:

NAME STUDENT ID CLASS

NADHILAH BINTI SALEH 2021871192 N4CS2483B1

NUR RABIATUL ALYA BINTI AMRULNIZAM 2021480396 N4CS2483B1

Prepared for:

ENCIK MOHD AZDI BIN MAASAR


TABLE OF CONTENTS:

CONTENTS PAGE NUMBER

INTRODUCTION 2

IMPLEMENTATION 3 - 10
● Linear Model 3-5
● Quadratic Model 6-7
● Cubic Model 8 -10

GRAPHS 10 - 12
● Graph Best Fit Curve Against Its Observed Data 10 - 11
● Graph of The Error Vector Against x Values 11 - 12

ANALYSIS AND CONCLUSION 13

APPENDIX 14 - 29
● Commands and Output For Linear Model 14 - 18
● Commands and Output For Quadratic Model 19 - 23
● Commands and Output For Cubic Model 24 - 29

REFERENCES 30

1
INTRODUCTION

A shopping mall is a specially built covered area containing shops and restaurants which
people can walk between, and where cars are not allowed.The following data is the annual
incomes of customers and the spending scores of customers while being in the shopping mall.

X represents the customers' annual income (k$) and Y represents the spending scores
(1-100) of customers in the shopping mall.

X 15 15 16 16 17 17 18 18 19 19 19 19 20 20 20 20 21 21 23 23

Y 39 81 6 77 40 76 6 94 3 72 14 99 15 77 13 79 35 66 29 98

2
IMPLEMENTATION

Linear model : 𝑦 = 𝑎 + 𝑏𝑥

The data generates a system of linear equations with the matrix representation as below:

and Its normal equation is

Therefore,the least square solution is

3
The best fit line curve is

||e|| = 48.02131783

4
2
Quadratic Model : 𝑦 = 𝑎 + 𝑏𝑥 + 𝑐𝑥

The matrix representation of the above system is

Its normal equation is

The least square solution is

5
The best fit quadratic curve is

||e|| = 52.0809279

6
2 3
Cubic Model : 𝑦 = 𝑎 + 𝑏𝑥 + 𝑐𝑥 + 𝑑𝑥
The matrix representation of the above system is

and its normal equation is

7
The least square solution is

Therefore, the best fit cubic curve is

8
||e|| = 51.96428174

9
GRAPHS
Graph Best Fit Curve Against Its Observed Data

Linear Model

Quadratic Model

10
Cubic Model

Graph of The Error Vector Against x Values

Linear Model

11
Quadratic Model

Cubic Model

12
ANALYSIS AND CONCLUSION
Based on the three models above, the following error magnitudes in the approximation are
obtained:

TYPES OF BEST FIT CURVE ERROR MAGNITUDE

Linear Model 48.02131783

Quadratic Model 52.0809279

Cubic Model 51.96428174

Thus, the best fit curve in this case which will give the best approximation is the linear best fit
curve because it has the minimum error in terms of its magnitude.

13
APPENDIX
Commands and Output For Linear Model

14
15
16
17
18
Commands and Output for Quadratic Model

19
20
21
22
23
Commands and Output for Cubic Model

24
25
26
27
28
29
REFERENCES :

Internet Sources

1. Kaggle.com. (2016). Retrieved from


https://www.kaggle.com/shwetabh123/mall-customers

30

You might also like