Lesson 6b

A

Locked — confirm your name above to begin.

Obviously the birds are going to have a different birth rate and death rate every single year. You could find the 19 different birth rates and 19 different death rates to perfectly fit the first twenty years of the Grants' counts.

So do it. Fit one year by hand, then take the rest.

But if you do that: what's the death rate for 1996? The birth rate? I have never thrown this exact eraser at that table on this day in my life. If I throw it that direction, what's going to happen? Everybody knows. Why? The rules don't change.

Here the rule is one number per year, and it changes every year. So each year, before it is unveiled, you say how many birds there will be.

  • Cactus finches on Daphne Major. 37 counts, 1976 to 2012. You are shown the first twenty, 1976 to 1995.
  • Each year the model takes the count that was actually made the year before and multiplies it by one plus births minus deaths. One step at a time, never running away from the data.
  • Filled dots are birds counted. The red line is the model. Where the two coincide, the model has been fitted to that year.
  • Hollow circles are your predictions, dropped onto the year before it was unveiled.
  • Typical miss: how far the model sits from the count in an average year, in birds.
  • Five unveiled years at minimum. If your typical miss is still over 55 birds after five, you get more — up to ten. One unlucky year is not evidence.
on the years it was fitted to:  |  on the years it had not seen: not yet  |  parameters: 0
countedthe modelyour prediction

Your predictions

none yet

Controls

0.200
0.200
1977 — model , counted 146, out by

The numbers you have had to find

none yet

To open Stage B

  • Fit 1977 by hand, to within 3 birds, and lock it in. not yet
  • Take the other 18 years. 1977 first
  • Predict each unveiled year before it is unveiled. the record first
Zero error on every year you fitted. Your goal isn't to get zero error; that's trivial to do by just throwing parameters that teach you nothing at the data. Stage B is open.

R code

p <- read.csv("data/clean/finch_pop.csv")N <- p$scandens; fit <- 20# one pair of numbers for every year of the recordb <- numeric(fit); d <- numeric(fit)b[2] <- 0.200d[2] <- 0.200for (t in 3:fit) { d[t] <- 0.2; b[t] <- N[t]/N[t-1] - 1 + d[t] }# the model is the data. 38 numbers, no error leftyhat <- N[1:(fit-1)] * (1 + b[2:fit] - d[2:fit])mean(abs(yhat - N[2:fit]))# and for year 21 there is no b and no d to useb[fit+1]

B

Solve Stage A to unlock this section.

Models are wrong. But they can be usefully wrong. A model is a simplification of the world in order to better understand it. Fitting a model means finding the parameters that best predict the response from the predictors. The fit is how well that prediction matches reality.

So instead of trying to predict twenty years of data with 38 parameters that are each made up to fit what we've already seen, we're going to try it with two, and see how far we're off.

Same twenty years. Two numbers, and functionally one — only births minus deaths does anything. Get the miss as low as it will go. Then unveil the rest of the record.

  • The same counts, the same one-step-ahead rule: last year's count, times one plus births minus deaths.
  • 1996 onward is not on the plot. The ten years you unveiled in Stage A are back off it; a year is only held out once, so treat the number you get at the end as the generous version.
  • The sliders move in hundredths, and only their difference matters.
  • Unveiling freezes the two numbers. You do not get to adjust a model after seeing what it had to predict.
births minus deaths:  |  on the twenty years it was fitted to:  |  on the years it had not seen: unveil first

Controls

0.20
0.20

To open Stage C

  • Bring the miss on the fitted years under 65 birds. not yet
  • Then unveil the rest of the record. get under the bar first
  • Answer the question below.
Stage C is open.
There are usually about 216 birds on the island across the years you just unveiled. Take your two-number model's miss on those years and give it as a percentage of 216, to the nearest whole percent.
percent of 216

R code

p <- read.csv("data/clean/finch_pop.csv")N <- p$scandens; fit <- 2:20; held <- 21:37b <- 0.20d <- 0.20yhat <- N[1:36] * (1 + b - d)# fitted on the first twenty, scored on the restmean(abs(yhat[fit-1] - N[fit]))mean(abs(yhat[held-1] - N[held]))

C

Solve Stage B to unlock this section.

Two more numbers, but not two more years. Rain that year, and how crowded the island already was.

Neither of those is true. The rain does not make nestlings; it makes seeds, and nobody counted the seeds. Crowding is not a cause, it is a stand-in for every way an island runs out of room. Never true — but often close enough.

Using fewer parameters means we can test how reliable each one is. These two are worth testing because they say something about 1996 as well as about 1983, which is more than a birth rate for 1983 ever did.

Fit them on the same twenty years. Then unveil.

  • Same twenty years, same one-step-ahead rule, same freeze on unveiling.
  • Below the graph is your model. Click a dashed arrow to add it, and the slider it pays for switches on. A drawn arrow is one more number you had to go and find.
  • Rain is the island's total for that year, from 1 mm to 1,359 mm, and it is on record for the held-out years too — the model can read it without being told the counts.
  • The bar is 36 birds. Neither arrow reaches it alone.
  • Once you unveil, the plot also shows what your model expects for 2013 — a year past the end of the record, that nobody counted.
on the twenty years it was fitted to:  |  on the years it had not seen: unveil first  |  parameters: 2

Your birth-death model

Controls

0.30
0.30
0.00
0.00

To open Stage D

  • Bring the miss on the fitted years under 36 birds. not yet
  • Then unveil the rest of the record. get under the bar first
  • Answer the question below.
Four numbers, fitted on twenty years, and they hold on seventeen years they never saw. Stage D is open.
The record stops in 2012. Read the 2013 point off the plot: how many cactus finches does your frozen model expect in the year after the last count?
birds

R code

p <- read.csv("data/clean/finch_pop.csv")r <- read.csv("data/clean/grant_rainfall.csv")N <- p$scandenswet <- log10(r[match(p$year, r$Year), 2] + 1) - 1.88b0 <- 0.30d0 <- 0.30rainPull  <- 0.00crowdPull <- 0.00b <- b0 + rainPull  * wet[1:36]d <- d0 + crowdPull * (log10(N[1:36]) - 2.24)yhat <- N[1:36] * (1 + b - d)mean(abs(yhat[1:19]  - N[2:20]))mean(abs(yhat[20:36] - N[21:37]))

D

Solve Stage C to unlock this section.

Three models, the same twenty years to learn from, the same years held back.

Every extra parameter is one more opportunity to be wrong. Adding more isn't safer — it's more surface area for error. But the 38-parameter model and the 4-parameter model do not fail the same way, and the count is not what separates them.

Read the row you did the most work for. Then read the row that predicted best. It's a model — how good are the data that you buy that prediction.

  • Fitted on: 1977 to 1995, nineteen predictions, every model.
  • Held back: 1996 to 2012, seventeen predictions, for the two models that have a rule to run.
  • The bespoke model has no row there, because it has no number for a year it was not fitted to. Its only score is the years you predicted by hand, one at a time.
  • Green marks the smallest miss in each column.
What you fitted Parameters Miss on the fitted years Miss on the years you predicted Miss on all 17 held-back years

To finish the lesson

  • Answer the question below.
Doubling the parameters halved the miss — because the two you added say something about a year nobody has counted yet, and a birth rate for 1983 never will.
Two of your models were fitted on exactly the same twenty years, one with two numbers and one with four. On the seventeen years neither of them had seen, how many birds a year better was the four-number model?
birds a year

R code

# the whole lesson, as a tablescore <- function(yhat, obs, idx) mean(abs(yhat[idx] - obs[idx]))fitted <- 2:20held   <- 21:37data.frame(  model = c("one pair per year", "one pair, all years", "rain + crowding"),  np    = c(38, 2, 4),  in    = c(score(y1, N, fitted), score(y2, N, fitted), score(y3, N, fitted)),  out   = c(NA,            score(y2, N, held),   score(y3, N, held)))