Lecture 7 - Regression 2
Lecture 7 - Regression 2
UGI
Rubar Dizayee
TIPS
• Check the minimum
and maximum values in
your data set (samples).
• The axes do not have to
start at 0!!!
• The scale on an axes
should be constant (log
plot excluded)!
TIPS
Time
2010 2011 2012 2013 2014
Problem solving
Example
The upward velocity of a rocket is t [s] v(t) [m/s]
10 227.04
Table. 15 362.78
30 901.67
Problem solving
Solution
X= 16 Y=?
y = y1 + ((x – x1)/(x2 - x1)) * (y2 - y1) X1= 15, Y1=362.78
Y= 393.694 m/s X2= 20, Y2= 517.35
Problem solving
Example
Find the value of y at x = 4 given some set of values (2, 4), (6, 7)?
Problem solving
Solution
Given the known values are,
X= 4
X1 = 2 Y1 = 4
y = y1 + ((x – x1)/(x2 - x1)) * (y2 - y1) X2 = 6 Y2 = 7
Y= 5.5
Problem solving
Example
The temperature in Erbil city at 2pm was 35C and at 7pm it was 26C.
Find the temperature at 6pm.
Problem solving
Solution
X=6 Y=?
y = y1 + ((x – x1)/(x2 - x1)) * (y2 - y1) X1= 2 Y1= 35
Y= 27.8C X2= 7 Y2= 26
Problem solving
Example
From the given data set calculate Time Depth
the depth at 4hrs? 1 0
3 4
5 8
7 12
9 16
Problem solving
Problem solving
Solution 18
Y= 2X-2 16 y = 2x - 2
14
Y= (2*4)-2 12
Y= 6 10
Depth
6
0
0 1 2 3 4 5 6 7 8 9 10
-2
Time
Problem solving
Example
1) What is the value of sales on a day
when the temperature is 20 °C.
b= Y/ X
(20, 445) (21.7, 499)
b= (y2-y1)/(x2-x1)
b=34.2
(15, 270)
377.83 18.03
Y=a+(bx)
Y=445.2 a=y-bx
a=-238.8
Regression Analysis
Your company is running a production line that produces barrels of
fluid. They collect the following data of output (in barrels) with
corresponding run time of the production line (in hours).
Run Time 4 5 6 7 8 9 10 11
(hours)
Production 76.4 78.5 81.5 87.8 88.4 92.4 94 95
(barrels)
Run Time 4 5 6 7 8 9 10 11
(hours)
Production 76.4 78.5 81.5 87.8 88.4 92.4 94 95
(barrels)
Barrels
produced
hour
Regression Analysis The slope between each point is not the same.
In fact they can be very different!
Barrels produced
hour
Regression Predict the number of barrels produced after 8.5
Analysis hours of run time. Use the model!!!
Barrels produced 2.869 8.5 + 65.23 = 89.61 𝑏𝑎𝑟𝑟𝑒𝑙𝑠