How to determine and correct bias in your data (Motivation Decay Part 6)

  • by

We now have a new hypothesis to test. How well does our porposed algorithm fit the data. As a quick reminder – we settled in part 4 on the likely algorithm of

T = 250 – 72 x log10 (CP)

We can compare the calculated to the observed values. Unfortunately we see a clear bias in the calculated values.

CPDecayStdevHoursHours calcDiff (in seconds)
274410.0000.0038.002.44na
235510.0050.0038.007.22na
23209.9990.0238.007.681136
23109.7850.0138.187.821282
23039.6750.0118.277.911275
21437.6060.00810.5210.171266
20296.5470.00312.2211.881237
19135.6840.00314.0713.721287
18275.1680.00315.4815.151170
14543.5330.00422.6522.301263
10952.5430.00431.4631.161080
10192.3550.01433.9633.411988
9712.2700.00435.2434.921148
9692.2690.00335.2634.98976
9422.2020.02836.3235.871636
7311.8110.00344.1743.801325
6571.6840.00347.5047.141299
5001.4380.01355.6255.67-201
3591.1980.01266.7866.032690
3001.1100.00172.0771.651522
1001.1270.04170.98106.00na
951.1790.05167.86107.60na
101.111na72.00178.00na

On average all predicted times are too small. Taking the average off only the best data (stdev < 0.05) we get a positive bias of 1231 seconds. We can easily correct this in the function by rounding it to 1200 seconds and using 250 1/3 hours. This is also closer to the actual best fit.

Personally I opted to use 1269 seconds instead to get a value of 250.35 hours. So why do I think the final value is 250.35 hours?

Remember the Farfetched from Part 5. I had selected the Farfetched because of the CP it represented – and because I like rounding to close numbers. Mathematically I should have taken the closest CP to 296.6.

Using 72 and 250 I calculate 71.647 hours as expected values for the time it takes for the motivation to decay to the minimal value. But this misses the point from the game developer. What if the programmer was asked to keep it flat until 300 CP and from there onward motivation decays more rapidly.

As game developer I face the following function

72 = k – 72 x log10 (300)

Solving this equation for k results in 250.35273 – with 0.35273 hours being 1269 seconds.

I therefore propose that the final answer to the motivation decay is

T(max) = 250.35 hours – 72 hours x log10 (CP)

Below 300 CP T(max) is fixed to 72 hours. Above 2320 CP t(max) is fixed to 8 hours. We can now use this information to calculate the hourly decay as 80 / T(max)

CP rangeHourly decay in %
10-3001.11% (or more precice 80/72 %)
300-232280 /
( 250.35 hours – 72 hours x log10 (CP) )
2323+10%

2 thoughts on “How to determine and correct bias in your data (Motivation Decay Part 6)”

  1. In case you don’t see my reply on reddit, you can rework the formula to eliminate the 250.35[…] constant:

    cp_decay(cp) = 1/((72/0.80) * (log10(300 / cp) + 1))

    Where 72 hours is the max decay time. 0.80 is the max decay amount. 300 is the CP floor.

    1. I actually saw the reply on reddit first – as well as your png with the curve you produced. I hope you are ok that I use your plot in my next article. Actually my very first successful fitting attempt was: T(max) = -1.3044 ln(x) + 10.44. This is days not hours. I played around with days/hours/seconds at that stage as I assumed we are looking for some round numbers but don’t know what the programmers use as time scale. I realised this is the same as 3 log10(x) + 10.44 but 10.44 seemed so close to 250 that I used 72 hours and 250 instead of 3 days and 10.44 days.
      Maybe time to revisit and play around with different values – we could even try milli-seconds as I think this is the accuracy they use.

Comments are closed.