Skip to main content

Wake Up with Bayes

Here's an example of how you could run an experiment for the "Does bedtime impact waking up?" example from class (needs drawings, explanations, and annotations; this is NOT a full example of a perfect design challenge):

  • A: Belief that I will wake up in the morning at a particular time.
  • B: Evidence of how bedtime conditions my morning wake-up time.

A ∈ {4am, 5am, 6am, 7am, 8am, 9am, 10am, 11am, 12pm, 1pm}

B ∈ {5pm, 6pm, 7pm, 8pm, 9pm, 10pm, 11pm, 12am, 1am, 2am}

Analytical setup​

  • P(A): 1/10 because there are 10 wake-up times.
  • P(B): 1/10 because there are 10 bedtimes.
  • P(B|A): Probability that I have gone to bed at a particular time given when I am observed to wake up. Needs a rhetorical justification or simulated data with an explanation. For example, I never sleep fewer than 4 hours or more than 12 hours, so P(B=2am|A=4am) = 0, but P(B=5pm|A=4am) = 1/8 because 1am and 2am are impossible, but anything else is not impossible with that outside knowledge of your sleep behaviour.
  • P(A|B): Probability that I will wake up at a particular time given when I have gone to bed. Needs a rhetorical justification or simulated data with an explanation. For example, I never sleep fewer than 4 hours or more than 12 hours, so P(A=4am|B=2am) = 0, but P(A=4am|B=5pm) = 1/2 because there are only 2 possibilities that are within the 12-hour maximum window.

Experimental setup​

I will record in a table my actual bedtimes and actual wake-up times for a month, which will look like this:

DayBedtimeWake-upDuration
111:10 PM7:15 AM8h 05m
211:35 PM7:30 AM7h 55m
310:55 PM7:05 AM8h 10m
412:05 AM8:00 AM7h 55m
511:45 PM7:40 AM7h 55m
612:30 AM9:00 AM8h 30m
71:10 AM9:45 AM8h 35m
811:20 PM7:20 AM8h 00m
911:50 PM7:10 AM7h 20m
1011:05 PM7:15 AM8h 10m
1112:15 AM7:35 AM7h 20m
1211:30 PM7:40 AM8h 10m
1312:45 AM9:10 AM8h 25m
141:30 AM10:00 AM8h 30m
1511:00 PM7:00 AM8h 00m
1611:25 PM7:30 AM8h 05m
1712:00 AM7:15 AM7h 15m
1810:50 PM7:05 AM8h 15m
1911:40 PM7:30 AM7h 50m
2012:20 AM8:55 AM8h 35m
211:05 AM9:30 AM8h 25m
2211:15 PM7:20 AM8h 05m
2311:55 PM7:25 AM7h 30m
2411:05 PM7:10 AM8h 05m
2512:10 AM7:20 AM7h 10m
2611:30 PM7:45 AM8h 15m
2712:40 AM9:00 AM8h 20m
281:15 AM9:50 AM8h 35m
2911:20 PM7:20 AM8h 00m
3011:45 PM7:30 AM7h 45m

Probability of wake-up times: P(A)​

Here is P(A) if we have 15-minute intervals for discretization:

Wake-up time (A)CountP(A)
7:00 AM30.1000
7:15 AM90.3000
7:30 AM60.2000
7:45 AM30.1000
8:00 AM10.0333
9:00 AM30.1000
9:15 AM10.0333
9:30 AM10.0333
9:45 AM20.0667
10:00 AM10.0333

Probability of bedtimes: P(B)​

Here is P(B) if we have 15-minute intervals for discretization:

Bedtime (B)CountP(B)
10:45 PM10.0333
11:00 PM40.1333
11:15 PM40.1333
11:30 PM40.1333
11:45 PM40.1333
12:00 AM30.1000
12:15 AM30.1000
12:30 AM10.0333
12:45 AM20.0667
1:00 AM10.0333
1:15 AM20.0667
1:30 AM10.0333

Conditional probability: P(B|A)​

Wake-up time (A)Bedtime (B)P(B|A)
7:00 AM10:45 PM0.3333
7:00 AM11:00 PM0.6667
7:15 AM11:00 PM0.2222
7:15 AM11:15 PM0.4444
7:15 AM11:45 PM0.1111
7:15 AM12:00 AM0.1111
7:15 AM12:15 AM0.1111
7:30 AM11:30 PM0.3333
7:30 AM11:45 PM0.3333
7:30 AM12:00 AM0.1667
7:30 AM12:15 AM0.1667
7:45 AM11:30 PM0.6667
7:45 AM11:45 PM0.3333
8:00 AM12:00 AM1.0000
9:00 AM12:15 AM0.3333
9:00 AM12:30 AM0.3333
9:00 AM12:45 AM0.3333
9:15 AM12:45 AM1.0000
9:30 AM1:00 AM1.0000
9:45 AM1:15 AM1.0000
10:00 AM1:30 AM1.0000

Conditional probability: P(A|B)​

Bedtime (B)Wake-up time (A)P(A|B)
10:45 PM7:00 AM1.0000
11:00 PM7:00 AM0.5000
11:00 PM7:15 AM0.5000
11:15 PM7:15 AM1.0000
11:30 PM7:30 AM0.5000
11:30 PM7:45 AM0.5000
11:45 PM7:15 AM0.2500
11:45 PM7:30 AM0.5000
11:45 PM7:45 AM0.2500
12:00 AM7:15 AM0.3333
12:00 AM7:30 AM0.3333
12:00 AM8:00 AM0.3333
12:15 AM7:15 AM0.3333
12:15 AM7:30 AM0.3333
12:15 AM9:00 AM0.3333
12:30 AM9:00 AM1.0000
12:45 AM9:00 AM0.5000
12:45 AM9:15 AM0.5000
1:00 AM9:30 AM1.0000
1:15 AM9:45 AM1.0000
1:30 AM10:00 AM1.0000

Discussion​

As we can see, the analytical and experimental setups vary greatly.

An experimental setup may suffer from not having enough data, like the above experiment, or have some other kind of bias. However, an experimental setup may be an accurate description of what really happens.

An analytical setup may suffer from not being realistic or have unaccounted-for factors that are missed during analysis. However, an analytical setup may be more accurate in modelling a real-world example where the experiment is impossible to run.

For example, it is not truly the case that you are guaranteed to wake up exactly at 9:30 AM if you went to bed at 1:00 AM, as the experimental results show. It's probably closer to the 1/9 chance suggested by the analytical results.

The question is: What is this modelling?

If this is a prediction about tomorrow, then the analytical result may be more helpful, but the experimental data may give you a more realistic analytical model.