Sign in to save

Bookmark this page so you can find it later.

Sign in to save

Bookmark this page so you can find it later.

Many real data sets do not follow a straight line. Growth, decay, motion, dose response, and cost patterns often bend, level off, or speed up as x changes. Nonlinear regression helps describe these curved relationships so we can make predictions and compare models.

Transformations are useful because they can turn some curved patterns into straight-line patterns that are easier to analyze.

A transformation changes the scale of one or both variables, such as using log(y), log(x), or x^2 instead of the original values. Exponential models can become linear by taking the logarithm of y, while power models can become linear by taking logarithms of both x and y. Quadratic models are often fit directly because their curvature comes from the x^2 term.

The best model is chosen by combining visual fit, residual patterns, parameter meaning, and prediction accuracy.

Key Facts

  • Linear model: y = a + bx, where b is the slope and a is the intercept.
  • Exponential model: y = ab^x, and log(y) = log(a) + x log(b) when y > 0.
  • Power model: y = ax^b, and log(y) = log(a) + b log(x) when x > 0 and y > 0.
  • Quadratic model: y = ax^2 + bx + c, which can model one bend or turning point.
  • Residual = observed y - predicted y, and good models have residuals with no clear pattern.
  • R^2 measures the fraction of variation explained by a model, but it should not be the only reason for choosing a nonlinear model.

Vocabulary

Nonlinear regression
A method for fitting a model to data when the relationship between variables is curved rather than a straight line.
Transformation
A change made to a variable, such as taking a logarithm or square, to make a pattern easier to model.
Exponential model
A model in which the response changes by a constant factor for each equal increase in the explanatory variable.
Power model
A model of the form y = ax^b that describes relationships where one variable scales as a power of another.
Residual plot
A graph of residuals used to check whether a fitted model has missed a pattern in the data.

Common Mistakes to Avoid

  • Using a straight line for clearly curved data is wrong because it can create biased predictions, especially at low or high x-values.
  • Taking logarithms of zero or negative values is wrong because log(x) is only defined for positive x in real-valued regression transformations.
  • Comparing R^2 values from transformed and untransformed models without context is wrong because the models may be measuring error on different scales.
  • Transforming data and then forgetting to back-transform predictions is wrong because a prediction for log(y) is not the same as a prediction for y.

Practice Questions

  1. 1 A data set follows y = 3(2)^x. Find y when x = 0, x = 2, and x = 5.
  2. 2 A power model is y = 4x^1.5. Estimate y when x = 9, and write the linearized form using logarithms.
  3. 3 A scatterplot curves upward, and a residual plot from a linear fit shows residuals that are negative at small x, positive in the middle, and negative at large x. Explain what this pattern suggests about the model and name one better modeling option.