This page relies on the Carbon Dioxide Starter File. Make sure you have it open on your computer!

Define Your Periodic Model

1 Define a periodic model using the values you computed for a, k, h and b on Modeling Recent Carbon Dioxide Levels.

Students horizontal shift estimates may vary slightly from this function definition.

Function Notation

periodic - sin(x) = (amplitude (a) × sin( frequency (b) (x - horizontal shift (h) ))) + vertical shift (k)


Pyret Notation

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

2 Then update the periodic-sin function definition in your starter file to match what you’ve just written.

Try translating the definition you wrote for periodic so that it uses cosine instead of sine:

Function Notation

periodic - cos(x) = (amplitude (a) × cos( frequency (b) (x - horizontal shift (h)))) + vertical shift (k)


Pyret Notation

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

Fit Your Periodic Model to the Data

3 Use fit-model to fit your periodic model to the data in the recent-table. What S-value do you get?

4 On the scatter plot below, make a sketch of what you see in pyret showing how the periodic model fits the data.

Scatter plot showing global CO2 levels over time, rising from December 2022 to May 2023, then dropping to December 2023. a few lighter dots are present from before December 2022 to hint at the nature of the curve.

5 Then fill in the blanks below to tell us what the model means.

Between the end of 2022 and 2023, the amount of CO2 in the air fluctuated between lowest and highest parts-per-million. This pattern appears to be periodic, with an amplitude of amplitude rising and falling around a midline of midline. We expect this pattern to repeat every period x-units. The error in the model is described by an S-value of about Sy-units. I strongly agree, agree, disagree, strongly disagree that this model is a good fit considering that y-variable in this dataset ranges from about lowest y-value to highest y-value.

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.