Difference between revisions of "Recipe/Theory/Degrees of freedom"

From Open Food Facts wiki
Jump to navigation Jump to search
 
(2 intermediate revisions by the same user not shown)
Line 9: Line 9:
  
 
== No intercept constraint ==
 
== No intercept constraint ==
Unfortunately a total free approach can give nonsense results. A total free approach does not assume anything.
+
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 ==
 +
 
 +
[[Category:Recipe]]

Latest revision as of 08:50, 27 February 2025

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