ratiominding

191 views
Skip to first unread message

Daniel Reeves

unread,
May 9, 2014, 5:17:11 PM5/9/14
to akratics
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.

--
http://dreev.es -- search://"Daniel Reeves"
Goal tracking + Commitment contracts == http://beeminder.com

Alex Schell

unread,
Jul 31, 2014, 7:50:32 PM7/31/14
to akra...@googlegroups.com, dre...@beeminder.com
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): https://www.beeminder.com/alexschell/goals/ratio

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 - p*yaw*lnw where p is a positive 'pessimism parameter' (set p to 0 for ratiominding).

Daniel Reeves

unread,
Aug 1, 2014, 2:53:46 PM8/1/14
to akratics
Hey Alex, I'm super curious if you reinvented that PPR formula or if
you got it from http://expost.padm.us/ppr

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?)
> --
> You received this message because you are subscribed to the Google Groups
> "Akratics Anonymous" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to akratics+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Alex Schell

unread,
Aug 1, 2014, 3:00:37 PM8/1/14
to akra...@googlegroups.com
Reinventing it with the same notation would be quite a feat :) 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.


You received this message because you are subscribed to a topic in the Google Groups "Akratics Anonymous" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/akratics/IGD90PxqAro/unsubscribe.
To unsubscribe from this group and all its topics, send an email to akratics+u...@googlegroups.com.

Daniel Reeves

unread,
Aug 1, 2014, 3:08:51 PM8/1/14
to akratics
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. :) But I
shall see if it's as simple as removing the paternalistic error!

Alex Schell

unread,
Aug 1, 2014, 3:17:15 PM8/1/14
to akra...@googlegroups.com
That would be nice! Definitely let me know if you're able to remove the error check.

Daniel Reeves

unread,
Aug 1, 2014, 3:20:26 PM8/1/14
to akratics
Done! Working for me as expected at beeminder.com/d/test -- 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!) :)

Alex Schell

unread,
Aug 1, 2014, 3:25:18 PM8/1/14
to akra...@googlegroups.com
Oh my. Very impressive support!! Thanks so much! I'll give this a try later.

Daniel Reeves

unread,
Aug 1, 2014, 3:41:18 PM8/1/14
to akratics
:) 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!"

Alex Schell

unread,
Aug 1, 2014, 4:31:47 PM8/1/14
to akra...@googlegroups.com
Haha, I'm not on Twitter. Go ahead and tweet it like that :)

Alex Schell

unread,
Aug 2, 2014, 4:25:58 PM8/2/14
to akra...@googlegroups.com
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. https://www.beeminder.com/alexschell/goals/otp. 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).

Daniel Reeves

unread,
Aug 2, 2014, 6:46:08 PM8/2/14
to akratics
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

Alex Schell

unread,
Aug 2, 2014, 11:59:07 PM8/2/14
to akra...@googlegroups.com, dre...@beeminder.com
Thanks, I didn't notice truemean in the list! No UVI then :/

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.
Reply all
Reply to author
Forward
0 new messages