My numerical analysis skills are a bit rusty on this, I plan to use scipy/numpy or octave to approach the solution but I need a pointer on how I should transform the problem in a way that it can be approached given available tools.
$X$ is a vector of float values
$Y$ is a vector of float values
$X$ and $Y$ are of different length
I only care about certain combinations of $X[i]$ and $Y[j]$ not every combination.
For $X$ and $Y$ such that $f(X[i], X[j]) \approx 0$ (as close to zero as possible) and the overall total $f(X,Y) \approx 0$. That is, I want the least total variance from zero but also want the least possible variance from zero on a per pair basis. That is, I could get to $f(X,Y) = 0$ even if $f(X, Y) = 35$ and $f(X, Y) = -35$ but want to avoid that solution if one exists with lower per pair variance.
- $Y$ is bounded, that is all values in $Y$ should be $1.0 \leq Y[i] \leq 10.0.$
My initial thought, is to create a system of equations based on the combinations of $X[i]$ and $Y[j]$ that I care about. But, after looking over the SciPy optimization tools available, they only seem to accept a single vector for input, which would make it difficult to impose a constraint on the $Y$ vector (I think). Given my dataset, I would also be looking at roughly $3700$ equations in the system which seems a bit much. I also don't know how to approach the problem with minimizing both the overall variance and the individual pair variance.
Thanks in advance for any guidance!
EDIT: the nature of $f$
$f$ is of the form $f(X[i],Y[j]) = X[i] * Y[j] - C[i][j]$ where $C[i][j]$ is a constant looked up based on the vector indexes used.
Basically the root problem is, I have a set of values that were calculated for a given pair of vector indexes $i,j$. We need to calculate these a different way, but minimize the difference in the result vs the old calculation. The calculations are similar but not similar enough to allow an exact transformation between the two.