PMF Basics
This guide explains the fundamental concepts behind Positive Matrix Factorization (PMF) and how it applies to environmental data analysis.
What is PMF?
Positive Matrix Factorization (PMF) is a statistical technique used to identify and quantify sources of pollution in environmental data. It's particularly useful for source apportionment - determining what sources (traffic, industry, natural, etc.) contribute to measured pollutant concentrations.
The Mathematical Foundation
PMF decomposes a data matrix X into two matrices:
X = G × F + E
Where:
- X (n×m): Measured concentrations (n samples × m chemical species)
- G (n×p): Factor contributions (n samples × p factors/sources)
- F (p×m): Factor profiles (p factors × m chemical species)
- E (n×m): Residual matrix (unexplained variance)

Key Constraints
- Non-negativity: All values in G and F must be ≥ 0
- Error weighting: Uses measurement uncertainties to weight the fitting process
- Least squares: Minimizes the sum of squared residuals weighted by uncertainties
Why Use PMF?
Advantages
- Physically meaningful: Non-negative constraints ensure realistic results
- Uncertainty handling: Incorporates measurement uncertainties
- No a priori source profiles: Doesn't require prior knowledge of source signatures
- Robust: Less sensitive to outliers than other factor analysis methods
- Quantitative: Provides both source profiles and contributions
Limitations
- Requires expertise: Results need interpretation by domain experts
- Local minimum: May converge to suboptimal solutions
- Factor number: Choosing the right number of factors can be challenging
- Rotational ambiguity: Multiple mathematically equivalent solutions may exist
PMF in Environmental Science
Common Applications
- Air Quality: PM2.5, PM10 source apportionment
- Water Quality: Pollution source identification in water bodies
- Soil Contamination: Heavy metal source apportionment
- Indoor Air: Identifying indoor pollution sources
Typical Workflow
graph TD
A[Collect Environmental Data] --> B[Data Quality Control]
B --> C[Uncertainty Estimation]
C --> D[PMF Analysis]
D --> E[Model Evaluation]
E --> F[Source Interpretation]
F --> G[Policy Recommendations]
Understanding PMF Results
Factor Contributions (G Matrix)
The G matrix shows when and how much each source contributed:
Interpretation: - Each row represents a time point (sample) - Each column represents a factor/source - Values show the mass contribution from each source
Factor Profiles (F Matrix)
The F matrix shows what chemical signature characterizes each source:
Interpretation: - Each row represents a factor/source - Each column represents a chemical species - Values show the relative abundance of each species in the source
Quality Metrics
Q-value (Goodness of Fit)
The Q-value measures how well the model fits the data:
Interpretation: - Lower Q-values indicate better fit - Theoretical minimum: Q_theo = (n_samples × n_species) - (n_factors × (n_samples + n_species)) - Robust if Q_true/Q_theo ≈ 1
Residual Analysis
# Calculate residuals
reconstructed = pmf.contributions_ @ pmf.profiles_
residuals = concentrations - reconstructed
# Scaled residuals
scaled_residuals = residuals / uncertainties
Good model characteristics: - Residuals normally distributed around zero - No systematic patterns in residuals - |Scaled residuals| < 3 for most data points
Source Identification
Chemical Fingerprinting
Different sources have characteristic chemical signatures:
| Source Type | Key Tracers | Typical Profile |
|---|---|---|
| Traffic | EC, OC, NO₃⁻, metals (Cu, Zn) | High EC/OC ratio |
| Coal Combustion | SO₄²⁻, As, Se, trace metals | High sulfate |
| Sea Salt | Na⁺, Cl⁻, Mg²⁺ | High Na/Cl ratio |
| Soil Dust | Al, Si, Ca, Ti, Fe | Crustal elements |
| Secondary Sulfate | SO₄²⁻, NH₄⁺ | High sulfate/low primary |
| Biomass Burning | K⁺, OC, levoglucosan | High K/EC ratio |
Expert Interpretation
Successful PMF requires domain expertise to:
- Assign source names based on chemical profiles
- Validate results against known sources in the area
- Check seasonal patterns for consistency
- Compare with other studies in similar environments
Model Validation
Bootstrap Analysis
Test model stability by:
# Pseudo-code for bootstrap validation
results = []
for i in range(100):
# Resample data with replacement
boot_data = concentrations.sample(frac=1, replace=True)
boot_unc = uncertainties.loc[boot_data.index]
# Fit PMF
pmf_boot = PMF(n_components=5, random_state=i)
pmf_boot.fit(boot_data, boot_unc)
results.append(pmf_boot.profiles_)
# Analyze stability of profiles
Displacement Analysis
Test factor number by:
- Running PMF with p factors
- Running PMF with p+1 factors
- Checking if new factor splits existing factors
External Validation
Compare with: - Emission inventories: Known source locations and strengths - Meteorological data: Wind patterns and source directions - Other studies: Results from similar environments
Best Practices
Data Preparation
- Quality control: Remove outliers and invalid data
- Species selection: Include species with good signal-to-noise ratio
- Uncertainty estimation: Use realistic uncertainty estimates
- Missing data: Handle carefully or exclude
Model Selection
- Start simple: Begin with fewer factors, increase gradually
- Multiple runs: Use different random seeds to check stability
- Physical constraints: Ensure results make physical sense
- Cross-validation: Use bootstrap or other validation methods
Result Interpretation
- Domain knowledge: Use local source knowledge
- Temporal patterns: Check if seasonal patterns make sense
- Spatial coherence: Compare with nearby sites if available
- Literature comparison: Compare with published studies
Common Pitfalls
Data Issues
- Bad uncertainty estimates: Can lead to poor convergence
- Too many zero values: Can cause numerical instability
- Correlated species: May cause factor mixing
- Outliers: Can dominate factor profiles
Model Issues
- Wrong factor number: Too few misses sources, too many creates splits
- Poor convergence: May indicate data problems or wrong parameters
- Factor swapping: Factors may swap between runs (use rotation)
- Edge effects: Factors with very low contributions may be artifacts
Interpretation Issues
- Over-interpretation: Don't assign sources without chemical evidence
- Ignoring uncertainty: Always consider bootstrap confidence intervals
- Temporal inconsistency: Check if source patterns make temporal sense
- Missing validation: Always validate against external information
Next Steps
- Learn about Data Preparation techniques
- Explore Running Analysis workflows
- Understand Interpreting Results in detail
- See practical Examples