Mean squared error (MSE) measures average squared prediction error: subtract each predicted value from its observed value, square the difference, and average the results. Lower MSE indicates a closer fit. section 8.2.2
Comparing polynomial candidates
For a third-order polynomial, a real-valued genetic algorithm represents each candidate as coefficients [a, b, c, d]. The candidate [1, 2, 3, 4] produces an MSE of 122.83, while [2, 2, 2, 2] produces 3,662.32. The first candidate therefore receives the better fitness for this minimization problem. section 8.2.2
A practical MSE workflow is:
- Evaluate the polynomial at each supplied x value. section 8.2.2
- Compute squared errors against the corresponding observed y values and average them. section 8.2.2
- Use the resulting score to compare genetic-algorithm candidates during optimization. section 8.2.2












