Recipe/Theory/Linear algebra

From Open Food Facts wiki
Jump to navigation Jump to search

I have been puzzled by the fact that many of the solutions we find are exact (variance 0). This would imply that the LS-fit found an exact solution, which is only possible for a determined system of equations. The answer lies in the bound ingredients. A bound ingredient puts two ingredients together and treats them as one. This reduces a product with 8 ingredients and 6 nutrients to one of 6 ingredients. And this makes the problem determined. There is no longer need for fitting and one can just solve the remaining 6 equations. And indeed if I solve those equations, I get the same results as the LS-fit.

So we have been overcomplicating things. The LS-fit always seems to reduce the complexity. If we can find out how it does this, the recipe question is reduced to a linear algebra problem. Whether one can reduce the complexity of the equations is related to the rank of the matrix (read ingredients). Two ingredients that are to similar decreases the rank, which allows the LS-fit to reduce the number of ingredients used. And then linear algebra can be used to find the recipe.

For an overdetermined system (more ingredients than nutrients) there is theoretically no single solution. The recipe stretching confirm this. Stretching breaks the bound ingredients, but then bounds another ingredient. And this gives again an exact solution. When one stretches to much even bounding does not help and one needs a LS-fit to find a solution. Where lies these break points? If we can define these break points, we could define a range of possible recipes for product. I suspect this can be solved mathematically.

Determined products

These are products where the number of ingredients equals the number of nutrients. For these products we can directly calculate the recipe. No fitting required.

Rank

This only works however when the ingredients are full rank, that is no ingredient can be defined as a sum of other ingredients. An added complexity is that one has to determine the non-negative rank to be sure of this. (Can not find an application that calculates this).

If the ingredients are NOT full rank, the product becomes underdetermined.

Underdetermined systems

These are products where the number of ingredients is less than the number of nutrients.

Overdetermined systems

These are products where the number of ingredients is more than the number of nutrients. In principle these products require a LS-fit. However LS-fits seem to bound ingredients and will transform it to a determined system.

References