Condition Effect Learning

From AardRock Wiki
Jump to navigation Jump to search

This page reflects my idea about the Condition Effect Learning system. If you have comments, please dont delete text but add comments so I can reflect. See this as a first draft, which can be used as a basis for the Cheetah condition effect learning system.

As said in Advisory System, Cheetah needs a system that learns about the effect of certain conditions. As you can read in Advisory System, I think there are three kinds of conditions:

  1. Certain conditions: the effect is known and fixed.
  2. Uncertain conditions: the effect is not certain or not known yet. These effects are to be learned by the system.

There are some comlications regarding learning about condition (e.g. food) effects. Since each human and each body is different, conditions dont always have a fixed certain effect. Food for instance has a GL (Glycamic Load) that tells about the effect of the food on BG (Blood Glucose) levels. Food effect (response) varies between individuals and between days as much as 20%. Likewise, effect of insulin and activities varies between people and temporally. Therefore, to account for individual and temporal differences, I think it is a good thing to generally express condition effect some range instead of a simple number. Such a range could be a probability distribution, or expressed as (minimum,maximum) couple. For Cheetah 'Learning' about conditions means assigning such a range or distribution to it. There are several levels of expressing such variation in terms of a range or distribution. I solved the first one, but not yet the second and third.

  1. An effect range with a MIN and MAX value. E.g. a minimum and maximum BG effect. Therefore, to account for individual and temporal differences, I think it is a good thing to generally express condition effect by a range instead of just a single number.
  2. A discrete distributed function.
  3. A standard normal distribution (continues).

Learning an effect range with MIN and MAX value

With this system, all conditions X have a Xhardmin and Xhardmax variables which tells the system the hard minimum and maximum of effect. For example, [research] has pointed out that a can of Coca-Cola has a Glycemic Load of minimally 14 and maximally 16. So CocaColahardmin=14 and CocaColahardmax=16. So, CocaCola could be a type 1 condition because it has a certain effect. When a user adds a new food type X to the database, it can add information like carbonhydrate(%), GI and such, to help the system determine Xhardmin and Xhardmax.


So, all conditions have a minimum and a maximum effect.
Suppose c is a condition, then:
<math>c_{min}, c_{max} \in \mathbb{R}</math>
<math>c_{min} \le c_{max}</math>


Also, conditions can be contained in a group (set) of conditions A:
S = {c1, c2, ...}
Like conditions, such group of conditions S also has minimum and maxmimum cumulative effect. Such effect is the sum of all of the effects of its contained conditions:
Smin = c1min + c2min + ...
Smax = c1max + c2max + ...


Using logics, set theory, intuition and commson sense, I came up with the following theorem. Lets call it Kingma's Theorem :). I havent formally proved it yet, but this seems to be true for all cases. Its actually quite logical.
if e is a port of set S (so S-e is set S minus condition c')
and Smin and Smax are known
and chardmin and chardmax are known
then can be said:
S-cmin = Smin - chardmax
S-cmax = Smax - chardmin


Lets assume that at each blood glucose (BG) measurement, Cheetah starts its learning system. Cheetah looks at all conditions that could have an effect, and puts all type 1 conditions into group CE (certain effect) and all type 2 into group UE (uncertain effect). Then, cheetah calculates the difference (min and max) between the BGmeasurement and predicted CE group effect. This difference should equal the UE group effect. So:
BGmeasurement = UEreal + CEreal
So:
UEmin = BGmeasurement - CEmax
UEmax = BGmeasurement - CEmin


UE is the range of the sum of the to be learned conditions. These conditions all have their own effect range, chardmin and chardmax. But because the sum of effects (UE) is restricted , each individual effect for each condition must be somewhat more restricted. The possible effect range for each effect can be deduced from the total effect and the hardmin and hardmax value of the other effects. Using Kingma's Theorem, one can deduce the effect range of each individual condition.

[Example is to be added]


Then, the ΔG(min and max) is calculated: the difference between predicted(min and max) and measured BG levels. Also, the set C of all type 2 and 3 conditions is assembled:

The model tells system G<small>predicted, min</small> and G<small>predicted, max</small>

ΔG<sub>min</sub> = G<sub>measured</sub> - G<sub>predicted, max</sub><br/>
ΔG<sub>max</sub> = G<sub>measured</sub> - G<sub>predicted, min</sub><br/>
set C contains all type 2 and 3 conditions

If <i>C</i> contains only one condition <i>c</i>, it is quite easy for the system to directly assign ΔG<sub>min</sub> and ΔG<sub>max</sub> to <i>c</i>. The story gets less trivial when C contains multiple conditions.