Curve fitting selects function parameters so a curve approximates observed data. A real-valued genetic algorithm can search for polynomial coefficients while minimizing mean squared error (MSE). section 8.2.2
Third-order polynomial
Fit y = ax³ + bx² + cx + d to five data points. Each candidate is a coefficient vector [a, b, c, d]; substituting it into the polynomial produces predictions whose MSE measures fitness. For [1, 2, 3, 4], the worked MSE is 122.83; for [2, 2, 2, 2], it is 3,662.32. section 8.2.2
The genetic search proceeds by:
- Representing each candidate curve with real-valued coefficients. section 8.2.2
- Evaluating predictions and minimizing their MSE. section 8.2.2
- Creating offspring through whole arithmetic crossover and mutation, balancing exploration with exploitation. section 8.2.2
Table 8.2 Curve-fitting problem data (view table figure)
| x |
0 |
1.25 |
2.5 |
3.75 |
5 |
| y |
1 |
5.22 |
23.5 |
79.28 |
196 |
Browse the x and y values used by the curve-fitting example. section 8.2.2
