Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 5 Curve fitting by iterative approaches MARINE QB III MARINE QB III Modelling Aquatic Rates In Natural Ecosystems BIOL471 © 2001 School of Biological.

Similar presentations


Presentation on theme: "Lecture 5 Curve fitting by iterative approaches MARINE QB III MARINE QB III Modelling Aquatic Rates In Natural Ecosystems BIOL471 © 2001 School of Biological."— Presentation transcript:

1 Lecture 5 Curve fitting by iterative approaches MARINE QB III MARINE QB III Modelling Aquatic Rates In Natural Ecosystems BIOL471 © 2001 School of Biological Sciences, University of Liverpool S chool of B iological S ciences S chool of B iological S ciences

2 Curve fitting: the iterative approach Ingestion Prey 0 H c = k+ H H max H

3 Linear Functions General linear equations Any straight line can be represented by the general linear equation y = mx + c y1y1 x 1 y 2 or (y 1 +  y)  y (y 2 - y 1 ) x 2 or (x 1 +  x)  x (x 2 - x 1 ) Slope (m) (  y/  x) Intercept (c) Origin 0 0 Y = a + bX a b

4 X is the independent variable since its value is freely chosen X Y is the dependent variable since its value depends on x Y 0 1 2 3 15 30 45 Regression Analysis Y = a + bX

5 Often X may be thought of as the cause and Y as the effect of that cause 0 1 2 3 15 30 45 Height climbed cause (C) effect (E) Regression Analysis E = a + bC

6 Some basic algebra Remember the equation of a straight line: However when doing regression analysis, this becomes a statistical model The model is a way of estimating values of Y, given a value of X and the constants a and b But Y is estimated. Therefore: Where a is the Y-intercept, and b the slope b is also called the regression coefficient

7 Model 1 Regression Analysis In Model 1 Regression X is measured without error X measurements are independent X is under the control of the investigator For a value of X there is a population of Y-values, which are normally distributed There is equal variance of Y at each X value X Y Note, in Model 2 regression both X and Y are random variable – we will not be discussing this

8 The figure now shows the line of best fit The line is a model of the relationship between X and Y We have selected our subjects with known values of X and then measured Y X Y The line of best fit

9 How do we select the line of best fit? We expect it to pass through (X,Y )… For any line, we could calculate the vertical deviations of each point from that line X X Y Y

10 How do we select the line of best fit? We expect it to pass through (X,Y )… For any line, we could calculate the vertical deviations of each point from that line Squaring the deviations makes them positive Summing them gives the sum of the squares of the deviations X X Y Y The line of best fit The line of best fit will minimise  d 2

11 Now we can write the regression equation By definition The regression equation is By substitution Calculating values of a and b We need to obtain values of a and b that give minimum value of this expression for sum of squares of deviations from the fitted line We solve this with differential calculus To obtain Then

12 Calculating the line of best fit That was one method of finding the line of best fit, called least squares regression It works because, using calculus we can solve for b However, there are some equations (non-linear ones) that we cannot solve this way Instead we use another method: Iterative fitting X Y

13 Here are the steps: 1. make an estimate of the parameters, in this case, the slope (b) and the intercept (a) 2. Calculate the sum of squares of deviations from the fitted line X Y The line of best fit by iteration 3. Record this value, and then try another pair of estimates of a and b

14 Here are the steps: 1. make an estimate of the parameters, in this case, the slope (b) and the intercept (a) 2. Calculate the sum of squares of deviations from the fitted line 3. Record this value, and then try another pair of estimates of a and b 4. Calculate the sum of squares… repeat until you obtain the smallest sum of squares you can get 5. When the sum of squares is minimal, this is the best fit X Y The line of best fit by iteration

15 This process may seem very labourious, but computers make it possible Steps 1.Look at the data and think about it 2.Decide if you need non-linear regression 3.Pick a mathematical model 4.Choose initial parameter values (although some programes do this for you) 5.Fit the curve to the data X Y The line of best fit by iteration

16 You must satisfy these assumptions for iterative- fitting 1.X is measured without error 2.X is under the control of the investigator 3.X values are independent of each other 4.For a value of X there is a population of Y-values, which are normally distributed 5.There is equal variance of Y at each X value X Y

17 The line of best fit by iteration Next, ask yourself the following questions 1.Does the curve go through the data (if you pick the wrong initial parameters it can all go pear- shaped)? 2.Are the best-fit parameters plausible (see above)? 3.How precise are the best-fit parameters (we will learn about how to calculate precision in a minute)? 4.Would another model be more appropriate? 5.Have you violated any of the assumptions for iterative-fit regressions?

18 Curve fitting using Follow these steps 1.Open SigmaPlot 8.0

19

20 Curve fitting using SigmaPlot 8.0 Follow these steps 1.Open SigmaPlot 8.0 2.Enter data into spread sheet (our data set will be a functional response)

21

22 Curve fitting using SigmaPlot 8.0 Follow these steps 1.Open SigmaPlot 8.0 2.Enter data into spread sheet (our data set will be a functional response) 3.Make a graph

23

24 Curve fitting using SigmaPlot 8.0 Follow these steps 1.Open SigmaPlot 8.0 2.Enter data into spread sheet (our data set will be a functional response) 3.Make a graph 4.Click on the data

25

26 Curve fitting using SigmaPlot 8.0 Follow these steps 1.Open SigmaPlot 8.0 2.Enter data into spread sheet (our data set will be a functional response) 3.Make a graph 4.Click on the data 5.In the “statistics” drop down menu, chose “regression wizard”

27

28 Curve fitting using SigmaPlot 8.0 Follow these steps 1.Open SigmaPlot 8.0 2.Enter data into spread sheet (our data set will be a functional response) 3.Make a graph 4.Click on the data 5.In the “statistics” drop down menu, chose “regression wizard” 6.Choose “hyperbola” in the “equation category” 7.Choose “2-paramerter” in the “equation name”

29

30

31

32

33

34

35


Download ppt "Lecture 5 Curve fitting by iterative approaches MARINE QB III MARINE QB III Modelling Aquatic Rates In Natural Ecosystems BIOL471 © 2001 School of Biological."

Similar presentations


Ads by Google