Polynomial Regression
GROUP MEMBERS
Naveed Irshad (042)
Waleed Ishaq (007)
Ali Khan (039)
Abid Shehzad (041)
Rubab Rafique ()
Asma Kishwar ()
Contents
• Definition
• Why we use polynomial Regression
• History
• Regression Model
• Matrix Form
• Matlab Code
• Advantages
• Disadvantages
• Conclusion
Polynomial Regression
Defination:
Polynomial regression is a form of linear regression in which the relationship
between the independent variable x and the dependent variable y is modelled
as an nth degree polynomial.
Why we use polynomial regression
• There are three main situations that indicate a linear relationship may not
be a good model.
• 1. Most important is the theoretical one. There are some relationships that
a researcher will hypothesize is curvilinear. Clearly, if this is the case, include
a polynomial term.
Why we use polynomial regression
• 2.The second chance is during visual inspection of your variables. This is
one of those reasons for always doing univariate and bivariate inspections of
your data before you begin your regression analyses. A simple scatter plot
can reveal a curvilinear relationship.
Why we use polynomial regression
•3. Inspection of residuals. If you try to fit a linear model
to curved data, a scatterplot of residuals (Y axis) on the
predictor (X axis) will have patches of many positive
residuals in the middle. This is a good sign that a linear
model is not appropriate, and a polynomial may do
better.
History
• The first design of an experiment for polynomial regression appeared in an
1815 paper of Gergonne.
• In the twentieth century, polynomial regression played an important role in
the development of regression analysis, with a greater emphasis on issues
of design and inference.
• More recently, the use of polynomial models has been complemented by
other methods, with non-polynomial models having advantages for some
classes of problems.
A cubic polynomial regression fit to a simulated data set.The confidence
band is a 95% simultaneous confidence band constructed using
the Scheffé approach.
Regression Model
linear regression
Model
Quadratic model
General polynomial
Regression Model
Matrix form
• Polynomial regression model
• Matrix
Objective Of Polynomial regression:
•How matlabs handle Polynomial.
•POLVAL to evaluate Polynomial.
•POLFIT to generate Polynomial trendline.
•Plotting Polynomial trendline with data using
commands.
Q:How we implement Polynomial regression
(Linear) Functions in Matlab?
• Matlab code:
• In matlab code where m is Nth order of polynomial i.e 2,3,4……..n
• P=[1 5 10 20 40 60 100 200 400 700];
• T=[-36.7 19.6 -11.5 -2.6 7.6 15.4 26.1 42.2 60.6 80.1];
• m=3;
• E=polyfit(T,P,m);
• Z=polyval(E,T);
• norm(P-Z);
• n=length(P);
• rms=norm(P-Z)/sqrt(n)
• E
• plot(T,Z,'o',T,P,'K')
Polynomial Regression in Matlab
Now when we will change the value of ‘m’ i.e m=7
then rms is decrease and give us Polynomial badly condition….we can see in
below command window…..
Advantages
• The biggest advantage of nonlinear regression over many other
techniques is the broad range of functions that can be fit.
• Polynomials very flexible, and useful where a model must be developed
empirically.
• Polynomial fit a wide range of curvature.
• Polynomial provide a good approximation of the relationship.
• Transformations generally more interpretable, often more easily
interpreted in terms of a possible functional relationship.
Disadvantages
• Disadvantages include a strong sensitivity to outliers.The presence of one
or two outliers in the data can seriously affect the results of a nonlinear
analysis.
• In addition there are unfortunately fewer model validation tools for the
detection of outliers in nonlinear regression than there are for linear
regression.
Conclusion
• Method of Polynomial Regression tell us about ill condion and Well
condition.
• Evaluate the coefficient constants then we have used different
techniques like LU decomposition methon,Guass Elimination method
etc
Polynomial regression

Polynomial regression

  • 2.
    Polynomial Regression GROUP MEMBERS NaveedIrshad (042) Waleed Ishaq (007) Ali Khan (039) Abid Shehzad (041) Rubab Rafique () Asma Kishwar ()
  • 3.
    Contents • Definition • Whywe use polynomial Regression • History • Regression Model • Matrix Form • Matlab Code • Advantages • Disadvantages • Conclusion
  • 4.
    Polynomial Regression Defination: Polynomial regressionis a form of linear regression in which the relationship between the independent variable x and the dependent variable y is modelled as an nth degree polynomial.
  • 5.
    Why we usepolynomial regression • There are three main situations that indicate a linear relationship may not be a good model. • 1. Most important is the theoretical one. There are some relationships that a researcher will hypothesize is curvilinear. Clearly, if this is the case, include a polynomial term.
  • 6.
    Why we usepolynomial regression • 2.The second chance is during visual inspection of your variables. This is one of those reasons for always doing univariate and bivariate inspections of your data before you begin your regression analyses. A simple scatter plot can reveal a curvilinear relationship.
  • 7.
    Why we usepolynomial regression •3. Inspection of residuals. If you try to fit a linear model to curved data, a scatterplot of residuals (Y axis) on the predictor (X axis) will have patches of many positive residuals in the middle. This is a good sign that a linear model is not appropriate, and a polynomial may do better.
  • 8.
    History • The firstdesign of an experiment for polynomial regression appeared in an 1815 paper of Gergonne. • In the twentieth century, polynomial regression played an important role in the development of regression analysis, with a greater emphasis on issues of design and inference. • More recently, the use of polynomial models has been complemented by other methods, with non-polynomial models having advantages for some classes of problems.
  • 9.
    A cubic polynomialregression fit to a simulated data set.The confidence band is a 95% simultaneous confidence band constructed using the Scheffé approach.
  • 10.
    Regression Model linear regression Model Quadraticmodel General polynomial Regression Model
  • 11.
    Matrix form • Polynomialregression model • Matrix
  • 12.
    Objective Of Polynomialregression: •How matlabs handle Polynomial. •POLVAL to evaluate Polynomial. •POLFIT to generate Polynomial trendline. •Plotting Polynomial trendline with data using commands.
  • 13.
    Q:How we implementPolynomial regression (Linear) Functions in Matlab? • Matlab code: • In matlab code where m is Nth order of polynomial i.e 2,3,4……..n • P=[1 5 10 20 40 60 100 200 400 700]; • T=[-36.7 19.6 -11.5 -2.6 7.6 15.4 26.1 42.2 60.6 80.1]; • m=3; • E=polyfit(T,P,m); • Z=polyval(E,T); • norm(P-Z); • n=length(P); • rms=norm(P-Z)/sqrt(n) • E • plot(T,Z,'o',T,P,'K')
  • 14.
  • 15.
    Now when wewill change the value of ‘m’ i.e m=7 then rms is decrease and give us Polynomial badly condition….we can see in below command window…..
  • 16.
    Advantages • The biggestadvantage of nonlinear regression over many other techniques is the broad range of functions that can be fit. • Polynomials very flexible, and useful where a model must be developed empirically. • Polynomial fit a wide range of curvature. • Polynomial provide a good approximation of the relationship. • Transformations generally more interpretable, often more easily interpreted in terms of a possible functional relationship.
  • 17.
    Disadvantages • Disadvantages includea strong sensitivity to outliers.The presence of one or two outliers in the data can seriously affect the results of a nonlinear analysis. • In addition there are unfortunately fewer model validation tools for the detection of outliers in nonlinear regression than there are for linear regression.
  • 18.
    Conclusion • Method ofPolynomial Regression tell us about ill condion and Well condition. • Evaluate the coefficient constants then we have used different techniques like LU decomposition methon,Guass Elimination method etc