Finding a vector that minimizes an error

331 Views Asked by At

Having

$\mathbf{E}_{M\times 1} = \mathbf{T}_{M\times 1} - \mathbf{Q}_{M\times L}\times \mathbf{P}_{L\times 1}$

Where the subscripts are the size of the matrices and I know $\mathbf{T}$ and $\mathbf{Q}$, I want to find $\mathbf{P}$ such that $\mathbf{E}$ is minimum.

I know that this problem has already been dealt with but I can't remember how to solve it. I guess I should use the MSE to minimize $\mathbf{E}$ though I'm not completely confident.

The problem I'm dealing with is: $\mathbf{T}$ is a row-vector of totals (dollars), $\mathbf{Q}$ is a matrix of quantities of products and $\mathbf{P}$ is a column-vector of prices. So the element $k$ of $\mathbf{T}$ is the total that client $k$ paid (there are $M$ clients), the row $k$ of $\mathbf{Q}$ is the amount of products ($L$ different products) that client $k$ bought, and the column-vector $\mathbf{P}$ contains the prices of each product.

What I don't know is the price of each product, so my approach to estimate it is trying to minimize $\mathbf{E}$. I'm explaining this because perhaps the MSE is not the best function to try to minimize, or perhaps there's a better approach.

Edit: I'm looking for an adaptive way of doing this, as the matrices are huge and calculating and inverse is not feasible.