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?