Difference between revisions of "Recipe/Example/Cake"
(7 intermediate revisions by the same user not shown) | |||
Line 35: | Line 35: | ||
|+ Ciqual ingredients | |+ Ciqual ingredients | ||
|- | |- | ||
− | ! Nutrient !! Flour !! Sugar !! Egg !! Butter | + | ! Nutrient !! Flour !! Sugar !! Egg !! Butter !!! Salt |
|- | |- | ||
− | ! Ciqual !! 9445 !! 31016 !! 22000 !! 16400 | + | ! Ciqual !! 9445 !! 31016 !! 22000 !! 16400 !! |
|- | |- | ||
− | | Fat || 1.18 || 0 || 9.83 || 82.9 | + | | Fat || 1.18 || 0 || 9.83 || 82.9 || 0.0 |
|- | |- | ||
− | | Sat. Fat || 0.17 || 0 || 2.64 || 55.4 | + | | Sat. Fat || 0.17 || 0 || 2.64 || 55.4 || 0.0 |
|- | |- | ||
− | | Carbohydrates || 73.2 || 99.8 || 0.27 || 0.9 | + | | Carbohydrates || 73.2 || 99.8 || 0.27 || 0.9 || 0.0 |
|- | |- | ||
− | | Sugars || 1.77 || 99.8 || 0.27 || 0.83 | + | | Sugars || 1.77 || 99.8 || 0.27 || 0.83 || 0.0 |
|- | |- | ||
− | | Fiber || 4.2 || 0 || 0 || 0 | + | | Fiber || 4.2 || 0 || 0 || 0 || 0.0 |
|- | |- | ||
− | | Proteins || 9.95 || 0 || 12.7 || 0.7 | + | | Proteins || 9.95 || 0 || 12.7 || 0.7 || 0.0 |
|- | |- | ||
− | | Salt || 0 || 0.0054 || 0.31 || 0.063 | + | | Salt || 0 || 0.0054 || 0.31 || 0.063 || 97.8 |
|} | |} | ||
Line 147: | Line 147: | ||
[[Category:Recipe]] | [[Category:Recipe]] | ||
+ | |||
+ | ==== Ordered NNLS ==== | ||
+ | Deviance 0.044, flour and eggs are bound, implying they can be larger. | ||
+ | <gallery> | ||
+ | Pound_cake_recipe.png | Recipe | ||
+ | PoundCakeFit.png | Nutritional fit | ||
+ | PoundCakeStretch.png | Ingredient stretch (deviance < 1) | ||
+ | </gallery> |
Latest revision as of 14:33, 3 March 2025
Product
A plain cake (pound cake) with four ingredients, like this one. Or the category Pound cakes.
Data
Several scenarios:
Nutrient | Product | Ciqual Cake | Median Cake |
---|---|---|---|
Fat | 24 | 25.6 | 23 |
Sat. Fat | 15 | 15.8 | 7.4 |
Carbohydrates | 48 | 46 | 49 |
Sugars | 29 | 26.8 | 28 |
Fiber | 2 | 1.1 | 1.2 |
Proteins | 6 | 5.94 | 5.8 |
Salt | 1.4 | 0.52 | 0.8 |
For easy reuse:
Product (24,15,48,29,2,6,1.4) Ciqual (25.6,15.8,46,26.8,1.1,5.94,0.52) Median (23,7.4,49,28,1.2,5.8,0.8)
The nutritional values for the Ciqual ingredients.
Nutrient | Flour | Sugar | Egg | Butter | ! Salt |
---|---|---|---|---|---|
Ciqual | 9445 | 31016 | 22000 | 16400 | |
Fat | 1.18 | 0 | 9.83 | 82.9 | 0.0 |
Sat. Fat | 0.17 | 0 | 2.64 | 55.4 | 0.0 |
Carbohydrates | 73.2 | 99.8 | 0.27 | 0.9 | 0.0 |
Sugars | 1.77 | 99.8 | 0.27 | 0.83 | 0.0 |
Fiber | 4.2 | 0 | 0 | 0 | 0.0 |
Proteins | 9.95 | 0 | 12.7 | 0.7 | 0.0 |
Salt | 0 | 0.0054 | 0.31 | 0.063 | 97.8 |
Flour: (1.18,0.17,73.2,1.77,4.2,9.95,0) Sugar: (0,0,99.8,99.8,0,0,0.0054) Eggs: (9.83,2.64,0.27,0.27,0,12.7,0.31) Butter: (82.9,55.4,0.90.83,0,0.7,0.063)
Least squares fit
First pass
The table below present fit results. This compares the product against the ciqual ingredients.
model | Flour | Sugar | Butter | Eggs | Intercept | sumR2 |
---|---|---|---|---|---|---|
lm | 0.265 | 0.274 | 0.249 | 0.182 | 0.994 | 0.30 |
lm forced intercept | 0.267 | 0.283 | 0.257 | 0.250 | - | 2.468 |
nnls | 0.267 | 0.283 | 0.257 | 0.250 | - | 2.486 |
The lm forced intercept gives optimal results.\, nnls is overdone.
Salt
Largest residual for salt. Can we add that in?
model | Flour | Sugar | Butter | Eggs | Salt | sumR2 |
---|---|---|---|---|---|---|
lm forced intercept | 0.267 | 0.283 | 0.257 | 0.250 | 0.013 | 0.783 |
Residuals
The residuals for each nutrient are plotted in the graph. The amount of fiber is not well fitted (but still below 1). Can this be due to the nutritional values of flour? This is the only ingredient that contributes to fiber.
Wheat types
Replace the wheat type 80 with Wheat type 110 (9410). This increases the amount of fiber from 4.2 to 6.8.
Wheat flour type 110: (1.5,0.27,68.6,1.6,6.8,9.61,0.13)
Residual for fiber is reduces to 0.07. The variance to 0.015 (was 0.783).
Wheat flour type 150 (9415): (1.52,0.22,64.9,1.77,10.2,11.4,0.035)
Residual for fiber changes to -1.0. And variance to 1.08. Wheat type 100 seems to give the best fit.
Butter oil
Instead of using butter we could use butter oil. The product mentions Beurre pâtissier, which is closer to butter oil. Try this (keeping the original wheat T80):
Butter oil: (99.9,61.9,0,0,0,0.28,0.005)
This increases the residual for fat to 0.8 and the variance to 1.712. Clearly a worse fit.
Dextrose
The ingredient list also mentions dextrose. This is not available in the Ciqual list. But probably the nutrients are the same as sugar and we probably will not be able to distinguish one from the other.
Probably this is due to the ratio Saturated Fat over Fat. For butter this is: 0.67 and for butter oil 0.62.
Nutrients blame
Conclusions
What is now the best recipe? Should we look at the overall variance or also take the maximum residual into account? A figure:
- Lowest max residuals and variance seems best;
- Adding salt reduces the salt residual;
- Find the correct wheat by trying several varieties;
- Beurre pâtissier is closer to butter than butter oil;
This gives the recipe:
model | Flour | Sugar | Butter | Eggs | Salt | variance |
---|---|---|---|---|---|---|
lm forced intercept | 0.28 | 0.28 | 0.26 | 0.24 | 0.01 | 0.015 |
john (no constraints) | 0.28 | 0.28 | 0.26 | 0.24 | 0.01 | 0.015 |
ConsReg (no constraints) | 0.27 | 0.26 | 0.25 | 0.25 | 0.01 | |
ConsReg (positive) | 0.27 | 0.26 | 0.25 | 0.25 | 0.01 | |
ConsReg (order constraint) | 0.29 | 0.27 | 0.24 | 0.28 | 0.02 |
Ordered NNLS
Deviance 0.044, flour and eggs are bound, implying they can be larger.