0% found this document useful (0 votes)
14 views

Lecture 6 - Regression Analysis

Engineering skills 6

Uploaded by

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

Lecture 6 - Regression Analysis

Engineering skills 6

Uploaded by

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

Basic Linear Interpolation

Petroleum Engineering
UGI

Rubar Dizayee
Interpolation
• Interpolation is a method of constructing new data points within the
range of discrete set of known data points.
• In engineering and science one often has a number of data points,
that are obtained by sampling or experimentation, and try to
construct a function which closely fits those data points. This is called
Curve Fitting or Regression analysis.
• Interpolation is a specific case of curve fitting in which the function
must go exactly through the data points.
Interpolation
• Interpolation means to calculate a point or several points between
two given points. For a given sequence of points, this means to
estimate a curve that passes through every single point.
• Linear interpolation is the simplest interpolation method. Applying
linear interpolation to a sequence of points results in a polygonal line
where each straight line segment connects two consecutive points of
the sequence.
Interpolation
• An interpolation function always
goes through all the given data
points where as a regression
model does not.
Interpolation
• Typically used when you have sparse (a small amount of) data
• Not useful when you have large amounts of data

Interpolation useful here Interpolation NOT useful here


Interpolation
• In tables, the function is only X Y
specified at a limited number or 0 0
discrete set of independent
0.5 0.479
variable values
1 0.841
• We can use interpolation to find 1.5 0.997
functional values at other values of
2 0.909
the independent variable, e.g.
Y(0.63253) 2.5 0.598
Interpolation
Chart title
1.2

1 X Y
0.8
0 0
0.5 0.479
Y- axis

0.6
1 0.841
0.4
1.5 0.997
0.2 2 0.909
2.5 0.598
0
0 0.5 1 1.5 2 2.5 3

X- axis
Interpolation
Example An experiment is used to determine the viscosity of water as a
function of temperature. The following table is generated:

Temp. (degree) viscosity


0 1.792
5 1.519
10 1.308
15 1.140

Estimate the viscosity when the temperature is 8 degrees.


Interpolation
• We can represent the value that we want to find a
corresponding value for as X and the interpolated
value we want to find as Y. Temp. viscosity
(degree)
• Find the closest values below and above the value 0 1.792
of X in the table or on the graph. We will represent 5 1.519
the closest values as X1 and Y1. 10 1.308
• Find the interpolated value mathematically, the 15 1.140
equation can be written as
y = y1 + ((x – x1)/(x2 - x1)) * (y2 - y1).
Interpolation

Temperature (Celsius) Pressure (Kilopascals)


Based on the given table what
10 0.5
is the gas pressure at 37 C?
20 1
30 3
40 5
50 7

y = y1 + ((x – x1)/(x2 - x1)) * (y2 - y1).


Interpolation
• y = y1 + ((x – x1)/(x2 - x1)) * (y2 - y1) X=37
X1=30 Y1=3
X2=40 Y2=5
Y=3+((37-30)/(40-30))*(5-3)
Y= 4.4
Interpolation
• Linear interpolation is quick and easy, but
It is not very precise.
Regression Analysis
(Curve fitting)
Regression Analysis
• Regression analysis is a set of statistical methods refers to the study of
the relationship between a response (dependent) variable, Y, and one
or more independent variables (X).
• It can be utilized to assess the strength of the relationship between
variables and for modeling the future relationship between them.
• When this relationship is reasonably approximated by a straight line,
then it is a linear regression.
Uses of Regression Analysis
• It is widely used for prediction and forecasting.
• it is used to understand which among the independent variables are
related to the dependent variable, and to explore the forms of these
relationships.
• it helps one understand how the typical value of the dependent
variable changes when any one of the independent variables is
varied.
• Reducing data sets with a large number of points to a simple model
Simple Regression
• Linear Regression: It performs the task to predict
a dependent variable (y) based on the given
independent variable(x). So, this regression
technique finds out a linear relationship
between x (input) and y (output).
Y = a+bX
- Y is the dependent variable
a is the Y intercept, b is the slope, and X is the
independent variable.
Linear Regression
• a= y-b x • b= r*(Sy/Sx)
- y is mean of the values of the Y variable - r is correlation coefficient
- X is mean of the values of the X variable
- Sy is the standard deviation of y
- b is the slope.
- Sx is the standard deviation of x

- Xi is values of the x variables in the sample


- n is the number of samples
- yi is values of the y variables in the sample
Linear Regression
Linear Regression
• It is very fast
• Easy to Understand and
• highly interpretable.
Simple Regression
• Non-linear regression
Nonlinear regression is a form of regression analysis in which data is fit
to a model and then expressed as a mathematical function. Simple
linear regression relates two variables (X and Y) with a straight line,
while nonlinear regression relates the two variables in a nonlinear
(curved) relationship.
Simple Regression

1) Approximate the value of sales on


a day when the temperature is 20 °C.

2) Estimate the value of the sales on


a day when the temperature is 13 °C

You might also like