Old Faithful Wait Predictor

Nikhil Sah

A simple Shiny app: how long until the next eruption?

5 slides. Use the arrows or the left/right keys.

The problem

Visitors to Old Faithful want to know how long the next wait will be.

  • Recorded waits run from 43 to 96 minutes, so a single average helps little.
  • Longer eruptions are followed by longer waits (correlation 0.9).

Who it is for: curious visitors and students. No R or statistics needed.

How the app works

  1. Drag the slider to the length of the last eruption.
  2. Choose how sure the range should be: 50%, 80% or 95%.
  3. Read the sentence and the chart. Both update instantly.

Behind the scenes, server.R fits a straight-line model and predicts from your inputs.

The “How to use” tab explains everything inside the app.

The model, live

A 4 minute eruption, 95% prediction range:

fit <- lm(waiting ~ eruptions, data = faithful)
new <- data.frame(eruptions = 4)
round(predict(fit, new, interval = "prediction"))
##   fit lwr upr
## 1  76  65  88

This code ran when the slides were built. Eruption length explains about 81% of the variation in waits.

Try it yourself

App: https://v3sper.shinyapps.io/old-faithful-wait/

Free, runs in the browser, nothing to install.

Move the slider and watch the prediction change.