Recipe/Theory/Degrees of freedom

From Open Food Facts wiki
Revision as of 12:26, 21 February 2025 by Aleene (talk | contribs) (Aleene moved page Recipe/Degrees of freedom to Recipe/Theory/Degrees of freedom: better)
Jump to navigation Jump to search

It is easy to draw to many conclusions out of the limited data. The degrees of freedom concept describes what can be done. This will be explored here.

The limit will be the number of nutrients available for a product. Usually there are 7 nutrients, but when there is no fiber there will be 6 nutrients.

Deterministic

With 7 nutrients we could theoretically determine a recipe of 7 ingredients. This becomes a problem with 7 equations with 7 unknowns. If there are more ingredients, the problem will be unsolvable.

For products with less than 7 ingredients, the problem will be easier to solve, especially when some ingredients are zero.

No intercept constraint

Unfortunately a total free approach can give nonsense results. A total free approach does not assume anything. So it will use the intercept as free variable as well. This is clearly nonsense, as it implies that a product has nutrients even if there are no ingredients. So we need to enforce an offset of zero.

As we thus limit the possibilities, the degrees of freedom go dwon. Does this mean that we can fit one ingredient less as well?

Positive ingredients only constraint