0

I have a large number (tens not hundreds) of parameters: a1, a2, a3 ... , an and b1, b2, b3 ... , bn which I want to find using linear algebra.

And a system of simultaneous equations:

  • a1b2 = 4
  • a2b1 = 2
  • ...
  • a4b7 = 3
  • a7b4 = 0
  • ...

Note:

  • these formulas always take the form anbm = x
  • x is always a positive integer (or zero)
  • the equations always come in pairs: anbm = x & ambn = y
  • we never get anbn = x equations (e.g. a and b values with the same index in the same equation)
  • each parameter (e.g. a1 or b6) will occur in multiple equations
  • not ever combination of anbm will necessarily be present in the system of equations
  • To constrain the system, I'm happy to assume the mean of the b values is 1
  • There will be enough equations to over constrain the parameters, I'm looking for the optimal solution, not an exact solution.

Is it possible to pose this problem in a matrix form such that I can solve it using matrix inversion and a QR transform? I'm currently using scipy.optimize.minimize() which is very slow.

If the formulas took the form an + bm = x this would be relatively simple to solve using something like this, but the parameters are multiplied, not added :-(.

Part of the problem I'm having while trying to find a mathematical solution is I'm not sure what to call this sort of problem. Is there a name for problems like this?

1 Answers1

1

It seems you are trying to find a non-linear least squares solution to something that looks like

$$ Y_{k\ell} - a_k \: b_\ell = 0\text{ .} $$

We seek to minimize the squared residuals between the data and the model you use to fit the data. For you it would look something like this.

$$R = \sum_{k\neq\ell} \big(Y_{k\ell} - a_k \: b_\ell\big)^2 $$

Minimization will happen when the gradient $\nabla R$ with respect to all parameters $a$ and $b$ are equal to zero. Taking derivatives to find equations

$$\begin{align} \dfrac{\partial R}{\partial a_j} &= 0\\\dfrac{\partial R}{\partial b_j} &= 0 \end{align}$$

you should now be able to solve a least-squares system using Levenberg-Marquardt or whatever algorithm you wish.

vb628
  • 1,784
  • 5
  • 12