Skip to content

Esm scheduling

Bob Evans edited this page Oct 9, 2013 · 1 revision

ESM scheduling is based on two fundamental ideas. Both are designed to get rid of biases.

  • Sample the user at random times throughout the day
  • Focus the sample on momentary events

This technique is also known as Ecological Momentary Assessment, primarily in the sociology and behavioral medicine communities.

The technique was pioneered by Csikszentmihalyi at the University of Chicago (now at Claremont Graduate University). We have the good fortune to have worked on Paco with both Csikszentmihalyi and one of his co-creators of ESM, Barbara Schneider (Michigan State University) as well as many of their graduate students.

Generating the ESM schedule

When the Android Beeper Service asks an Experiment configured for an ESM signaling mechanism, there is an ESMScheduleGenerator that produces a schedule if none has been generated and then returns the nearest time in that schedule.

The algorithm uses what I call a bucketed random generation that is taken from the Csikszentmihalyi methods book from 2007 (Hektor, et. al). The researcher specifies:

  • The frequency, or number, of signals per period
  • The period (day/week/month). Almost always 'day'.
  • The start time of day
  • The end time of day
  • The timeout period for the Notification
  • The minimum buffer between signals

The algorithm looks to see if there is a schedule generated for the next 'period' amount of time. If not, it takes the start time and the end time multiplied by the number of days in the period. It then splits these evenly into 'frequency' buckets. Next it generates a random time in the first bucket. It records that time. It repeats that, making sure that the next signal is at least 'minimum buffer time' away from the previous signal. It continues until it has covered each bucket.

It persists this schedule in a datastore table on the phone for retrieval the next time it is asked for a scheduled time.

Clone this wiki locally