0% found this document useful (0 votes)
2 views7 pages

Week 04 Statistics Study Notes

This document covers non-linear models and transformations, focusing on the differences between linear and non-linear relationships, as well as exponential and power law models. It explains how to detect non-linearity using residual plots, the importance of linearization through logarithmic transformations, and provides a model selection workflow. Additionally, it includes worked examples and critical reminders for evaluating models and interpreting results.

Uploaded by

Abdulbari Abro
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views7 pages

Week 04 Statistics Study Notes

This document covers non-linear models and transformations, focusing on the differences between linear and non-linear relationships, as well as exponential and power law models. It explains how to detect non-linearity using residual plots, the importance of linearization through logarithmic transformations, and provides a model selection workflow. Additionally, it includes worked examples and critical reminders for evaluating models and interpreting results.

Uploaded by

Abdulbari Abro
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

COURSE STUDY NOTES — WEEK 04

Non-linear Models & Transformations


Curved Relationships, Exponential & Power Law Models, Log Linearization

1. Introduction to Non-linear Relationships

What is a Non-linear Relationship?


In Week 03, we studied linear relationships where data follows a straight line y = a + bx. However, most
systems in nature and real life are curved rather than straight! A non-linear relationship occurs when the
change in y for a given change in x is not constant. If we try to force a straight regression line through curved
data, our predictions will be completely wrong!

Baby-Simple Definition — Straight Line vs. Curve:


• Linear (Straight Line): Imagine walking up a smooth staircase where every single step is exactly 10 cm
high. You go up by the exact same height with every step.
• Non-linear (Curve): Imagine riding a rocket ship! On second 1 you go up 1 meter, on second 2 you go up
10 meters, and on second 3 you shoot up 100 meters! The jump gets bigger and bigger every second.

How Do We Detect Curves? Check the Residual Plot!


As we learned in Week 03, a residual plot shows the prediction errors (e = y - &hat;y) against x.
• If the data is truly linear, the residual plot shows a random scatter of dots around 0.
• If the data is curved, the residual plot exhibits a distinct curved U-shape or inverted U-shape! This curved
pattern is an immediate red flag warning us that a straight line model has failed.
WEEK 04: NON-LINEAR MODELS & LOGARITHMIC TRANSFORMATIONS PAGE 2

Figure 1.1: Detecting non-linearity in residual plots vs transforming data into a straight line.

2. The Three Core Mathematical Models

In Week 04, we focus on three fundamental mathematical functions used to model quantitative data:

Model Type General Growth Mechanism Real-World Example


Formula

1. Linear Model y = a + bx Adds a constant amount (b) for every Earning $15/hour: $15, $30, $45, $60
+1 change in x.

2. Exponential y = y0 * B^x Multiplies by a constant factor (B) for Compound bank interest, viral infection,
Model or y = y0(1+r)^x every +1 change in x. bacteria growth

3. Power Law y = A * x^b y is proportional to x raised to a Planetary orbital motion (Kepler's Law),
Model constant power b. animal metabolism vs mass

3. Exponential Models: Growth & Decay

SCI1020 Introduction to Statistical Reasoning Study Guide & Notes


WEEK 04: NON-LINEAR MODELS & LOGARITHMIC TRANSFORMATIONS PAGE 3

Linear Addition vs. Exponential Multiplication


The single most important distinction between a linear model and an exponential model is:
• Linear Function: For every 1-unit increase in x, there is a constant additive change in y (you add b).
• Exponential Function: For every 1-unit increase in x, there is a constant multiplicative change in y (you
multiply by B).

Figure 3.1: Linear growth (+50 per step) vs Exponential growth (x1.5 per step).

The Exponential Equation & Growth Factor B


The general formula for an exponential model is:
y = y0 · Bx or y = y0(1 + r)x
Where:
• y0 = initial value of y when x = 0.
• B = Growth Factor (the multiplier per 1 unit of x).
• r = Incremental Rate Constant per unit of x, where B = 1 + r.
- If r > 0 (B > 1): Exponential Growth (values blow up higher and higher).
- If r < 0 (B < 1): Exponential Decay (values shrink down towards zero).

Real-World Example — Compound Bank Interest:


Suppose you deposit $1,000 in a savings account that pays 5% interest per year (r = +0.05, so B = 1 + 0.05
= 1.05).
• Year 0: $1,000
• Year 1: $1,000 × 1.05 = $1,050.00 (Interest earned = $50.00)
• Year 2: $1,050 × 1.05 = $1,102.50 (Interest earned = $52.50)
• Year 3: $1,102.50 × 1.05 = $1,157.63 (Interest earned = $55.13)
Notice that your interest payment grows every year because you earn interest on top of past interest!

Constant Doubling Time & Half-Life


Exponential models have a remarkable feature: the time required for a quantity to double (or shrink by half) is
always constant regardless of starting size!
• Doubling Time (T): The time needed for y to double (growth).
Formula: T = log(2) / log(1 + r) & r = 21/T - 1

SCI1020 Introduction to Statistical Reasoning Study Guide & Notes


WEEK 04: NON-LINEAR MODELS & LOGARITHMIC TRANSFORMATIONS PAGE 4

• Half-Life (t1/2): The time needed for y to drop to 50% (decay).


Formula: t1/2 = log(0.5) / log(1 + r) & r = 0.51/t1/2 - 1

Limits of Exponential Growth & The Logistic Model


In the real world, exponential growth cannot continue forever! For instance, bacteria in a bottle will eventually
run out of sugar and space. Populations are ultimately capped by the Carrying Capacity (K) of their
environment. When population approaches K, growth slows down, creating an S-shaped curve called the
Logistic Growth Model.

Figure 3.2: Unrestricted exponential growth vs real-world logistic growth with carrying capacity K.

4. Power Law Models

What is a Power Law Model?


A Power Law model has the general formula:
y = A · xb
Where A is a scaling constant and b is the constant power exponent.
• If b > 0: Power law growth (e.g., area of a square A = s2).
• If b < 0: Power law decay (e.g., gravity force decreasing with distance F 1/r2).

Real-World Example — Kepler's Third Law of Planetary Motion:


Astronomers measured the distance x (million km) of 9 planets from the Sun and their orbital period y (years
to orbit the Sun).
The relationship between distance and period is a power law: Period = 5.48 × 10-5 · (Distance)1.50.
Notice the exponent is b = 1.50! Earth is 149.6 million km away (1 year period), while distant Neptune is
4,496.6 million km away (164.8 year period)!

SCI1020 Introduction to Statistical Reasoning Study Guide & Notes


WEEK 04: NON-LINEAR MODELS & LOGARITHMIC TRANSFORMATIONS PAGE 5

Figure 4.1: Kepler's planetary motion — raw curved power law vs linearized log-log straight line.

5. Linearization via Logarithmic Transformations

Why Do We Linearize Data?


Linear regression only works on straight lines! We cannot directly calculate a best-fit regression line on raw
curved data. To solve this, statisticians use a mathematical trick called Linearization: taking natural logarithms
(ln) bends the curved data into a perfectly straight line!
1. Linearizing an Exponential Model y = y0 Bx:
Take natural logarithms (ln) of both sides:
ln(y) = ln(y0 · Bx) = ln(y0) + ln(Bx) = ln(y0) + x · ln(B)
Notice this matches the straight line form Y = a + bx where:
• Y = ln(y) (take log of response variable y only!)
• a = ln(y0) (intercept)
• b = ln(B) (slope)
Key Rule: A plot of ln(y) vs. x is linear if and only if x and y have an exponential relationship!

2. Linearizing a Power Law Model y = A · xb:


Take natural logarithms (ln) of both sides:
ln(y) = ln(A · xb) = ln(A) + ln(xb) = ln(A) + b · ln(x)
Notice this matches the straight line form Y = a + bX where:
• Y = ln(y) and X = ln(x) (take log of BOTH x and y!)
• a = ln(A) (intercept)
• b = b (slope is equal to the power exponent!)
Key Rule: A plot of ln(y) vs. ln(x) is linear if and only if x and y have a power law relationship!

Model Type Original Transformation Linear Form (Y = a + bX) Back-Transformation


Formula Required Formula

Exponential y = y0 * B^x Plot ln(y) vs x ln(y) = ln(y0) + x * ln(B) y = e^(a + bx) = e^a * (e^b)^x

SCI1020 Introduction to Statistical Reasoning Study Guide & Notes


WEEK 04: NON-LINEAR MODELS & LOGARITHMIC TRANSFORMATIONS PAGE 6

Model Type Original Transformation Linear Form (Y = a + bX) Back-Transformation


Formula Required Formula

Power Law y = A * x^b Plot ln(y) vs ln(x) ln(y) = ln(A) + b * ln(x) y = e^(a + b*ln(x)) = e^a * x^b

6. Back-Transformation: Reversing the Logs

After fitting a linear regression model on the log-transformed data, we must convert our final equation back into
original units so users can understand it. To reverse natural logarithms (ln), we apply the exponential function
ex to both sides!

Worked Example 1 — Exponential Model (HIV Viral Load vs Time):


Doctors measured HIV load in patients over weeks of infection t.
1. They plotted ln(HIV) vs t and found a straight line: ln(HIV) = 2.4447 · t - 2.2271.
2. Back-transform by exponentiating both sides: HIV = e2.4447 t - 2.2271
3. Use exponent rules: HIV = e-2.2271 · (e2.4447)t
4. Calculate numbers: e-2.2271 = 0.1078 and e2.4447 = 11.5271
Final Exponential Equation: HIV = 0.1078 · (11.5271)t!
This means the initial viral load was 0.1078 units, and it multiplies by 11.5271 every single week!

Worked Example 2 — Power Law Model (Planetary Motion):


1. Astronomers plotted ln(Period) vs ln(Distance) and found a straight line: ln(Period) = 1.50 · ln(Distance) -
7.51.
2. Back-transform by exponentiating both sides: Period = e1.50 ln(Distance) - 7.51
3. Use exponent rules: Period = e-7.51 · (eln(Distance))1.50 = e-7.51 · (Distance)1.50
4. Calculate numbers: e-7.51 = 0.000548 = 5.48 × 10-5
Final Power Law Equation: Period = 5.48 × 10-5 · (Distance)1.50!

7. Model Selection Workflow & Summary Checklist

When given a new dataset with unknown curvature, follow this exact 4-step workflow to pick the best model:

Step 1: Test for Linear Model


Plot raw y vs raw x. Check the residual plot. If residuals show random scatter, stop—the linear model y = a + bx
is best!

Step 2: Test for Exponential Model


Plot ln(y) vs raw x. Check the residual plot. If residuals show random scatter, the exponential model y = y0 Bx is
best!

Step 3: Test for Power Law Model


Plot ln(y) vs ln(x). Check the residual plot. If residuals show random scatter, the power law model y = A xb is
best!

SCI1020 Introduction to Statistical Reasoning Study Guide & Notes


WEEK 04: NON-LINEAR MODELS & LOGARITHMIC TRANSFORMATIONS PAGE 7

Step 4: Select Best Fit & Reverse Logs


Choose the model with the most random residual plot. Calculate the linear regression line on the transformed
variables, then back-transform to get the original curved equation!

Critical Exam Cautions & Reminders:


1. Correlation r & R2: Correlation r and coefficient of determination R2 are ONLY valid for linear
relationships! You must evaluate r and R2 on the transformed linear variables (e.g., ln(y) vs x), NOT the raw
curved data.
2. Residual Plot Rules: Always choose the model whose transformed residual plot exhibits no remaining
patterns or curves.
3. Unpack Equations: Don't leave your final answer as ln(y) = 2.4 + 1.1 x. Exponentiate to give the final
formula y = e2.4 · (e1.1)x!

SCI1020 Introduction to Statistical Reasoning Study Guide & Notes

You might also like