Saturday, March 14, 2026

#6a Advance Hypothesis Testing

Advanced Hypothesis Testing - Civil Engineering Statistics

🎓 Advanced Hypothesis Testing

University-Level Statistical Analysis for Civil Engineering
Comprehensive 120-Minute Lecture | Theoretical Foundations + Advanced Applications

📢 Lecture Introduction & Learning Objectives

Welcome to Advanced Hypothesis Testing! This lecture equips you with the statistical decision-making framework used in structural design, geotechnical analysis, and quality control.

Core Question: "Given limited sample data, can we confidently reject design specifications or accept engineering assumptions?"

🎯 University Learning Outcomes

  • Formulate and solve hypothesis tests for means (z, t) and variances (χ², F)
  • Derive test statistics from sampling distributions
  • Apply power analysis and sample size determination
  • Interpret Type I/II errors in civil engineering risk contexts
  • Conduct non-parametric alternatives when normality fails

🎯 Module 1: Theoretical Foundations (20 mins)

1.1 Neyman-Pearson Lemma & Decision Theory

The optimal test maximizes power (1-β) for fixed α using likelihood ratio:

Λ = supθ∈Θ₀ L(θ|x) / supθ∈Θ L(θ|x) ≶ k

1.2 Sampling Distributions & Pivotal Quantities

Central Limit Theorem: √n(x̄ - μ)/(σ/√n) → N(0,1)
t-Distribution: (x̄ - μ)/(s/√n) → tn-1
χ²-Distribution: Σ[(Xi-μ)²/σ²] → χ²n-1

1.3 Comprehensive Error Framework

H₀: μ = μ₀ TrueH₀: μ ≠ μ₀ True
ProbDecisionProbDecision
Region A1-αAcceptβAccept
Region BαReject1-βReject

📊 Module 2: Advanced Tests for Means (30 mins)

2.1 Z-Test: Large Sample Theory & Applications

Z = √n(x̄ - μ₀)/σ ~ N(0,1)
Rejection Region: |Z| > zα/2 (two-tailed)
Power: 1-β = P(Z > zα - √n|μ-μ₀|/σ)
Bridge Load Analysis (n=50):
x̄=422kN, σ=58kN, μ₀=400kN, α=0.05
Z = √50(422-400)/58 = 2.78 > 1.96
p-value: P(Z>2.78) = 0.0027 < 0.05
Power Analysis: For μ=410kN, power=0.87

2.2 T-Test: Small Sample Exact Distribution

T = √n(x̄ - μ₀)/s ~ tn-1
Exact Distribution: Derived from Normal/χ² independence
Concrete Compressive Strength (n=12):
Data: [27.8, 29.2, 30.1, 28.9, 29.7, 30.4, 28.5, 29.8, 30.2, 29.1, 28.7, 29.9]
x̄=29.42MPa, s=0.78MPa, μ₀=30MPa, α=0.05
t11 = √12(29.42-30)/0.78 = -2.45
tcrit(0.025,11) = ±2.201 → REJECT H₀
Conclusion: "Batch fails M30 specification"

2.3 Paired T-Test & Two-Sample Analysis

Paired: t = (d̄ - μD)/(sD/√n)
Two-Sample: t = (x̄₁-x̄₂)/√(sp²(1/n₁+1/n₂))

📈 Module 3: Variance Tests - Theory & Applications (25 mins)

3.1 Chi-Square Test: Exact Distribution

χ² = (n-1)s²/σ₀² ~ χ²n-1
Two-tailed: χ²1-α/2 < χ² < χ²α/2
One-tailed (σ²>σ₀²): χ² > χ²1-α
Geotechnical Soil Test (n=15):
Shear strength s²=3.84kPa², σ₀²=2.25kPa² (CV=25%)
χ²14 = 14×3.84/2.25 = 23.87
Critical: χ²0.025,14=5.63, χ²0.975,14=26.12
5.63 < 23.87 < 26.12 → FAIL TO REJECT
Design Decision: "Soil variability acceptable for foundation"

3.2 F-Test: Ratio of Independent χ² Variables

F = (s₁²/σ₁²)/(s₂²/σ₂²) = s₁²/s₂² ~ Fn₁-1,n₂-1
Decision: F > Fα,n₁-1,n₂-1

🏗️ Module 4: Civil Engineering Applications & Standards (20 mins)

Test TypeCivil ApplicationIS Code Referenceα LevelDecision Rule
Z-TestTraffic/Environmental LoadsIRC:6-20170.05Load > Design
T-TestConcrete Quality ControlIS:456-20000.05Strength < Spec
χ²-TestSoil Property VariabilityIS:27200.10CV > Limit
F-TestBatch/Material ComparisonIS:102620.05Variances unequal
Quality Control Protocol (IS:456):
M30 Concrete: Test 3 cubes at 7d, 6 at 28d
H₀: μ ≥ 30MPa vs H₁: μ < 30MPa
Reject if mean of any group < characteristic strength

🎯 Module 5: Power Analysis & Sample Size (15 mins)

📐 Sample Size Formulas

Z-Test: n = [zα/2 + zβ]²(σ/δ)²
T-Test: n ≈ [tα/2,df + tβ,df]²(σ/δ)²
Concrete Example: μ₀=30MPa, δ=1MPa, σ=2MPa, Power=0.9
n = [1.96+1.28]²(2/1)² = 39.2 → 40 samples minimum

✍️ Advanced In-Class Exercises

Exercise 1 - Structural Steel Yield Strength:
n=20, x̄=245MPa, s=8MPa, Spec=250MPa, α=0.05
Solution: t19=-2.50 > -2.093 → Acceptable
Exercise 2 - Aggregate Variance Test:
n=25, s²=16.4, σ₀²=9 (CV=30%), α=0.10
Solution: χ²24=43.11 ∈ [13.85, 36.42] → Acceptable

🧠 University-Level Assessment (10 Questions)

  1. The Neyman-Pearson lemma optimizes: a) Power for fixed α
  2. T-distribution approaches normal when: a) df → ∞
  3. χ²n-1 expected value equals: a) n-1
  4. Power = 1-β measures: a) Correct rejection probability
  5. For concrete QC, typical α = a) 0.05

🚀 Master Equation Summary

General Test Statistic: T = [Sample Stat - Hypothesized Value] / SE
Decision Rule: |T| > Critical Value or p-value < α
Engineering Action: Translate statistical decision → Design/Quality decision

#6 Hypothesis Testing

Hypothesis Testing Lecture - Civil Engineering Statistics

🧮 Hypothesis Testing Lecture Notes

Statistical Analysis for Civil Engineering Students
90-Minute Classroom Delivery | Concrete, Soil & Structural Applications

📢 Lecture Introduction

"Good morning, Class!"

Today we learn Hypothesis Testing – the statistical tool that helps civil engineers make decisions under uncertainty.

Real Civil Engineering Question: "Is this concrete batch strong enough for the bridge? Is this soil variance too high for foundation design?"

Hypothesis Testing Answer: We test if sample evidence rejects the "null hypothesis" (status quo/design specification).

🎯 Module 1: Concepts of Hypothesis Testing

1.1 What is Hypothesis Testing?

H₀: Null Hypothesis (Status Quo) = "Concrete meets 30 MPa spec"
H₁: Alternative Hypothesis = "Concrete < 30 MPa"

1.2 Types of Errors

H₀ TrueH₀ False
Accept H₀CorrectType II Error (β)
Reject H₀Type I Error (α)Correct (1-β = Power)
α = Reject good concrete (5% risk)
β = Accept bad concrete

1.3 5-Step Test Procedure

1. H₀: μ = μ₀ vs H₁: μ ≠/>/<
2. Choose test statistic (t, z, F, χ²)
3. Compute p-value or critical value
4. Decision: If p < α, Reject H₀
5. Engineering Conclusion

📊 Module 2: Tests for Means

2.1 Z-Test (Large Sample, σ known)

z = (x̄ - μ₀) / (σ/√n)
|z| > zα/2 → Reject H₀
Worked Example: 50 trucks: x̄=420kN, σ=60kN, μ₀=400kN
z = (420-400)/(60/√50) = 2.36 > 1.645
REJECT H₀: "Bridge loads exceed design"

2.2 T-Test (Small Sample)

t = (x̄ - μ₀) / (s/√n), df = n-1
Concrete Test: 8 cubes: x̄=29.625, s=1.53, μ₀=30
t = -0.693 < 1.895 → Concrete meets spec

📈 Module 3: Tests for Variance

3.1 Chi-Square Test

χ² = (n-1)s² / σ₀², df = n-1
Soil Test: 12 samples, s²=4.5, σ₀²=3.0
χ² = 16.5 (between 3.816-21.92)
FAIL TO REJECT: "Soil variability acceptable"

3.2 F-Test (Two Variances)

F = s₁²/s₂² → Compare to Fcritical

🏗️ Module 4: Civil Engineering Applications

TestSituationStatisticCivil Application
Z-testn≥30, σ knownz-scoreTraffic loads
T-testn<30 or σ unknownt-scoreConcrete strength
χ²-testSingle varianceχ²Soil variability
F-testTwo variancesF-ratioBatch comparison

🎯 Module 5: P-Values (Modern Method)

p-value = P(Type I error | H₀ true)
If p < α → Reject H₀

✍️ In-Class Exercises

Exercise 1: Concrete: x̄=28.5MPa, s=2.1, spec=30MPa
Solution: t=-2.36, p≈0.02 < 0.05 → REJECT BATCH
Exercise 2: Soil: s²=2.8, spec=2.0 → ACCEPTABLE

🧠 Classroom Quiz (5 Questions)

  1. H₀ always contains: a) Equality
  2. α=0.05 means: a) 5% Type I error risk
  3. Concrete test alternative: b) μ < 30
  4. Smaller p-value: a) Stronger evidence vs H₀

🚀 Key Takeaways

  1. Hypothesis Testing = Decision making from samples
  2. Civil Applications: Concrete ✓ Soil ✓ Loads ✓ Quality Control ✓
  3. Always state: H₀, H₁, α, Decision + Engineering Conclusion
  4. p < 0.05 → ACTION REQUIRED

#5a Moments

Civil Engineering Statistics Learning Platform

Civil Engineering Statistics Learning Platform

Moments, Hydrology Statistics & Engineering Data Analysis

Moments Calculator


---

Gumbel Flood Frequency Calculator

Flood estimation formula

$$ X_T = \bar{X} + K\sigma $$


---

Normal Distribution Visualization

---

Rainfall Frequency Analysis Tool


---

Hydrology Research Datasets

Download datasets for practice and research



---

Student Quiz

1. The first statistical moment represents:

2. Which distribution is widely used for flood frequency analysis?


Civil Engineering Statistics Learning Platform

#5 Moments

Estimation of Moments, Method of Moments and Maximum Likelihood Estimation

Statistical parameter estimation is widely used in Civil Engineering. Engineers estimate unknown parameters such as rainfall mean, soil strength distribution, traffic arrival rate, and material reliability using sample data.


Module 1: Estimation of Moments

A moment describes characteristics of a distribution such as mean and variance.

First moment about origin:

$$ \mu_1 = E(X) $$

Second moment about origin:

$$ \mu_2 = E(X^2) $$

Sample moment estimators:

$$ m_1 = \frac{1}{n}\sum x_i $$

$$ m_2 = \frac{1}{n}\sum x_i^2 $$

Worked Example 1 – Rainfall Analysis

Daily rainfall (mm): 20, 25, 30, 35

First moment:

$$ m_1 = \frac{20+25+30+35}{4} $$

$$ m_1 = 27.5 $$

Second moment:

$$ m_2 = \frac{400+625+900+1225}{4} $$

$$ m_2 = 787.5 $$

Worked Example 2 – Concrete Strength

Strength values (MPa): 28, 30, 32

$$ m_1 = \frac{28+30+32}{3} = 30 $$

$$ m_2 = \frac{784+900+1024}{3} $$

$$ m_2 = 902.67 $$

Worked Example 3 – Traffic Flow

Vehicles per minute: 10, 12, 8, 9

$$ m_1 = \frac{10+12+8+9}{4} $$

$$ m_1 = 9.75 $$

$$ m_2 = \frac{100+144+64+81}{4} $$

$$ m_2 = 97.25 $$

Worked Example 4 – Soil Density

Soil density (kN/m³): 18, 19, 20

$$ m_1 = \frac{18+19+20}{3} = 19 $$

$$ m_2 = \frac{324+361+400}{3} $$

$$ m_2 = 361.67 $$

Worked Example 5 – River Discharge

River discharge (m³/s): 150, 160, 170

$$ m_1 = \frac{150+160+170}{3} $$

$$ m_1 = 160 $$

$$ m_2 = \frac{22500+25600+28900}{3} $$

$$ m_2 = 25666.67 $$


Module 2: Method of Moments

The Method of Moments estimates parameters by equating sample moments with theoretical moments.

If population mean is:

$$ \mu = \theta $$

Set sample mean equal to theoretical mean:

$$ \bar{x} = \theta $$

Worked Example 1 – Estimating Mean Rainfall

Rainfall data: 40, 45, 50, 55

Sample moment:

$$ \bar{x} = \frac{40+45+50+55}{4} $$

$$ \bar{x} = 47.5 $$

Estimated rainfall parameter = 47.5 mm

Worked Example 2 – Soil Strength Parameter

Soil bearing capacity (kN/m²): 120, 130, 140

$$ \bar{x} = \frac{120+130+140}{3} $$

$$ \bar{x} = 130 $$

Estimated soil strength parameter = 130 kN/m²

Worked Example 3 – Traffic Arrival Rate

Vehicles per minute: 6, 7, 5, 8

$$ \bar{x} = \frac{6+7+5+8}{4} $$

$$ \bar{x} = 6.5 $$

Estimated arrival rate = 6.5 vehicles/min

Worked Example 4 – Bridge Load Distribution

Load measurements (kN): 100, 105, 110, 95

$$ \bar{x} = \frac{100+105+110+95}{4} $$

$$ \bar{x} = 102.5 $$

Estimated mean load = 102.5 kN

Worked Example 5 – Water Demand

Daily water demand (MLD): 200, 220, 210

$$ \bar{x} = \frac{200+220+210}{3} $$

$$ \bar{x} = 210 $$

Estimated demand parameter = 210 MLD


Module 3: Method of Maximum Likelihood (MLE)

The Maximum Likelihood Method estimates parameters by maximizing the likelihood function.

Likelihood function:

$$ L(\theta) = \prod f(x_i|\theta) $$

For many distributions the MLE of mean equals the sample mean.

$$ \hat{\mu}_{MLE} = \bar{x} $$

Worked Example 1 – Rainfall Mean Estimation

Rainfall data: 30, 35, 40

$$ \bar{x} = \frac{30+35+40}{3} $$

$$ \bar{x} = 35 $$

MLE estimate of mean rainfall = 35 mm

Worked Example 2 – Concrete Strength

Strength data (MPa): 25, 28, 30, 27

$$ \bar{x} = \frac{25+28+30+27}{4} $$

$$ \bar{x} = 27.5 $$

MLE estimate = 27.5 MPa

Worked Example 3 – Traffic Arrival Rate

Vehicles/minute: 4, 5, 6

$$ \bar{x} = \frac{4+5+6}{3} $$

$$ \bar{x} = 5 $$

Estimated arrival rate = 5 vehicles/min

Worked Example 4 – Soil Density

Soil density (kN/m³): 18, 19, 20, 19

$$ \bar{x} = \frac{18+19+20+19}{4} $$

$$ \bar{x} = 19 $$

MLE estimate = 19 kN/m³

Worked Example 5 – River Flow Estimation

River flow (m³/s): 100, 110, 120

$$ \bar{x} = \frac{100+110+120}{3} $$

$$ \bar{x} = 110 $$

Estimated mean river flow = 110 m³/s


Practice Questions

  1. Calculate the first moment for rainfall data: 10, 15, 20.
  2. Use Method of Moments to estimate parameter for data: 5, 7, 9.
  3. Find MLE estimate for mean of values: 12, 15, 18.
  4. Explain difference between Method of Moments and MLE.
  5. Give two civil engineering applications of parameter estimation.

#4 Estimators

Estimation of Parameters and Properties of Estimators

This tutorial explains estimation methods used in statistics. Civil engineers use estimation when analyzing rainfall, traffic flow, soil strength, or material properties.


Module 1: Estimation of Parameters (Sample Mean)

The most common estimator for population mean is the sample mean.

$$ \bar{x} = \frac{\sum x_i}{n} $$

where

  • xᵢ = observations
  • n = sample size

Worked Example 1

Concrete strength (MPa): 28, 30, 27, 29, 31

$$ \bar{x} = \frac{28+30+27+29+31}{5} $$

$$ \bar{x} = 29 $$

Estimated mean strength = 29 MPa

Worked Example 2

Rainfall (mm): 42, 45, 40, 44, 39

$$ \bar{x} = \frac{42+45+40+44+39}{5} $$

$$ \bar{x} = 42 $$

Worked Example 3

Traffic flow (veh/hr): 520, 510, 495, 505, 515

$$ \bar{x} = \frac{520+510+495+505+515}{5} $$

$$ \bar{x} = 509 $$

Worked Example 4

Soil density (kN/m³): 18, 19, 20, 18, 21

$$ \bar{x} = \frac{18+19+20+18+21}{5} $$

$$ \bar{x} = 19.2 $$

Worked Example 5

Bridge load values (kN): 100, 105, 110, 95, 90

$$ \bar{x} = \frac{100+105+110+95+90}{5} $$

$$ \bar{x} = 100 $$


Module 2: Estimators (Sample Variance)

Estimator for population variance:

$$ S^2 = \frac{\sum (x_i-\bar{x})^2}{n-1} $$

Worked Example 1

Data: 4, 6, 8

Mean

$$ \bar{x} = \frac{4+6+8}{3} = 6 $$

Variance

$$ S^2 = \frac{(4-6)^2+(6-6)^2+(8-6)^2}{2} $$

$$ S^2 = 4 $$

Worked Example 2

Data: 2, 4, 6, 8

Mean

$$ \bar{x} = 5 $$

Variance

$$ S^2 = \frac{9+1+1+9}{3} $$

$$ S^2 = 6.67 $$

Worked Example 3

Data: 10, 12, 14

Mean

$$ \bar{x} = 12 $$

Variance

$$ S^2 = \frac{4+0+4}{2} $$

$$ S^2 = 4 $$

Worked Example 4

Data: 5, 7, 9, 11

Mean

$$ \bar{x} = 8 $$

Variance

$$ S^2 = \frac{9+1+1+9}{3} $$

$$ S^2 = 6.67 $$

Worked Example 5

Data: 3, 3, 3, 3

Mean

$$ \bar{x} = 3 $$

Variance

$$ S^2 = 0 $$


Module 3: Bias of an Estimator

Bias formula:

$$ Bias(\hat{\theta}) = E(\hat{\theta}) - \theta $$

Worked Example 1

True mean = 50

Estimated mean = 50

$$ Bias = 50 - 50 = 0 $$

Worked Example 2

True mean = 60

Estimated mean = 58

$$ Bias = 58 - 60 = -2 $$

Worked Example 3

True value = 100

Estimated value = 105

$$ Bias = 105 - 100 = 5 $$

Worked Example 4

True rainfall mean = 40 mm

Estimator average = 42 mm

$$ Bias = 42 - 40 = 2 $$

Worked Example 5

True traffic flow = 500

Estimated mean = 495

$$ Bias = 495 - 500 = -5 $$


Module 4: Precision

Precision depends on estimator variance.

$$ Var(\hat{\theta}) $$

Worked Example 1

Estimator A: 50, 51, 49

Values are close → High precision

Worked Example 2

Estimator B: 40, 60, 50

Large variation → Low precision

Worked Example 3

Variance comparison

Estimator A variance = 2

Estimator B variance = 6

A is more precise.

Worked Example 4

Estimator values: 100, 101, 99, 100

Small variation → High precision

Worked Example 5

Estimator values: 80, 120, 90, 110

Large variation → Low precision


Module 5: Mean Square Error (MSE)

MSE formula:

$$ MSE(\hat{\theta}) = Var(\hat{\theta}) + [Bias(\hat{\theta})]^2 $$

Worked Example 1

Variance = 4

Bias = 0

$$ MSE = 4 $$

Worked Example 2

Variance = 2

Bias = 1

$$ MSE = 2 + 1^2 $$

$$ MSE = 3 $$

Worked Example 3

Variance = 5

Bias = 2

$$ MSE = 5 + 4 $$

$$ MSE = 9 $$

Worked Example 4

Variance = 1

Bias = 0.5

$$ MSE = 1 + 0.25 $$

$$ MSE = 1.25 $$

Worked Example 5

Variance = 3

Bias = 1

$$ MSE = 3 + 1 $$

$$ MSE = 4 $$


Practice Questions

  1. Find mean of 45, 48, 50, 52, 47.
  2. If variance = 6 and bias = 2, find MSE.
  3. Define unbiased estimator.
  4. Explain precision with example.
  5. Calculate variance for data: 2, 4, 6.

#6a Advance Hypothesis Testing

Advanced Hypothesis Testing - Civil Engineering Statistics 🎓 Advanced Hypothesis Testing ...