# Estimate optimal parameters

We are given a set of $$K_1$$ vectors $$a_{i} \in \mathbb{R}^{N}$$, $$1 \leq i \leq K_1$$; $$K_2$$ vectors $$b_{j} \in \mathbb{R}^{N}$$, $$1 \leq j \leq K_2$$; and a set of $$K_1$$ matrices $$A_{i} \in \mathbb{R}^{N \times N}$$, $$1 \leq i \leq K_1$$. We are also given two binary vectors, $$v \in \mathbb{R}^{K_1}$$ and $$u \in \mathbb{R}^{K_2}$$. Each vector contains at least one $$1$$.

We seek a matrix $$M \in \mathbb{R}^{N \times N}$$ that satisfies the following property. First, we use the matrix $$M$$ to compute another matrix $$W \in \mathbb{R}^{K_1 \times K_2}$$ with each element $$w_{ij} = (a_i - b_j)^{T} (A_i + M)^{-1} (a_i - b_j)$$. Then, we take row-wise and column-wise maximum of the matrix $$W$$, to get two vectors $$\tilde{v} \in \mathbb{R}^{K_1}$$ and $$\tilde{u} \in \mathbb{R}^{K_2}$$. The property $$M$$ should satisfy is that the maximum entries in $$\tilde{v}$$ should correspond to the $$1$$-values in $$v$$; and the maximum entries in $$\tilde{u}$$ should correspond to the $$1$$-values in $$u$$.

What methods can be used to solve such problems?