Skip to main content
Lesson 2 of 5advanced

Monte Carlo Simulation in Practice

A hands-on guide to implementing Monte Carlo simulation for uncertainty quantification in your LCA studies.

35 minUpdated Jan 15, 2025

Prerequisites:

uncertainty-analysis

Monte Carlo Simulation in Practice

Monte Carlo simulation transforms uncertain LCA inputs into probabilistic outputs, enabling robust decision-making under uncertainty. This lesson provides practical guidance on implementing Monte Carlo analysis in your LCA work.

Monte Carlo Fundamentals

The Core Concept

Monte Carlo simulation works by:

  1. Treating uncertain inputs as probability distributions
  2. Randomly sampling from these distributions
  3. Running the LCA calculation with each sample set
  4. Collecting results to form an output distribution

After many iterations, the output distribution represents the range of possible outcomes given input uncertainties.

When to Use Monte Carlo

Monte Carlo is valuable when:

  • Comparing products with similar performance
  • Making high-stakes decisions based on LCA results
  • Communicating results to skeptical audiences
  • Validating the robustness of conclusions
  • Understanding which parameters drive uncertainty

It may be unnecessary for:

  • Screening studies where precision isn't critical
  • Situations where one option clearly dominates
  • Internal quick assessments
  • Educational purposes

Setting Up Distributions

Choosing Distribution Types

Match distributions to your knowledge about each parameter:

Lognormal (most common for LCA)

Use when:

  • Values must be positive
  • You have a mean and estimate of spread
  • Variation is proportional to magnitude

Parameters:

  • Geometric mean (μg): the median value
  • Geometric standard deviation (σg): multiplicative spread

If you believe the true value is between L and H with 95% confidence:

σg ≈ √(H/L) / 1.645
μg ≈ √(L × H)

Normal

Use when:

  • Values can be positive or negative
  • Symmetric variation around mean
  • You have mean and standard deviation

Triangular

Use when:

  • You can estimate minimum, maximum, and most likely
  • Expert judgment drives the estimate
  • Data is limited

Uniform

Use when:

  • Only bounds are known
  • All values within range are equally likely

Practical Distribution Selection

SituationRecommended Distribution
Measured data with known SDNormal (if symmetric) or Lognormal
Database values with pedigreeLognormal (use pedigree factors)
Expert estimate with rangeTriangular
Only bounds knownUniform
Ratio or multiplicative uncertaintyLognormal

The Pedigree-to-Distribution Workflow

ecoinvent and other databases use pedigree matrices to generate lognormal distributions:

  1. Assess pedigree scores (1-5) for each indicator
  2. Look up uncertainty factors from pedigree tables
  3. Calculate combined uncertainty:
    σg² = σbase² + σR² + σC² + σT² + σG² + σTech²
    
  4. Apply to parameter as lognormal(mean, σg)

Illustrative pedigree uncertainty factors (σ² values):

ScoreReliabilityCompletenessTemporalGeographicTechnological
10.0000.0000.0000.0000.000
20.00060.00010.00020.00010.0006
30.0020.00060.0020.00040.008
40.0080.0020.0080.040.04
50.040.0080.040.120.12

Implementing Monte Carlo

Implementation Steps

Step 1: Identify uncertain parameters

Not everything needs uncertainty distributions. Focus on:

  • Parameters with significant contributions to results
  • Parameters with known data quality issues
  • Parameters where alternatives exist

Step 2: Assign distributions

Document your choices:

ParameterDistributionParametersRationale
Electricity useLognormalμg=2.5 kWh, σg=1.25Pedigree assessment
Transport dist.Triangular300, 500, 800 kmExpert estimate
Steel inputLognormalμg=15 kg, σg=1.1Measured with ±10% uncertainty

Step 3: Handle correlations

Identify correlated parameters:

  • Electricity and cooling water (both scale with production)
  • Material input and waste output (mass balance)
  • Regional parameters (shared data source)

Options for handling:

  • Sample correlated parameters together
  • Use copulas for complex correlation structures
  • Document and acknowledge if not addressed

Step 4: Run simulation

Number of iterations needed depends on:

  • Required precision of percentile estimates
  • Complexity of the model
  • Available computation time

General guidance:

  • 1,000 iterations: Rough estimates, screening
  • 10,000 iterations: Standard analysis
  • 100,000+ iterations: High precision, rare events

Step 5: Analyze results

Calculate and report:

  • Mean, median, standard deviation
  • Confidence intervals (e.g., 5th-95th percentile)
  • Probability of exceeding thresholds
  • For comparisons: probability A < B

Software-Specific Guidance

openLCA

  1. Add uncertainty to flows:

    • Open a process
    • Click an input/output amount
    • Select "Define uncertainty"
    • Choose distribution and parameters
  2. Run Monte Carlo:

    • Open product system
    • Click Calculate → Monte Carlo simulation
    • Select LCIA method
    • Set number of iterations
    • Run and wait
  3. Analyze results:

    • View histogram of results
    • Export data for external analysis
    • Compare distributions across impact categories

SimaPro

  1. Define uncertainty:

    • In process records, enter uncertainty for each exchange
    • Use default pedigree-based uncertainty or custom distributions
  2. Run analysis:

    • Calculate → Monte Carlo
    • Set iterations and confidence level
    • View statistical results and graphs
  3. Advanced features:

    • Contribution to variance analysis
    • Comparative Monte Carlo for alternatives

Python/Brightway

import brightway2 as bw
import numpy as np
from scipy import stats

# Setup
bw.projects.set_current("your_project")
db = bw.Database("your_database")
method = ('ReCiPe Midpoint', 'climate change', 'GWP100')

# Define activity
activity = db.get("your_activity_code")

# Monte Carlo LCA
mc = bw.MonteCarloLCA({activity: 1}, method)
results = [next(mc) for _ in range(1000)]

# Analysis
mean = np.mean(results)
median = np.median(results)
ci_95 = np.percentile(results, [2.5, 97.5])

print(f"Mean: {mean:.2f}")
print(f"Median: {median:.2f}")
print(f"95% CI: [{ci_95[0]:.2f}, {ci_95[1]:.2f}]")

Analyzing Monte Carlo Results

Statistical Summary

Report these statistics:

StatisticCalculationInterpretation
MeanSum/NAverage expected value
Median50th percentileCentral tendency (robust to outliers)
SD√(Σ(x-mean)²/N)Spread of results
CVSD/Mean × 100%Relative spread
95% CI2.5th to 97.5th percentileRange capturing 95% of outcomes

Contribution to Variance

Identify which inputs drive output uncertainty:

  1. Calculate correlation between each input and the output
  2. Square correlations to get variance contribution
  3. Rank parameters by contribution

Parameters contributing most to variance are priorities for:

  • Better data collection
  • Sensitivity testing
  • Uncertainty reduction efforts

Comparing Alternatives

For product comparisons, calculate:

Pairwise difference in each iteration:

diff[i] = GWP_A[i] - GWP_B[i]

Probability of outperformance:

P(A better) = count(diff < 0) / N

Significant difference: If 95% CI of difference excludes zero, the difference is statistically significant.

Visualization

Histograms: Show distribution shape

  • Include mean/median lines
  • Mark confidence intervals
  • Use consistent binning across comparisons

Box plots: Compare multiple options

  • Show median, quartiles, outliers
  • Easy comparison across alternatives

Cumulative distribution functions (CDF): Show probability of exceedance

  • Read off probability of meeting targets
  • Compare entire distributions

Scatter plots: Show input-output relationships

  • Identify influential parameters
  • Reveal non-linear relationships

Handling Common Issues

Convergence

Results should stabilize as iterations increase. Check convergence by:

  1. Plot running mean vs. iteration number
  2. If mean is still changing significantly, run more iterations
  3. For percentile estimates, need more iterations than for mean

Extreme Values

Outliers in results may indicate:

  • Very wide input distributions
  • Multiplicative effects through supply chain
  • Model sensitivity to certain parameter combinations

Investigate extreme values to ensure they're meaningful, not errors.

Negative Values

If physical quantities go negative (impossible):

  • Check distribution choices (use lognormal for positive-only)
  • Truncate distributions at zero
  • Re-parameterize model

Long Run Times

For complex models:

  • Start with fewer iterations for testing (100-500)
  • Use parallel processing if available
  • Consider simplified models for screening
  • Focus uncertainty on most influential parameters

Advanced Topics

Latin Hypercube Sampling

More efficient than simple random sampling:

  • Stratifies each distribution into equal-probability intervals
  • Ensures full distribution coverage with fewer samples
  • Often achieves convergence 10x faster

Most LCA software offers this as an option.

Global Sensitivity Analysis

Beyond local sensitivity, global methods explore the entire parameter space:

Sobol' indices: Decompose variance into first-order and interaction effects

Morris method: Efficient screening for many parameters

These reveal non-linear effects and parameter interactions missed by local sensitivity.

Bayesian Approaches

For incorporating prior knowledge and updating with new data:

  • Prior distributions reflect existing knowledge
  • Likelihood function incorporates new observations
  • Posterior distribution combines both

Advanced topic requiring specialized tools (e.g., PyMC, Stan).

Key Takeaways

  1. Choose distributions based on available information—lognormal is often appropriate
  2. Focus uncertainty analysis on influential parameters
  3. Run enough iterations for stable results (10,000 is typical)
  4. For comparisons, calculate probability of outperformance
  5. Report confidence intervals, not just point estimates
  6. Contribution to variance identifies priorities for data improvement

Practice Exercise

For a simplified product system with three uncertain inputs:

  • Material A: Lognormal(10 kg, σg=1.3)
  • Energy: Triangular(5, 8, 15 kWh)
  • Transport: Uniform(100, 500 km)

Emission factors (assume known):

  • Material A: 2.5 kg CO₂/kg
  • Energy: 0.5 kg CO₂/kWh
  • Transport: 0.1 kg CO₂/km
  1. Calculate the deterministic GWP (using mean/mode values)
  2. Set up and run 1,000 Monte Carlo iterations
  3. Report mean, median, and 95% CI
  4. Which parameter contributes most to variance?

What's Next?

The next lesson explores the distinction between consequential and attributional LCA—two fundamentally different approaches to modeling that answer different questions about environmental impacts.


Further Reading

  • Heijungs, R. (2020). On the Number of Monte Carlo Runs in Comparative Probabilistic LCA. International Journal of Life Cycle Assessment.
  • Saltelli, A., et al. (2008). Global Sensitivity Analysis: The Primer. Wiley.
  • Groen, E.A., & Heijungs, R. (2017). Ignoring Correlation in Uncertainty and Sensitivity Analysis in Life Cycle Assessment. International Journal of Life Cycle Assessment.