The data below was generated from Carbon Dioxide Starter File, showing the amount of CO2 in the atmosphere (parts per million) on specific dates from 1974 to 2023 (the co2-table). NOTE: the date column is the decimal year (so "June 15th, 2023" would be 2023.5).

Looking for Patterns

Scatter plot showing global CO2 levels over time, rising from May 1974 to December 2023

1 Use lr-plot to find the best linear model for the co2-table. What is its S-value? parts per million

2 Write the function below (in Pyret and Function Notation):

Function Notation

linear(x) = slopex + y-intercept / vertical shift


Pyret Notation

fun linear​(​x​): (​  ​* x​) +   end

3 Copy your periodic model from Modeling Recent Carbon Dioxide Levels below:

Function Notation

periodic(x) = amplitude × sin( frequency (x - horizontal shift) ) + vertical shift


Pyret Notation

fun periodic​(​x​): (​  ​* sin​(​  ​* (​x ​-  ​)​)​) +   end

Creating Hybrid Models

We can think of f(x) = A sin(B(x - h)) + k as being the sum of two functions: p(x) = A sin(B(x - h)) and q(x) = k.

4 Which function defines the "up and down" wave (p or q)? Which function defines the line the wave "wraps around"?

5 What do you think would happen if q were changed so that k is a higher number?

6 What do you think would happen if q were changed so that k is a lower number?

7 What do you think would happen if q were changed to q(x) = 2x + - 3000

Define a NEW function hybrid in Pyret, which combines your periodic model with the optimal linear one. Write your new model below, in Function or Pyret notation:

What is the best S-value you can get? parts per million

These materials were developed partly through support of the National Science Foundation, (awards 1042210, 1535276, 1648684, 1738598, 2031479, and 1501927). CCbadge Bootstrap by the Bootstrap Community is licensed under a Creative Commons 4.0 Unported License. This license does not grant permission to run training or professional development. Offering training or professional development with materials substantially derived from Bootstrap must be approved in writing by a Bootstrap Director. Permissions beyond the scope of this license, such as to run training, may be available by contacting contact@BootstrapWorld.org.