Beeminder Forum


Have you ever wanted to beemind a ratio, like being on time to more than half your meetings? Someone asked how to do that recently and I didn’t have a good answer but our own Alice Monday had a clever suggestion:

Make a Do Less goal for tardiness that has a rate of zero [1] and then every time you’re late you enter a 1, but every time you’re on time you enter a -1. (If you want to enforce less than 50% tardiness then being on time might only be a -.5, ie, you need to be on time twice to balance being late once.)

Slightly convoluted but I think it would work. Has anyone tried such a thing or have better ideas?

[1] Or 0.00001 since it won’t let you create it with a rate of exactly 0, though you can change it to exactly 0 with the road dial after it’s created.

PS: You could have the slope be, say, 1 per week which would mean you have to keep your lateness ratio below your threshold but you also get one freebie lateness per week. If you have lots of appointments that wouldn’t affect the ratio much.

I wanted to do this last year (to not be late to classes/appointments) and
just thought about it again now.

With some help from semi-autodata (or new functionality), this should be
doable in a way that’s visually nicer than Alice’s idea. Start with a new
Do Less goal with the target ratio set as your daily rate. Then enter your
data (in 0s and 1s) to a script that averages multiple datapoints per day,
and sends the cumulative sum to Beeminder (this horribleness is necessary
because aggday:mean and autosum aren’t compatible at the moment) Finally,
to “neutralize” days with no data, disable PPR and have the script add a
datapoint equal to your daily rate iff you haven’t entered any data that
day. This setup should also mesh nicely with the max safe days option, like
if you never want to exceed your ratio in any n-day period.

Here’s an example graph with some imported simulated data (try to ignore
the YBR):

An alternative to the script would be made possible by compatibility of
autosum and aggday:mean (not sure how feasible this is), and by a
customizable PPR: PPR = r - pyawlnw where p is a positive ‘pessimism
parameter’ (set p to 0 for ratiominding).

[migrated from Akratics Anonymous]

Hey Alex, I’m super curious if you reinvented that PPR formula or if you got it from

As for autosum + aggday=mean, I actually expect that to work fine. Why do you say they’re not compatible? (A long time ago they weren’t; is that what you’re remembering, or you tried recently and it’s not working?)

Reinventing it with the same notation would be quite a feat :slight_smile: I remembered it from the old post you made to this list.

I tried the autosum and aggday mean combination before I posted yesterday, and got an error message telling me it couldn’t plot the graph because they’re not compatible.

Doh! I think I refactored that so aggday and autosum are truly orthogonal but left in the error check. Possibly on purpose since aggday=mean with autosum is a super weird thing to want. :slight_smile: But I shall see if it’s as simple as removing the paternalistic error!

That would be nice! Definitely let me know if you’re able to remove the error check.

Done! Working for me as expected at – at first I thought it was wrong but it was just including the initial zero datapoint in the mean, which is the right behavior (given that you want to do something so crazy in the first place!) :slight_smile:

Oh my. Very impressive support!! Thanks so much! I’ll give this a try later.

:slight_smile: No problem. It’s an easy UVI for us! Speaking of which, do you have a twitter name? If not I’ll tweet it like this:
“Removed the needless error checks preventing craziness like aggday=mean for autosumming goals since crazy people like Alex Schell wanted it!”

Haha, I’m not on Twitter. Go ahead and tweet it like that :slight_smile:

Upon trying this out, I think I found another easy UVI for you guys: aggday=mean seems to behave like aggday=uniqmean.

See e.g. The datapoints are 0, 0, 0, 0, 1, 1, 1.1. The mean should be 0.3 but the aggregation (with aggday=mean) is 0.7, which is mean(0, 1, 1.1).

ah ha, you are right, but apparently that was on purpose, though i no longer recall why (something about the elaborate weight-loss rules we had in the early days). so “mean” is indeed an alias for “uniqmean” but you can pick “truemean” to not do the de-duping.

here’s the whole story, straight from the code, on all the possible aggday settings (as you can see, it’s dirt simple to add more if you have proposals):

AGGR = { # Map possible aggday settings to lambdas that aggregate thusly
'last'     : lambda x: x[-1],
'first'    : lambda x: x[0],
'min'      : lambda x: min(x),
'max'      : lambda x: max(x),
'truemean' : lambda x: np.mean(x),
'uniqmean' : lambda x: np.mean(deldups(x)),
'mean'     : lambda x: np.mean(deldups(x)),
'median'   : lambda x: np.median(x),
'mode'     : lambda x: scipy.mode(x),           # mma: Median@Commonest
'trimmean' : lambda x: scipy.trim_mean(x, 0.1),
'sum'      : lambda x: np.sum(x),
'jolly'    : lambda x: 1 if x else 0

Thanks, I didn’t notice truemean in the list! No UVI then :confused:

Anyway, I noticed that unlike Alice’s proposal, mine is not actually correct because it averages by day instead of averaging over all datapoints. For instance, day1 = [0]; day2 = [1, 1, 1] gets plotted as 0 + 1 = 1, whereas day1 = [1] and day2 = [0, 1, 1] gets plotted as 1 + 0.67 = 1.67; the actual value should be ratio * nday = 0.75 * 2 = 1.5. My approach is correct in expectation only if the ratio on a day is independent of the number of data points on that day.

The correct solution for visually appealing ratiominding is to plot the ratio so far (mean of all 0/1 datapoints) multiplied by the number of days since the goal started.

1 Like

… 4 years later… Has anyone come up with a workaround that doesn’t involve an external script?

For me, I’m trying to ratio mind to Toggl project times via IFTTT. If maybe there was an IFTTT “functions” service…

1 Like