To complete this page you will need Desmos and the Countries of the World Starter File open on your computer.

All numerical values on this page are provided for reference only! Definitions will vary as students will be fitting the curve by eye!

Fitting a Logarithmic Model f(x) = a logb x + k

You should be on Slide 7: Wealth-v-Health (Logarithmic) of Fitting Wealth-v-Health and Exploring Logarithmic Models (Desmos).

  • The x-axis should labeled with a sequence of numbers that looks something like this: 20000, 40000, 60000, 80000, 10000, 120000…​

1 What kind of growth does the sequence on the x-axis show? (circle one) Linear Quadratic Exponential Logarithmic

2 Use the sliders for a and k to make the best-fitting logarithmic model you can find. Write it below. (Note: Pyret’s log always uses b = 10)

logarithmic(x) = log coefficient (a)log10(x) + vertical shift (k) fun logarithmic​(​x​): (​  ​* log​(​x​)​) +   end

3 Define logarithmic(x) in the Countries of the World Starter File to be this model, and fit it using fit-model.

The error in the model is described by an S-value of about S units. I agree or disagree - not strongstrongly agree, agree, disagree, strongly disagree that this model is a good fit considering that y-variable in this dataset ranges from lowest y-value to highest y-value.

Scaling the x-Axis

  • Click on the wrench button () in the top-right corner of the Desmos graph to Open the "Graph Settings" window.

  • Expand the "More Options" section by clicking the triangle ().

  • Change the x-axis scale from Linear to Logarithmic. (The x-axis labels should change to something like 100, 1000, 104, 105…​)

4 What kind of growth does the sequence on the x-axis show? (circle one) Linear Quadratic Exponential Logarithmic

5 What is the shape of the point cloud, after changing the x scale to Logarithmic? Linear Quadratic Exponential Logarithmic

6 Adjust the sliders for a and k to improve the model. Toggle back and forth between logarithmic and linear x-axis scales as you work.

When you are satisfied with your model, record both forms of the definition below.

logarithmic2(x) = log coefficient (a)log10(x) + vertical shift (k) fun logarithmic2​(​x​): (​  ​* log​(​x​)​) +   end

7 In Pyret, define logarithmic2(x) to match this model. Then use the fit-model function to find its S-value:

8 How much more / less error do we expect in predictions made using logarithmic2 than with the logarithmic model?

Percent Change   =   $$\displaystyle \frac{  \text{Difference}   \text{between}   \text{the}   \text{S-values} } {\text{S-value}   \text{for}   \text{logarithmic}   \text{model}} \times 100   =  $$ $$\displaystyle \frac{\qquad}{\qquad}$$

We expect percent more / less error from predictions made with logarithmic2 than with the logarithmic model!

9 Do we know for sure that either of these models is optimal? Explain.

10 Why does transforming the x-axis makes our data look linear?

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.