Correlation & Regression
Unit IV · Lecture 26
🤔 Why Exponential Curves?
📖 The Problem with Polynomials
Polynomials (linear, quadratic, cubic) work well for data that changes by additive amounts. But many real-world phenomena change by multiplicative factors — each step multiplies the previous value by a constant factor. For such data, exponential and power curves are far more appropriate than polynomials.
💡 Analogy: Compound Interest
If you invest ₹100 at 10% annual interest, after 1 year you have ₹110, after 2 years ₹121, after 3 years ₹133.10. The increase is multiplicative (×1.10 each year), not additive (+₹10 each year). A straight line would predict ₹130 after 3 years (wrong), while an exponential curve predicts ₹133.10 (correct). The exponential model captures the multiplicative growth naturally.
📖 Real-World Examples of Exponential Growth
1. Population growth: Bacteria, humans, epidemics
2. Compound interest: Investments, debt
3. Radioactive decay: Half-life of isotopes
4. Viral spread: Early-stage pandemic growth
5. Technology adoption: Moore's Law, internet users
6. Cooling/heating: Newton's Law of Cooling
📖 How to Spot Exponential Data
1. Scatter plot: Points follow a J-shaped curve (rapid increase) or a decay curve (rapid decrease then flattening).
2. Constant ratio: The ratio yᵢ₊₁/yᵢ is approximately constant across consecutive observations.
3. Log-linear plot: If plotting log(y) vs x gives a straight line, the data is exponential.
4. Residuals from linear fit: If residuals show a systematic curved pattern (not random), consider exponential.
Correlation & Regression
Unit IV · Lecture 26
📐 Three Exponential-Type Curves
Type 1: y = abˣ
Form: Exponential with base b
Linearise: log y = log a + x·log b
Let: Y = log y, A = log a, B = log b
Becomes: Y = A + Bx (straight line!)
Use when: Growth/decay rate is proportional to current value
Type 2: y = aeᵇˣ
Form: Natural exponential
Linearise: ln y = ln a + bx
Let: Y = ln y, A = ln a
Becomes: Y = A + bx (straight line!)
Use when: Continuous growth/decay (calculus-based models)
Type 3: y = axᵇ
Form: Power curve (allometric)
Linearise: log y = log a + b·log x
Let: Y = log y, X = log x, A = log a
Becomes: Y = A + bX (straight line!)
Use when: Relationship between log(x) and log(y) is linear
💬 The Magic of Logarithms: All three curve types can be linearised by taking logarithms. Once linearised, we apply the standard least squares method from Lecture 24. This is the core technique of this lecture — transform, fit, transform back.
Correlation & Regression
Unit IV · Lecture 26
🔄 The Linearisation Technique
📖 The Core Idea
Many non-linear curves can be transformed into straight lines by applying a suitable transformation to x, y, or both. Once linearised, we fit a straight line using least squares, then transform back to get the original curve parameters.
Non-linear data (x, y)
→
Transform
→
Linear data (X, Y)
Fit line Y = A + BX
→
Transform back
→
Original curve
📖 Important: What We Minimise
When we linearise and fit a line to the transformed data, we are minimising the sum of squared errors in the transformed space, not the original space:
For y = abˣ: We minimise Σ(log yᵢ − log ŷᵢ)², not Σ(yᵢ − ŷᵢ)²
This means the fit is optimal in the log scale, which gives more weight to smaller values and less weight to larger values. This is often desirable (it prevents large values from dominating the fit), but it's important to understand the distinction.
Correlation & Regression
Unit IV · Lecture 26
📏 Type 1: Fitting y = abˣ
📖 Step-by-Step Method
Given: n data points (x₁,y₁), (x₂,y₂), …, (xₙ,yₙ)
Step 1: Take logarithms of both sides:
log y = log a + x · log b
Step 2: Define transformed variables:
Y = log y, A = log a, B = log b
The equation becomes: Y = A + Bx
Step 3: Apply least squares to (x, Y) pairs:
B = [nΣxY − Σx·ΣY] / [nΣx² − (Σx)²]
A = Ȳ − B·x̄
Step 4: Transform back:
a = antilog(A) = 10ᴬ (if using log₁₀)
b = antilog(B) = 10ᴮ
Step 5: Write the fitted equation: ŷ = a · bˣ
💡 Which logarithm? You can use log₁₀ (common log) or ln (natural log). The final answer for a and b will be the same regardless of which base you use, as long as you consistently use the same base for taking and inverting the logarithm.
Correlation & Regression
Unit IV · Lecture 26
✏️ Example 1: Fitting y = abˣ
📝 Problem
A bacteria culture grows as follows. Fit a curve of the form y = abˣ.
| x (hours) | 1 | 2 | 3 | 4 | 5 |
| y (thousands) | 2.5 | 6.0 | 14.0 | 35.0 | 85.0 |
📖 Solution — Step 1–2: Transform
Take log₁₀ of each y value: Y = log y
| x | y | Y = log₁₀(y) | xY | x² |
| 1 | 2.5 | 0.3979 | 0.3979 | 1 |
| 2 | 6.0 | 0.7782 | 1.5564 | 4 |
| 3 | 14.0 | 1.1461 | 3.4383 | 9 |
| 4 | 35.0 | 1.5441 | 6.1764 | 16 |
| 5 | 85.0 | 1.9294 | 9.6470 | 25 |
| 15 | | 5.7957 | 21.2160 | 55 |
📖 Solution — Step 3: Least Squares on Transformed Data
n = 5, Σx = 15, ΣY = 5.7957, ΣxY = 21.2160, Σx² = 55
x̄ = 3, Ȳ = 1.15914
B = [nΣxY − Σx·ΣY] / [nΣx² − (Σx)²]
= [5(21.2160) − 15(5.7957)] / [5(55) − 225]
= [106.080 − 86.9355] / [275 − 225]
= 19.1445 / 50 = 0.38289
A = Ȳ − B·x̄ = 1.15914 − 0.38289(3) = 1.15914 − 1.14867 = 0.01047
📖 Solution — Step 4: Transform Back
a = 10ᴬ = 10^0.01047 = 1.0244
b = 10ᴮ = 10^0.38289 = 2.4148
Fitted Exponential Curve
ŷ = 1.0244 × (2.4148)ˣ
The bacteria population multiplies by approximately 2.41× every hour. This represents approximately 141% growth per hour.
Correlation & Regression
Unit IV · Lecture 26
✏️ Example 1: Verification & Predictions
| x | y (observed) | ŷ = 1.0244 × 2.4148ˣ | Residual |
| 1 | 2.5 | 1.0244 × 2.4148 = 2.474 | +0.026 |
| 2 | 6.0 | 1.0244 × 5.831 = 5.973 | +0.027 |
| 3 | 14.0 | 1.0244 × 14.082 = 14.426 | −0.426 |
| 4 | 35.0 | 1.0244 × 34.006 = 34.836 | +0.164 |
| 5 | 85.0 | 1.0244 × 82.120 = 84.124 | +0.876 |
📖 Predictions
At x = 6 (6 hours):
ŷ = 1.0244 × 2.4148⁶ = 1.0244 × 198.34 = 203.2 thousand
At x = 10 (10 hours):
ŷ = 1.0244 × 2.4148¹⁰ = 1.0244 × 6,973 = 7,143 thousand ≈ 7.1 million
Note: Exponential models predict explosive growth. In reality, growth eventually slows due to resource limits (logistic growth). Exponential models are reliable only for short-term predictions.
💡 Doubling Time: The population doubles when 2.4148ˣ = 2, i.e., x = log(2)/log(2.4148) = 0.3010/0.3829 ≈ 0.79 hours ≈ 47 minutes. The bacteria population doubles roughly every 47 minutes.
Correlation & Regression
Unit IV · Lecture 26
✏️ Example 2: Radioactive Decay — y = aeᵇˣ
📝 Problem
The amount of a radioactive substance remaining over time is given below. Fit y = aeᵇˣ and find the half-life.
| Time (x, hours) | 0 | 1 | 2 | 3 | 4 | 5 |
| Amount (y, grams) | 100 | 72 | 50 | 37 | 26 | 19 |
📖 Solution — Transform
Y = ln(y) for each data point:
| x | y | Y = ln(y) | xY | x² |
| 0 | 100 | 4.6052 | 0.0000 | 0 |
| 1 | 72 | 4.2767 | 4.2767 | 1 |
| 2 | 50 | 3.9120 | 7.8240 | 4 |
| 3 | 37 | 3.6109 | 10.8327 | 9 |
| 4 | 26 | 3.2581 | 13.0324 | 16 |
| 5 | 19 | 2.9444 | 14.7220 | 25 |
| 15 | | 22.6073 | 50.6878 | 55 |
📖 Least Squares on Transformed Data
n = 6, Σx = 15, ΣY = 22.6073, ΣxY = 50.6878, Σx² = 55
x̄ = 2.5, Ȳ = 3.76788
b = [6(50.6878) − 15(22.6073)] / [6(55) − 225]
= [304.1268 − 339.1095] / [330 − 225]
= −34.9827 / 105 = −0.33317
A = 3.76788 − (−0.33317)(2.5) = 3.76788 + 0.83293 = 4.60081
a = eᴬ = e^4.60081 = 99.58
Fitted Decay Curve
ŷ = 99.58 × e⁻⁰·³³³ˣ
Half-life = ln(2) / 0.33317 = 0.6931 / 0.3332 = 2.08 hours
The substance decays at a continuous rate of 33.3% per hour. It takes approximately 2.08 hours for half the substance to decay.
Correlation & Regression
Unit IV · Lecture 26
✏️ Example 3: Fitting y = axᵇ
📝 Problem
Fit a power curve y = axᵇ to the following data:
| x | 1 | 2 | 3 | 4 | 5 |
| y | 2.0 | 5.7 | 10.4 | 16.0 | 22.4 |
📖 Solution — Transform
X = log₁₀(x), Y = log₁₀(y):
| x | y | X = log x | Y = log y | XY | X² |
| 1 | 2.0 | 0.0000 | 0.3010 | 0.0000 | 0.0000 |
| 2 | 5.7 | 0.3010 | 0.7559 | 0.2275 | 0.0906 |
| 3 | 10.4 | 0.4771 | 1.0170 | 0.4852 | 0.2276 |
| 4 | 16.0 | 0.6021 | 1.2041 | 0.7250 | 0.3625 |
| 5 | 22.4 | 0.6990 | 1.3502 | 0.9438 | 0.4886 |
| | 2.0792 | 4.6282 | 2.3815 | 1.1693 |
📖 Least Squares on Transformed Data
n = 5, ΣX = 2.0792, ΣY = 4.6282, ΣXY = 2.3815, ΣX² = 1.1693
X̄ = 0.41584, Ȳ = 0.92564
b = [5(2.3815) − (2.0792)(4.6282)] / [5(1.1693) − (2.0792)²]
= [11.9075 − 9.6229] / [5.8465 − 4.3231]
= 2.2846 / 1.5234 = 1.4997 ≈ 1.5
A = 0.92564 − 1.5(0.41584) = 0.92564 − 0.62376 = 0.30188
a = 10^0.30188 = 2.004 ≈ 2.0
Fitted Power Curve
ŷ = 2.0 × x¹·⁵
The exponent b = 1.5 indicates that y grows as the 1.5th power of x. This is a common scaling law — for example, the relationship between body mass and metabolic rate in animals often follows a power law with exponent around 0.75.
Correlation & Regression
Unit IV · Lecture 26
⚖️ Comparison: All Curve Types
| Feature | y = a + bx | y = abˣ | y = aeᵇˣ | y = axᵇ |
| Type | Linear | Exponential | Natural Exp. | Power |
| Transform | None | Y = log y | Y = ln y | Y = log y, X = log x |
| Linearised form | y = a + bx | Y = A + Bx | Y = A + bx | Y = A + bX |
| Parameters | 2 (a, b) | 2 (a, b) | 2 (a, b) | 2 (a, b) |
| Shape | Straight line | J-curve / decay | J-curve / decay | Power law curve |
| Growth type | Additive | Multiplicative | Continuous mult. | Power scaling |
| Best for | Constant rate of change | Constant ratio | Continuous processes | Scaling laws |
| Diagnostic plot | y vs x → line | log y vs x → line | ln y vs x → line | log y vs log x → line |
💡 Decision Guide:
Step 1: Plot y vs x. If linear → use y = a + bx.
Step 2: If curved, plot log(y) vs x. If linear → use y = abˣ.
Step 3: If still curved, plot log(y) vs log(x). If linear → use y = axᵇ.
Step 4: If none work, consider polynomials or other models.
Correlation & Regression
Unit IV · Lecture 26
🧠 Quick Quiz — Lecture 26
Q1: To fit y = abˣ, we take logarithms and obtain:
A) y = log a + log b · x
B) log y = log a + x · log b
C) log y = a + bx
D) y = a + b · log x
Q2: For the power curve y = axᵇ, the linearised form is:
A) log y = log a + x · log b
B) log y = log a + b · log x
C) y = a + b · log x
D) ln y = ln a + bx
Q3: A requirement for fitting exponential curves is:
A) All x values must be positive
B) All y values must be positive
C) The data must be symmetric
D) The sample size must be at least 30
Q4: If log(y) vs x gives a straight line, the appropriate model is:
A) y = abˣ (exponential)
B) y = axᵇ (power)
C) y = a + bx (linear)
D) y = a + bx + cx² (quadratic)
Q5: In y = aeᵇˣ, if b < 0, the curve represents:
A) Exponential growth
B) Exponential decay
C) Linear growth
D) Power law growth
Q6: The half-life of a substance with decay model y = ae⁻⁰·⁵ˣ is:
A) 0.5 hours
B) 1.0 hours
C) 1.386 hours
D) 2.0 hours
Q7: The difference between y = abˣ and y = axᵇ is:
A) They are the same model
B) In abˣ the base varies with x; in axᵇ the exponent is constant
C) abˣ uses natural log; axᵇ uses common log
D) abˣ is for growth; axᵇ is for decay only
Q8: When fitting exponential curves by linearisation, we minimise errors in:
A) The original y-space
B) The log-transformed space
C) The x-space only
D) Both x and y space equally
Correlation & Regression
Unit IV · Lecture 26
📝 Homework & Practice
📝 Practice Tasks
1. Fit y = abˣ to: x = 1, 2, 3, 4, 5 and y = 3, 9, 27, 81, 243. What do you observe?
2. The population of a city (in thousands) over decades is: x = 0, 1, 2, 3, 4 and y = 50, 70, 98, 137, 192. Fit y = aeᵇˣ and predict the population at x = 5.
3. Fit a power curve y = axᵇ to: x = 1, 2, 3, 4, 5 and y = 3, 12, 27, 48, 75. Verify by computing predicted values.
4. For the data in Problem 2, also fit a straight line. Compare the SSE of both models. Which fits better?
5. Explain why we cannot fit an exponential curve if one of the y values is zero or negative.
6. A radioactive substance has a half-life of 5 hours. Write the decay equation y = aeᵇˣ and find the value of b.
7. How would you decide between fitting y = abˣ and y = axᵇ to a given dataset? Describe the diagnostic procedure.
8. BONUS: Show that for y = abˣ, the ratio yᵢ₊₁/yᵢ = b (constant) for equally spaced x values. Use this to estimate b directly from the data in Problem 1 and compare with the least squares estimate.
💡 Tip: Always check whether the constant ratio test (yᵢ₊₁/yᵢ ≈ constant) holds before fitting an exponential model. If the ratio is not approximately constant, the data may not be exponential — consider a power curve or polynomial instead.
Correlation & Regression
Unit IV · Lecture 26
Thank You!
Upcoming
Lecture 27: Correlation — Karl Pearson's Coefficient of Correlation
Lecture 28: Rank Correlation — Spearman's Coefficient
Lecture 29: Regression Lines & Their Properties
Unit IV · Lecture 26 · BDS113 Introduction to Statistics · B.Sc. Data Science, Semester II