This page is about Emerging Household Energy: deciding how many households to monitor, and which ones, when a clean cooking programme cannot monitor them all. It applies to surveys and to stove use monitoring. It sets out the statistical requirements a sample must meet, how to calculate and stratify it, how to select households at random, how to adapt the size after each monitoring period, and how to submit project lists for external selection.
The code on this page is an illustrative example. It shows the shape of the data and the calls,
and has not been run as a whole. The api.emerging.eco/v1 calls and the emerging Python client
are not part of the Emerging Platform API contract.
Requirements
Statistical parameters
- Confidence and precision. A 95% confidence level is mandatory, with 5% precision. Factor any imprecision into the emission reduction (ER) calculations.
- Sample parameters. Justify the expected mean and standard deviation with credible data, document the ER coverage percentage, and allow for realistic dropout rates.
- Adaptation. Recalculate after each monitoring period, using the actual variation in the monitoring data, and adjust the size up or down to match.
Stratified sampling
- Calculate the size of each stratum separately, keep the confidence and precision for each stratum, and document each stratum's parameters.
- Base the strata on baseline survey data, and take account of socio-economic factors and geographical differences.
Random selection
- First phase. Document the selection method in the MADD, make the randomness verifiable, and include households that have not adopted.
- Verification phase. Submit the project list to FOEN, including active and planned projects, so that the random selection can be made externally.
Calculate a sample
Illustrative example:
curl -X POST https://api.emerging.eco/v1/sampling \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"projectId": "did:ixo:project/789",
"population": 5000,
"confidence": 0.95,
"precision": 0.05,
"expectedMean": 0.8,
"expectedSD": 0.2,
"dropoutRate": 0.15,
"stratification": {
"enabled": true,
"strata": [
{"name": "urban", "weight": 0.6},
{"name": "rural", "weight": 0.4}
]
}
}'from emerging import SampleCalculator
calculator = SampleCalculator(
project_id="did:ixo:project/789",
confidence=0.95,
precision=0.05
)
sample_size = calculator.compute(
population=5000,
expected_mean=0.8,
expected_sd=0.2,
dropout_rate=0.15,
stratification={
"enabled": True,
"strata": [
{"name": "urban", "weight": 0.6},
{"name": "rural", "weight": 0.4}
]
}
)Sample design
A sample design records the parameters, the calculated and adjusted sizes, the strata and its verification.
Illustrative example:
{
"designId": "sample-123",
"projectId": "did:ixo:project/789",
"parameters": {
"confidence": 0.95,
"precision": 0.05,
"population": 5000,
"calculatedSize": 357,
"adjustedSize": 420,
"dropoutRate": 0.15,
"erCoverage": 0.85
},
"stratification": {
"method": "proportional",
"strata": [{
"name": "urban",
"population": 3000,
"sampleSize": 252,
"mean": 0.8,
"sd": 0.2
}, {
"name": "rural",
"population": 2000,
"sampleSize": 168,
"mean": 0.75,
"sd": 0.25
}]
},
"verification": {
"status": "approved",
"verifier": "did:ixo:validator/456",
"timestamp": "2024-02-20T10:00:00Z"
}
}Step by step
Calculate the base size, adjust it for a finite population and for dropout, then allocate it across strata.
Illustrative example:
from emerging import CDMCalculator, StratificationEngine
# Initialize CDM calculator
calculator = CDMCalculator()
# Calculate base sample size
base_size = calculator.compute_base_size(
mean=0.8,
sd=0.2,
confidence=0.95,
precision=0.05
)
# Adjust for finite population
adjusted_size = calculator.adjust_for_population(
base_size=base_size,
population=5000
)
# Account for dropout
final_size = calculator.adjust_for_dropout(
sample_size=adjusted_size,
dropout_rate=0.15
)
# Stratify if needed
stratification = StratificationEngine()
strata_sizes = stratification.allocate(
total_size=final_size,
strata=[
{"name": "urban", "weight": 0.6},
{"name": "rural", "weight": 0.4}
]
)Select households at random
Illustrative example:
from emerging import RandomSelector
selector = RandomSelector(seed=20240220)
# Generate random sample
sample = selector.select(
population_list="household_registry.csv",
sample_size=420,
stratification={
"column": "region",
"sizes": strata_sizes
}
)
# Validate selection
validation = selector.validate_randomness(
selected_sample=sample,
confidence=0.95
)Adapt the sample after each period
Recalculate the size from the period's actual mean and standard deviation, and produce an adjustment plan if the size must change.
Illustrative example:
from emerging import SampleMonitor
monitor = SampleMonitor("did:ixo:project/789")
# Analyze current data
stats = monitor.analyze_current_period(
start_date="2024-01-01",
end_date="2024-01-31"
)
# Recalculate sample size
new_size = monitor.recalculate_size(
current_mean=stats.mean,
current_sd=stats.sd
)
# Check if adjustment needed
if monitor.requires_adjustment(new_size):
adjustment = monitor.generate_adjustment_plan()Illustrative example: the same with the actual dropout rate taken into account.
from emerging import AdaptiveSampling
adaptive = AdaptiveSampling(project_id="did:ixo:project/789")
# Analyze current monitoring data
current_stats = adaptive.analyze_period(
start_date="2024-01-01",
end_date="2024-01-31"
)
# Recalculate using actual data
new_sample_size = adaptive.recalculate(
actual_mean=current_stats.mean,
actual_sd=current_stats.sd,
current_dropout_rate=current_stats.dropout_rate
)
# Generate adaptation plan if needed
if adaptive.requires_adjustment(new_sample_size):
plan = adaptive.create_adjustment_plan(
current_size=current_stats.sample_size,
required_size=new_sample_size,
implementation_date="2024-03-01"
)Manage dropout
Start with a realistic dropout rate, track actual dropouts, and compensate if they differ.
Illustrative example:
# Configure with realistic dropout rate
calculator = CDMCalculator(
base_confidence=0.95,
base_precision=0.05,
dropout_buffer=0.15 # 15% dropout rate
)
# Track actual dropouts
dropout_analysis = calculator.analyze_dropouts(
historical_data="2023",
current_period="2024-Q1"
)
# Adjust sample size if needed
adjusted_size = calculator.compensate_for_dropouts(
current_size=400,
actual_dropout_rate=dropout_analysis.rate
)Submit project lists to FOEN
For external random selection, prepare a list of active and planned projects and submit it to FOEN.
Illustrative example:
from emerging import VerificationSubmission
submission = VerificationSubmission(
project_id="did:ixo:project/789"
)
# Prepare project list
project_list = submission.prepare_project_list(
active_projects=True,
planned_projects=True
)
# Submit for sampling
response = submission.submit_to_foen(
project_list=project_list,
monitoring_period="2024-Q1"
)Illustrative example: the same submission with the ER coverage and the supporting data attached.
from emerging import FOENSubmission
submission = FOENSubmission(project_id="did:ixo:project/789")
# Prepare project list for random selection
project_list = submission.prepare_list(
active_projects=True,
planned_projects=True,
monitoring_period="2024-Q2"
)
# Submit for random sampling
response = submission.submit_to_foen(
project_list=project_list,
er_coverage_percentage=0.85, # Document ER coverage
supporting_data={
"mean_justification": "historical_data.pdf",
"sd_calculation": "variance_analysis.pdf"
}
)When something goes wrong
Invalid sampling parameters
Insufficient population data
Conflicting stratum definitions
Practices
| Area | What to do |
|---|---|
| Sample design | Document all assumptions, justify the stratification, consider seasonal variation, plan for dropouts and keep strata independent. |
| Data quality | Validate input parameters, monitor dropout and response rates, document non-responses and verify the random selection. |
| Adaptation | Recalculate regularly, document changes, update the stratification, keep the precision and track ER coverage. |
| Verification | Prepare FOEN submissions, document the selection process, keep project lists, track verification status and archive supporting data. |
Next steps
- Qualitative surveys: apply sampling to surveys.
- Stove use monitoring: sample sensor deployments.
- Kitchen performance tests: sample households for fuel tests.