Recipe/Example/Four Nut Mix

From Open Food Facts wiki
Jump to navigation Jump to search

Product

This product with four ingredients will be used to find the recipe. The ingredients states that 25% of each nut (walnut, hazel nut, cashew nut and almond) was used.

Data

Four scenarios:

Four nuts product
Nutrient Product Ciqual Expected Median Expected
Fat 58.0 58.7 56.2
Sat. Fat 6.4 5.95 5.78
Carbohydrates 6.4 11.09 13.5
Sugars 4.2 4.63 4.08
Fiber 8.5 7.93 7.16
Proteins 20.4 16.63 17.33
Salt 0.01 0.042 0.006

For easy reuse:

(58.0, 6.4, 6.4, 4.2, 8.5, 20.4, 0.01)

The nutritional values for the Ciqual ingredients.

Ciqual ingredients
Nutrient Walnuts Hazelnuts Cashews Almonds
Fat 67.3 66 49 52.5
Sat. Fat 6.45 4.51 8.87 3.95
Carbohydrates 6.88 5.21 23.5 8.76
Sugars 3 4.26 6.63 4.63
Fiber 6.7 9.4 5.7 9.9
Proteins 13.3 14.4 17.4 21.4
Salt 0.1 0 0.02 0.048
((67.3, 6.45, 6.88, 3, 6.7, 13.3, 0.1), (66, 4.51, 5.21, 4.26, 9.4, 14.4, 0), (49, 8.87, 23.5, 6.63, 5.7, 17.4, 0.02), (52.5, 3.95, 8.76, 4.63, 9.9, 21.4, 0.048))

The nutritional values based on the OFF category ingredients.

OFF median ingredients
Nutrient Walnuts Hazelnuts Cashews Almonds
Fat 65 60 46.7 53
Sat. Fat 6.1 4.1 8.93 4
Carbohydrates 10.5 4.3 28.6 10
Sugars 3 3.2 6 4.1
Fiber 6.67 7.5 3.57 10.9
Proteins 15.2 15 17.7 21.4
Salt 0.01 0.002 0 0.01

Least squares fit

Adrian Stoll site

The table below present four fit results using this. This compares the Ciqual ingredients against the OFF median ingredients. And for the product itself and the calculated expected product.

The calculated results are pretty good.

The product results are way off. Negative values should not be allowed. Are the nutritional values of products so sensitive to the values of ingredients used? Or is this a big error in the product? The carbohydrates seem much too small. Increasing them to 10, will at least give positive values for the recipe, but nowhere near the expected results.

Fitting results
model Walnuts Hazelnuts Cashews Almonds
Ciqual 0.88 -0.69 -0.19 1.01
Calculated+Ciqual 0.25 0.25 0.25 0.25
Median -0.96 1.55 0.27 0.28
Calculated+Median 0.27 0.23 0.25 0.25

R studio

The table below present four fit results using this. This compares the Ciqual ingredients against the OFF median ingredients. Four different least square methods have been used. the nnls and the glmnet force a solution with positive values.

Fitting results
model Walnuts Hazelnuts Cashews Almonds
lm 0.88 -0.85 -0.25 1.02
lm forced intercept 0.89 -0.69 -0.19 1.02
nnls 0.305 0.00 0.00 0.715
glmnet 0.240 0.072 0.000 0.709

Conclusion is that better fitting methods cannot repair a product that seems wrong.