of 19

# Polynomial regression

COMSATS Attock
Published on: Mar 4, 2016
Published in: Engineering

#### Transcripts - Polynomial regression

• 1. Polynomial Regression GROUP MEMBERS Naveed Irshad (042) Waleed Ishaq (007) Ali Khan (039) Abid Shehzad (041) Rubab Rafique () Asma Kishwar ()
• 2. Contents • Definition • Why we use polynomial Regression • History • Regression Model • Matrix Form • Matlab Code • Advantages • Disadvantages • Conclusion
• 3. 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.
• 4. 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.
• 5. 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.
• 6. 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.
• 7. 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.
• 8. A cubic polynomial regression fit to a simulated data set.The confidence band is a 95% simultaneous confidence band constructed using the Scheffé approach.
• 9. Regression Model linear regression Model Quadratic model General polynomial Regression Model
• 10. Matrix form • Polynomial regression model • Matrix
• 11. Objective Of Polynomial regression: •How matlabs handle Polynomial. •POLVAL to evaluate Polynomial. •POLFIT to generate Polynomial trendline. •Plotting Polynomial trendline with data using commands.
• 12. 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')
• 13. Polynomial Regression in Matlab
• 14. 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…..
• 15. 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.
• 16. 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.
• 17. 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