🏠 Home
Correlation & Regression
Unit IV · Lecture 26

BDS113 — Introduction to Statistics

Fitting of Exponential Curves

Exponential Growth & Decay · Linearisation by Logarithms · y = abˣ and y = aeᵇˣ · Power Curves y = axᵇ


Unit IV · Lecture 26 of 40 · B.Sc. Data Science, 1st Year, Semester II

Correlation & Regression
Unit IV · Lecture 26

The Journey — Lecture 26


📐
Why Exponential Curves?
Motivation · When data grows/decays multiplicatively · Real-world examples
🔄
Linearisation: The Key Technique
Taking logarithms · Converting curves to lines · Applying least squares to transformed data
✏️
Worked Examples: Three Curve Types
y = abˣ · y = aeᵇˣ · y = axᵇ — step-by-step solutions for each
⚖️
Comparison, Interactive Tools & Quiz
When to use which curve · Choosing the right model · Practice quiz
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)12345
y (thousands)2.56.014.035.085.0

📖 Solution — Step 1–2: Transform

Take log₁₀ of each y value: Y = log y

xyY = log₁₀(y)xYx²
12.50.39790.39791
26.00.77821.55644
314.01.14613.43839
435.01.54416.176416
585.01.92949.647025
155.795721.216055

📖 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


xy (observed)ŷ = 1.0244 × 2.4148ˣResidual
12.51.0244 × 2.4148 = 2.474+0.026
26.01.0244 × 5.831 = 5.973+0.027
314.01.0244 × 14.082 = 14.426−0.426
435.01.0244 × 34.006 = 34.836+0.164
585.01.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

📏 Type 2: Fitting y = aeᵇˣ


📖 Step-by-Step Method

Step 1: Take natural logarithm (ln) of both sides:
    ln y = ln a + bx

Step 2: Define: Y = ln y, A = ln a
    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 = eᴬ (antilog using base e)

Step 5: Fitted equation: ŷ = a · eᵇˣ


💡 Relationship Between the Two Forms

y = abˣ and y = aeᵇˣ are equivalent forms:

If y = abˣ, then b = eᵏ where k = ln(b), so y = aeᵏˣ.
If y = aeᵇˣ, then eᵇ = B, so y = aBˣ.

Use y = abˣ when the growth factor per period is known.
Use y = aeᵇˣ when the continuous growth rate is known (common in calculus-based models).

📖 Interpretation of Parameters

a: The initial value (y when x = 0). ŷ(0) = a.

b (in aeᵇˣ): The continuous growth rate.
  • b > 0 → exponential growth
  • b < 0 → exponential decay
  • b = 0 → constant (no growth/decay)

Doubling time: t₂ = ln(2)/b
Half-life: t₁/₂ = ln(2)/|b| (for decay)

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)012345
Amount (y, grams)1007250372619

📖 Solution — Transform

Y = ln(y) for each data point:

xyY = ln(y)xYx²
01004.60520.00000
1724.27674.27671
2503.91207.82404
3373.610910.83279
4263.258113.032416
5192.944414.722025
1522.607350.687855

📖 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

📏 Type 3: Fitting y = axᵇ (Power Curve)


📖 Step-by-Step Method

Step 1: Take logarithm of both sides:
    log y = log a + b · log x

Step 2: Define: Y = log y, X = log x, A = log a
    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ᴬ

Step 5: Fitted equation: ŷ = a · xᵇ


💡 When to Use Power Curves

1. When a log-log plot (log y vs log x) gives a straight line.

2. Allometric growth in biology (organ size vs body size).

3. Scaling laws in physics (period of pendulum vs length: T = kL^0.5).

4. Engineering relationships (drag force vs velocity: F = kv²).

5. Zipf's law in linguistics, Pareto distributions in economics.

📖 Key Difference from Exponential

Exponential (y = abˣ): The base is constant, the exponent varies with x. Growth rate is proportional to current value.

Power (y = axᵇ): The exponent is constant, the base varies with x. The relationship is a fixed power law.

How to tell them apart:
  • Plot log(y) vs x → linear? → Exponential
  • Plot log(y) vs log(x) → linear? → Power curve

Correlation & Regression
Unit IV · Lecture 26

✏️ Example 3: Fitting y = axᵇ


📝 Problem

Fit a power curve y = axᵇ to the following data:

x12345
y2.05.710.416.022.4

📖 Solution — Transform

X = log₁₀(x), Y = log₁₀(y):

xyX = log xY = log yXYX²
12.00.00000.30100.00000.0000
25.70.30100.75590.22750.0906
310.40.47711.01700.48520.2276
416.00.60211.20410.72500.3625
522.40.69901.35020.94380.4886
2.07924.62822.38151.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

🎬 Visual: Exponential Curve Fitter


Click each curve type to see it fitted to sample data:


📈

y = abˣ

Exponential growth

📉

y = aeᵇˣ

Exponential decay

⚡

y = axᵇ

Power curve

Correlation & Regression
Unit IV · Lecture 26

🎬 Interactive: Exponential Curve Calculator


Enter data and choose which exponential model to fit:









Correlation & Regression
Unit IV · Lecture 26

⚖️ Comparison: All Curve Types


Featurey = a + bxy = abˣy = aeᵇˣy = axᵇ
TypeLinearExponentialNatural Exp.Power
TransformNoneY = log yY = ln yY = log y, X = log x
Linearised formy = a + bxY = A + BxY = A + bxY = A + bX
Parameters2 (a, b)2 (a, b)2 (a, b)2 (a, b)
ShapeStraight lineJ-curve / decayJ-curve / decayPower law curve
Growth typeAdditiveMultiplicativeContinuous mult.Power scaling
Best forConstant rate of changeConstant ratioContinuous processesScaling laws
Diagnostic ploty vs x → linelog y vs x → lineln y vs x → linelog 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

🔑 Properties & Cautions


Correlation & Regression
Unit IV · Lecture 26

🔑 Summary: Fitting of Exponential Curves


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