Non-linear regression with brute force