curve fitting

26
Business Forecasting Curve Fitting Method Presented by; Amit Mohan Rao M.B.A (B.E) 4 th Sem

Upload: sspp1122

Post on 03-Jul-2015

134 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Curve Fitting

Business Forecasting

Curve Fitting Method

Presented by;Amit Mohan Rao

M.B.A (B.E) 4th Sem

Page 2: Curve Fitting

INTRODUCTIONCurve fitting is the process of constructing

a curve, or mathematical function, that has the best fit to a series of data points, possibly subject to constraints. Curve fitting can involve either interpolation, where an exact fit to the data is required, or smoothing, in which a "smooth" function is constructed that approximately fits the data.

Page 3: Curve Fitting

Purpose of Curve Fitting Method Curve fitting, also known as regression

analysis, is used to find the "best fit" line or curve for a series of data points. Most of the time, the curve fit will produce an equation that can be used to find points anywhere along the curve. In some cases, you may not be concerned about finding an equation. Instead, you may just want to use a curve fit to smooth the data and improve the appearance of your plot.

Page 4: Curve Fitting

Different types of curve fittingFitting lines and polynomial curves to data pointsLet's start with a first degree polynomial equation: y = ax+ b This is a line with slope a. We know that a line will connect any two

points. So, a first degree polynomial equation is an exact fit through any two points with distinct x coordinates.

If we increase the order of the equation to a second degree polynomial, we

get: y=ax² + bx +c

This will exactly fit a simple curve to three points. If we increase the order of the equation to a third degree polynomial, we get: y=ax³+bx²+cx+d

Page 5: Curve Fitting

Polynomial curves fitting points generated with a sine function.Red line is a first degree polynomial, green line is second degree, orange line is third degree

Page 6: Curve Fitting

Fitting other curves to data points Other types of curves, such as conic

section (circular, elliptical, parabolic, and hyperbolic arcs) or trigonometric function(such as sine and cosine), may also be used, in certain cases.

Note: Conic Section- In mathematics, a conic section  is a curve obtained by intersecting a cone (more precisely, a right circular conical surface) with a plane.

Trigonometric Function- In mathematics, the trigonometric functions are functions of an angle. They are used to relate the angles of a triangle to the lengths of the sides of a triangle. Trigonometric functions are important in the study of triangles and modeling periodic phenomena, among many other applications.

Page 7: Curve Fitting

Fitting a circle by geometric fit

That approaches the problem of trying to find the best visual fit of circle to a set of 2D data points. The method elegantly transforms the ordinarily non-linear problem into a linear problem that can be solved without using iterative numerical methods, and is hence an order of magnitude faster than previous techniques.

Fitting an ellipse by geometric fit The above technique is extended to

general ellipses by adding a non-linear step, resulting in a method that is fast, yet finds visually pleasing ellipses of arbitrary orientation and displacement.

Page 8: Curve Fitting

Features of Curve FittingFit data to built-in and user-defined fitting

functions.Do linear, polynomial and non-linear

regression.Virtually unlimited number of fit coefficients

in user-defined fitting functions.Virtually unlimited number of independent

variables in a Multivariate curve fit (multiple regression).

Curve fits to data with linear constraints on the fit parameters.

Page 9: Curve Fitting

Continue….Automatic calculation of the model curve,

curve fit residuals, and confidence and prediction bands. These curves can be automatically added to a graph of your data.

Optional automatic calculation of confidence limits for fit coefficients.

Set and hold the value of any fit coefficient.Weighted data fitting.Errors-in-variables fitting (when you have

measurement errors in both X and Y).

Page 10: Curve Fitting

Continue…..

Implicit fits, when your fitting function is in the form f(x,y)=0.

Curve fit to subsets of your data.For simple fits to built-in functions, fit with a

single menu selection.Fit to sums of fitting functions.

Page 11: Curve Fitting

Types of Curve Fits

Least Square Nonlinear Curve Smoothing

Curve Fits Fits Curve Fits

Page 12: Curve Fitting

Least Square Curve Fits Least Squares minimizes the square of

the error between the original data and the values predicted by the equation.

Non Linear Curve Fits The relationship between measured

values and measurement variables is nonlinear. Nonlinear curve fitting also seeks to find those parameter values that minimize the deviations between the observed values and the expected values.

Page 13: Curve Fitting

Smoothing Curve Fits A new mathematical

method is developed for interpolation from a given set of data points in a plane and for fitting a smooth curve to the points. This method is devised in such a way that the resultant curve will pass through the given points and will appear smooth and natural. It is based on a piecewise function composed of a set of polynomials, each of degree three, at most, and applicable to successive intervals of the given points

Page 14: Curve Fitting

In this case study We see how curve fitting take place in shot peening

data analysis

Page 15: Curve Fitting

Curve Fitting for Shot Peening DataData abounds in shot peening. We have Almen

arc heights, peening times, shot weightings, image analysis values, air pressure variations, shot flow rates, residual stress data, etc.

X-Y Plotting We have two variables “X” and “Y”. The “X”

values are generally referred to as the “independent variables” whereas the “Y” values are the measured “dependent variables”. For example, we can have a set of X values

Page 16: Curve Fitting

Continue….. that represent specified peening times

together with Y values that are Almen arc heights measured for each peening time. The magnitude of each Y value must depend in some way on the corresponding X value, hence the use of the term ‘dependent variable’. In most situations the independent variable is the one that we exercise control over and the dependent variable is the one that we subsequently measure.

Page 17: Curve Fitting

In Curve Fitting General Equation for Straight Line

y = ax+ b, where a is the value of y when x=0 and b is the

slope of the straight line.

Page 18: Curve Fitting
Page 19: Curve Fitting

Residual Surface Stresses Induced by Peening

A set of Almen A strips had been peened for different times in order to produce a saturation curve. The surface residual stress was measured for each strip using X variable. Three sets of parameters were therefore available – Almen arc height, residual stress level and peening time, see Table. Plotting surface residual stress level against peening time gives where a simple linear interpolation has been applied. Linear interpolation is, however, unsatisfactory in this situation.

Page 20: Curve Fitting

Peening Time - 2 Almen Arc height - µm

Surface Residual Stress - MPa

0 0 54

2 21 -89

4 38 -120

8 70 -250

16 113 -450

32 162 -613

60 209 -620

120 242 -598

240 265 -476

Page 21: Curve Fitting
Page 22: Curve Fitting
Page 23: Curve Fitting

In this case we are starting with strips that each originally contain a small level of tensile surface residual stress (+54MPa).

y = ax+ b Residual stress = 54MPa + f(peening

time) where f(peening time) means ‘some

mathematical function of peening time’.

Page 24: Curve Fitting

Curve Fitting Toolbox The Curve Fitting Toolbox is designed specifically for

fitting curves to data sets. This toolbox is a collection of graphical user interfaces (GUIs)

Parametric fitting is performed by using toolbox library equations (such as linear, quadratic, higher order polynomials, etc.) or by using custom equations (limited only by the user's imagination.) Use a parametric fit when you want to find the regression coefficients and the physical meaning behind them.

Nonparametric fitting is performed by using a smoothing spline or various interpolants. Use nonparametric fitting when the regression coefficients hold no physical significance and are not desired.

Page 25: Curve Fitting

Continue…The Curve Fitting Toolbox also provides functionality for

Data preprocessing, such as sectioning and smoothing

Standard linear least squares, nonlinear least squares, weighted least squares, constrained least squares, and robust fitting procedures .

Fitting statistics required to determine how good the fit is, such as R-Square and Sum of Squares Due to Error (SSE)

Page 26: Curve Fitting

Thank You