# 4 equations, best fitting values for three unknowns

#### kvd

##### New Member
Hi all,

I have been using matrix linear regression with much succes on several sets of equations until now. Now however, I have a set of equations which I have not been able to linearise. As such I cannot use the aforementioned method. It is a set of 4 equations, with 3 unknowns (x, y and p). I’d like to find the best fitting values for the three unknowns. The equations are:

a = yx
b = y(2px -1)
c = py(xp - 2)
d = -pyy = -py^2

a, b, c and d are known constants
x, y and p are unknowns for which best fitting values need to be found.

What method can be used to find best fitting values for x, y and p?

Thanks, Koen.

#### katxt

##### Active Member
How do you define "best fitting"? Least squares? Minimum maximum error? Or something else?
When you have decided that, then one method is to set up an Excel spreadsheet with cells for x, y, and p. Make four cells for the known values a, b, c, d. Next to them put the calculated values of the right hand sides. Then four cells with the differences between the left and right hand sides. Finally a cell with your best fit criterion (eg the sum of the differences squared, or the minimum of the absolute differences) Now get Solver going and find the minimum of the criterion by changing x, y and p. Write back if you want more details.
Cheers, kat