4 Curve Fitting And Regression

Numerical Methods · Unit 4

Curve Fitting and Regression

Exam-focused notes for Curve Fitting and Regression (Numerical Methods, BIT203): what the TU syllabus asks and how it has actually been tested, with 5 solved past questions from this unit.

What this unit covers

  • Least squares method for function fitting
  • Quadratic polynomial fitting
  • Exponential curve fitting
  • Regression versus interpolation
  • Fitting algorithms and applications

Exponential curve fitting

20825 marks

Fit the exponential curve $y = ae^{bx}$ for (1,15), (2,22), (3,33), (4,48), (5,70) using least square method. [5]

Points: $(1,15), (2,22), (3,33), (4,48), (5,70)$, with $n = 5$. Taking natural log: $$\ln y = \ln a + bx$$ Let $Y = \ln y$, $A = \ln a$. Then $Y = A + bx$ (linear). Normal equations: $$\sum Y = nA + b\sum x$$ $$\sum xY = A\sum x + b\sum x^2$$ $x$ $y$ $Y = \...

Full solved answer →
20785 marks

The temperature of a metal strip was measured at various time intervals during heating and the values are given in the table below. If the relation between the time 't' and temperature 'T' is of the form: $T = be^{t/4} + a$. Estimate the temperature at t = 6 minute.

Time ('t' min)1234
Temp ('T' °C)7083100124

[5]

Relation: $T = be^{t/4} + a$ t (min) 1 2 3 4 --------------- T (°C) 70 83 100 124 Estimate: T at t = 6. Substitute $u = e^{t/4}$, giving the linear form $T = a + bu$. Compute u values: t T $u = e^{t/4}$ --------- 1 70 $e^{0.25} = 1.28403$ 2 83 $e^{0.50} = 1...

Full solved answer →

Quadratic polynomial fitting

20805 marks

Fit a second order polynomial to the data in the table below:

$$\begin{array}{|c|c|c|c|c|c|}\hline X & 1 & 2 & 3 & 4 & 5 \ \hline F(x) & 2 & 6 & 12 & 20 & 30 \ \hline \end{array}$$

[5]

X 1 2 3 4 5 ------------------ f(X) 2 6 12 20 30 Model: $f(x) = a0 + a1 x + a2 x^2$, with $n = 5$. x f x² x³ x⁴ xf x²f --------------------------- 1 2 1 1 1 2 2 2 6 4 8 16 12 24 3 12 9 27 81 36 108 4 20 16 64 256 80 320 5 30 25 125 625 150 750 Σ 70 55 225 9...

Full solved answer →
05 marks

Fit the quadratic curve through the following data points and estimate the value of f(x) at x=2.

$$\begin{array}{|c|c|c|c|c|c|}\hline x & 1 & 3 & 4 & 5 & 6 \ \hline y & 2 & 7 & 8 & 7 & 5 \ \hline \end{array}$$

[5]

$x$ 1 3 4 5 6 -------------------- $y$ 2 7 8 7 5 $n = 5$. Fit $y = a0 + a1 x + a2 x^2$, estimate $f(2)$. $x$ $y$ $x^2$ $x^3$ $x^4$ $xy$ $x^2y$ --------------------------------------------- 1 2 1 1 1 2 2 3 7 9 27 81 21 63 4 8 16 64 256 32 128 5 7 25 125 625 ...

Full solved answer →

Least squares method for function fitting

20795 marks

What is least squares method of fitting a function? Fit the second order polynomial for the following data values.

x1234567
y2678101215

[5]

The least squares method finds the best-fit curve for a set of data points by minimizing the sum of squares of residuals (differences between observed values $yi$ and fitted values $f(xi)$): $$S = \sum{i=1}^{n} [yi - f(xi)]^2 \to \text{minimum}$$ $$x: 1, 2,...

Full solved answer →