Filling in missing nutrients using list of ingredients and subset of nutrients on product label

Issa
edited November 2020 in Feature Requests

Currently Cronometer has detailed nutrient info for generic foods but for most brand name products it only has nutrient info for the subset of nutrients shown on the product label. However using the subset of nutrient info that we do have, the list of ingredients, and the full nutrient info for raw ingredients, it is possible to calculate the full nutrient info even for brand name product using some linear algebra.

I worked out an example of this here for White Cheddar Cheez-It (which is in NCCDB so it allowed me to check my answer). The 14 by 5 matrix which I've colored in red (which we can call A) contains nutrient data for the subset of nutrients listed on the Cheez-It product label for the ingredients listed on the label, and the column vector in blue (which we can call b) contains the amounts of these nutrients in a single serving of Cheez-It. We can then solve the equation Ax=b for x=(0.03281516, 0.00095824, -0.20663541, 0.46697774, 0.53396558), which gives the amounts of each ingredient in a single serving of Cheez-It. It is then possible to use x to find the amounts of nutrients not listed on the product label, such as magnesium, phosphorus, and manganese (colored in yellow). When I did this, I got 9.5mg of magnesium (compared to 6.1mg for actual Cheez-It), 78mg of phosphorus (compared to 34.2mg for actual Cheez-It), and 0.16mg manganese (compared to 0.2mg for actual Cheez-It). As you can see, the amounts can be off by quite a bit, probably because I had to guess the kind of flour and cheese used. But this still seems better than nothing. (One subtlety is that as the number of ingredients goes up, it becomes harder to ensure that a unique solution exists.)

I'd like to have the process above automated so that if I enter a brand name product (especially in cases where no equivalent generic product exists), it is possible to include info on all nutrients, not just those listed on the product label.

I found one user, robartsd, who did something similar and even made a spreadsheet to make this math easier, but there is still way more friction than I would like.

Comments

  • Unless the food has been laboratory tested I fail to see how you can apply lab tested results to non lab tested results. In my experience, over the past 6 months, it is simpler to find a lab tested food that is approximately right on the calories, fat, carbs and use that. To be honest it really does not matter if you are a few calories out or a few mg of a mineral especially since having investigate some product with the manufacturers I found that their figures are not exactly accurate either. In some respects what you are suggesting is akin to Volkswagens fuel emissions figures and we know what they were. Just my opinion of course but I can't honestly see how Cronometer could put their name to such a system. The risks for them should be apparent to you.