Skip to content

Math 141 · Lesson 10

Function Family Explorer

Lay a linear, exponential, power, sine or sigmoid model over a dataset on the standard, semi-log and log-log plots at once. Move a parameter and the curve changes on all three plots.

Lesson 10: Single Variable Modeling

About this tool

The tool draws the data on three plots: the standard plot (x,y)(x, y), the semi-log plot (x,ln⁡(y))(x, \ln(y)) and the log-log plot (ln⁡(x),ln⁡(y))(\ln(x), \ln(y)). The model’s curve is drawn on all three plots, each in that plot’s own axes.

The model families are linear, exponential, power, sine and sigmoid, in these forms:

  • Linear, y=mx+by = mx + b
  • Exponential, y=Cek(x−h)y = Ce^{k(x-h)}
  • Power, y=Cxky = Cx^{k}
  • Sine, y=Asin⁡ ⁣(2πP(x−h))+vy = A\sin\!\left(\frac{2\pi}{P}(x - h)\right) + v
  • Sigmoid, y=A⋅pnorm(x,m,s)+vy = A\cdot\text{pnorm}(x, m, s) + v

A linear, exponential or power model starts as a rising line through the middle of the data on the plot where that model is linear. The exponential model starts with hh at the smallest input. The sine model starts with one period across the data. The sigmoid model starts as an S that rises through the middle half of the data’s height.

The datasets are WorldPopulation, Mortgage30YrAnnual, EngineRPM, TemperaturesDanville, TwitterUsers3, NaturalGasConsumption, Hawaii and BodyMassMetabolicRate. ln⁡\ln is undefined for an output of 0 or below (Hawaii) and for an input of 0 or below (TemperaturesDanville, Hawaii). A log plot with such values is replaced by a note.

On Year data, bb in y=mx+by = mx + b is the output at Year 0. Changing mm pivots the line about Year 0, far from the data. A change in mm can move the line out of view on all three plots. For a power model on Year data, changing kk pivots the curve about Year 1 in the same way.

Show R gives code that draws the same three plots in RStudio with the same values: plotPoints() for the data and plotFun(..., add = TRUE) for the curve.

Under More:

  • Kept curve. Keep this curve draws a dashed copy of the current curve on all three plots.
  • Log forms. The exponential model is written as ln⁡(y)=k(x−h)+ln⁡(C)\ln(y) = k(x - h) + \ln(C) and the power model as ln⁡(y)=kln⁡(x)+ln⁡(C)\ln(y) = k\ln(x) + \ln(C), with the current kk, hh and CC. The value of ln⁡(C)\ln(C) is left unevaluated.
  • More datasets. SunsetGreenwich (Lesson 8) and NetherlandsPopulation (Lesson 9) are added to the dataset list while More is open.

Keys: press an arrow key on a slider to move it about 1% of its width. Hold Shift with an arrow key to move it by the finest step.