Difference between revisions of "Recipe/Theory/Statistics exploration"

From Open Food Facts wiki
Jump to navigation Jump to search
Line 1: Line 1:
 
Finding the [[Recipe/Definition|recipe]] of a product based on the list of ingredients and nutritional values, is a statistical problem of [https://en.wikipedia.org/wiki/Linear_regression Linear regression] for which a lot of theory exists. The recipe fitting problem is very specific and it is a bit difficult to find the right statistical approach in all the dense wikipedia pages.
 
Finding the [[Recipe/Definition|recipe]] of a product based on the list of ingredients and nutritional values, is a statistical problem of [https://en.wikipedia.org/wiki/Linear_regression Linear regression] for which a lot of theory exists. The recipe fitting problem is very specific and it is a bit difficult to find the right statistical approach in all the dense wikipedia pages.
= Terminology =
+
== Terminology mapping ==
 +
We are not used to the terminology used in linear regression statistics, so some translation is needed:
 +
* dependent variables / observed values ('''y''') - these comparable to a nutrient of the product;
 +
* regressors / independent variable ('''x''') - this is a nutrient in an ingredient;
 +
* regression coefficients ('''β''') - the recipe fraction;
 +
* error term (ε) - the deviation from the fit;
 +
 
 +
This gives the relation:
 +
 
 +
'''y''' = '''X''' '''β''' + '''ε'''
 +
 
 +
In this matrix equation the '''X''' is the independent variable '''x''' corresponding to each '''β''. This is where the correspondence with [[Recipe/Estimation|recipe estimation]] starts to break. The recipe estimation is much simpler:
 +
* there is only one product, so only 1 observed value;
 +
* as there is only 1 observed value, we have only one independent variable
 +
* and with

Revision as of 13:50, 21 January 2025

Finding the recipe of a product based on the list of ingredients and nutritional values, is a statistical problem of Linear regression for which a lot of theory exists. The recipe fitting problem is very specific and it is a bit difficult to find the right statistical approach in all the dense wikipedia pages.

Terminology mapping

We are not used to the terminology used in linear regression statistics, so some translation is needed:

  • dependent variables / observed values (y) - these comparable to a nutrient of the product;
  • regressors / independent variable (x) - this is a nutrient in an ingredient;
  • regression coefficients (β) - the recipe fraction;
  • error term (ε) - the deviation from the fit;

This gives the relation:

y = X β + ε

In this matrix equation the X' is the independent variable x corresponding to each β. This is where the correspondence with recipe estimation starts to break. The recipe estimation is much simpler:

  • there is only one product, so only 1 observed value;
  • as there is only 1 observed value, we have only one independent variable
  • and with