I am trying to estimate digestion time for food given their nutritional content.
So the idea is a formula that takes nutritional content of a food as input and outputs time in hours:
f(x,y,z,u,v) = x*a + y*b + z*c + u*d + v*e
where x,y,z,u,v is the amount of kcal, carb, fat, prot, fib respectively. I wan't to estimate the weights a,b,c,d,e.
We know approximately how long chickpeas, oat meal and eggs take to digest so we can input their respective values, and get a system:
133*a + 12.6*b + 2.9*c + 8.13*d + 12.3*e = 1.5
375*a + 64.1*b + 6.98*c + 9.5*d + 7.5*e = 1.5
137*a + 0.4*b + 9.73*c + 12.25*d + 0*e = 0.75
And there could be some constraints, e.g. fat is probably the most important factor and all weights are positive:
c > a, c > b, c > d, c > e, a > 0, b > 0, c > 0, d > 0, e > 0
I'm wondering if there is any way to estimate these weights/constants? This is really dumbing down digestion, of course it depends more than just nutritional content. Also excuse me if this is a stupid question, I admit I have little knowledge of what I am attempting. The Solve-function in Mathematica gives no output so maybe there are too many possibilites or none at all.
The reason why Mathematica cannot solve the system is because no solution satisfying all of the constraints exists.
Relaxing the constraint $c > e$, and using
FindInstanceinstead ofSolve, I can getfor example.
But this isn't really what you want. The problem you have is that you aren't actually doing any statistical modeling. Your solution will not give you the desired insight because you lack sufficient data to fit a model, not because the system is inconsistent.
What I mean by this is that you have essentially collected a sample size of $3$ and are trying to fit a model with five free parameters, when the real relationship between the predictors (kilocalories, carbohydrates, fats, proteins, and fiber) and the response (digestion time) is subject to noise--i.e. variance not explained in the model. For example, digestion time may also be influenced by the person doing the digesting, when they are eating, how long it has been since their last meal, etc. So what a statistician does is collect much more data: look at digestion times of many individual subjects, and fit the model to that, knowing that a precise fit is not possible due to the unexplained variance, but on average (and given sufficient data) the model may provide underlying insights of the nature you describe; e.g., does fat and/or fiber content increase digestion time more than proteins and carbohydrates?