I want to solve a matrix system which have several solutions (infinite since it is overdetermined - 6 equations with 8 unknowns). However, the way I want to do it is to a criterion for the variables, which should be minimized, to find a specific solution. I am working in R
My first through was to use constrOptim in R However, this requires for me to set constraints that are equalities, and not "larger than or equal to", which is the the default in constrOptim.
The problem is essentially that I have a matrix, where I know none of the elements, and I want the the rowSums to have specific values, and the colSums to have specific values. This however, should be done while minimizing criterias that the i,j element divided by the sum of the i'th row, should be as close as possible to the sum of the j'th column divided by the sum of the whole matrix.
Does anyone know how I could solve this problem using constrOptim, or by using another function?