Sie sind auf Seite 1von 17

PE 3723 Numerical Methods Lecture 14: Curve Fitting (Introduction & Regression)

Maysam Pournik

Assistant Professor
Spring 2012
1

Curve Fitting Applications


Data given for discrete values along a continuum
Objective: Need to estimate values between discrete values

1. Techniques to fit curves to the data to obtain intermediate values

2. Need simplified version of a complicated function


Compute values at discrete points & derive a simpler function to fit these values
2

Approaches to Curve Fitting


Two general approaches for curve fitting:
1. Data with error: Least-Squares Regression Single curve that represents general trend designed to follow

pattern, not intersect every point


Applied to data exhibiting significant error

2.

Data with no error: Interpolation


Fit a curve that pass directly through each of the points

Applied to very precise data

Simple Method - Noncomputer


Plot and fit a line that virtually conforms to data
Valid for quick estimate Subjective viewpoint

Need for systematic and objective methods


Two types of application in fitting experimental data:
A. Trend analysis: Process of using the data pattern for predictions. B.
4

Hypothesis testing: An existing mathematical model is compared with experimental data.

Mathematical Background
Use statistics to convey as much information as possible about specific characteristics of data set Location of the center of distribution
Arithmetic mean: sum of individual points divided by total number of data points

Mathematical Background
Degree of spread of data set
Standard deviation: square root of total sum of residuals between data points and mean value divided by total number of data points minus 1
Variance: square of standard deviation

Coefficient of variation: ratio of standard deviation to the mean


Provides a normalized measure of spread Similar to relative error as is ratio of a measure of error to an estimate of true value
6

Mathematical Background
Shape of data distribution
Histogram:
visual representation of distribution

Constructed by sorting measurements into intervals


Plotted as units of measurement versus frequency of occurrence Can be represented by a single smooth curve One type is Normal distribution symmetric, bell-shaped curve
7

Mathematical Background
Quantify confidence on a measurement
For normal distribution: to + : contains 68% of total data to + : contains 95% of total data

Need to estimate properties of a population based on limited sample of the population Statistical Inference
Define a confidence interval around our estimate & : sample information (estimated) & : population information (true)
8

Mathematical Background
Interval estimator: gives range of values within which the parameter is expected to lie with a given probability
One-sided interval less than or greater than true Two-sided interval no consideration to sign of discrepancy

Mathematical Background
Probability that true mean of y, , falls within the bound from L to U is 1- ( is significance level) Standard normal estimate

Normalized distance between and Normally distributed with mean of 0 and variance of 1 Probability that it lies within z/2 and z/2 is 1-
10

Tabulated in books and software

Mathematical Background
Estimation of L and U As true variance is not known, define based on estimated variance using new variable

Based on t-distribution (not normal) & tabulated

Represents interval around mean of width t/2,n-1 times the standard deviation encompassing 95% of distribution
11

Linear Regression
Systematic method to derive a curve that

minimize discrepancy between data and curve


Fit a straight line to data points
y = a0 + a1x + e
a0 = intercept a1 = slope e = error or residual between model and data

12

Linear Regression Best Fit


Selection of best fit based on:

Minimax method: Minimize the maximum distance that an individual point falls from the line.

13

Linear Regression Least Square


Sum of the squares of residuals

Yields unique solution

14

Linear Regression Least Square


Standard deviation of regression line
Standard error of estimate

If sy/x < sy, then linear regression is valid and has merit

15

Linear Regression Least Square


Goodness of the fit quantify improvement in describing data by a straight line rather than an average value
Coefficient of determination, r2 (r is correlation coefficient)

r = 1 : perfect fit and explains data variability

r = 0 : fit represents no improvement


16

Example: Linear Regression


Perform linear regression for this data set

17

Das könnte Ihnen auch gefallen