I've read optimization guide (

http://commons.apache.org/proper/commons-math/userguide/optimization.html) yet I'm still unsure about how

to apply optimization examples in my case.

I have a set of nonlinear equations in the form:

e^(qt)S - e^(rt)K1 = b1

e^(qt)S - e^(rt)K2 = b2

...

e^(qt)S - e^(rt)Kn = bn

r and q are unknown variables (parameters?), while S, t, K1...Kn are known

scalars. b1...bn is a set of known scalar observations that could contain

errors.

Since r,q are two unknown variables I could simply solve the set of two

equations b1,b2 and find the desired q and r. However, those two particular

observations b1 and b2 could contain the most error in observation set data

thus propagating the error to r and q.

How could I use optimization package to find optimal r and q for the entire

set of observations that would minimize the sum of the difference?

Regards,

Vladimir