Complete Documentation & User Guide
Master the MC2D Simulator with our comprehensive guides, theory explanations, and practical references.
๐ MC2D Process-Based Simulator: Ultimate User Manual ๐
First of all, please download and run the MC2D Simulator in your computer as per the guidance from this link.
๐ Table of Contents
๐ Introduction & Getting Started
What is MC2D? ✨
Who is this for? ๐ฅ
How to use this manual ๐
⏱️ Your first simulation in 10 minutes
๐ Step-by-step with screenshots
❌ Common mistakes to avoid
๐ฎ Understanding the Interface
๐ Main dashboard overview
๐งฉ Module-by-module guide
๐ก Navigation tips & tricks
๐ Distribution Fitting Module
๐ How to analyze your data
⚠️ Working with censored data
๐ Finding the best distribution
๐️ Building Your Risk Model
๐ง Process-based thinking explained
๐ง Creating processes and calculations
✍️ Formula writing made easy
⚡ Setting up your simulation
๐ฏ Understanding variability vs uncertainty
๐ Interpreting results
๐ฌ Sensitivity analysis
๐ Scenario comparisons
๐ Correlation management
๐ Example 1: Salmonella in chicken
๐ง Example 2: Listeria in ready-to-eat foods
๐ง Example 3: Waterborne pathogens
❗ Common errors and fixes
⚡ Performance optimization
❓ Getting help
✅ Data quality guidelines
๐ Model validation checklist
๐ Reporting standards
๐ Introduction & Getting Started
What is MC2D? ✨
Who is this for? ๐ฅ
How to use this manual ๐
⏱️ Your first simulation in 10 minutes
๐ Step-by-step with screenshots
❌ Common mistakes to avoid
๐ฎ Understanding the Interface
๐ Main dashboard overview
๐งฉ Module-by-module guide
๐ก Navigation tips & tricks
๐ Distribution Fitting Module
๐ How to analyze your data
⚠️ Working with censored data
๐ Finding the best distribution
๐️ Building Your Risk Model
๐ง Process-based thinking explained
๐ง Creating processes and calculations
✍️ Formula writing made easy
⚡ Setting up your simulation
๐ฏ Understanding variability vs uncertainty
๐ Interpreting results
๐ฌ Sensitivity analysis
๐ Scenario comparisons
๐ Correlation management
๐ Example 1: Salmonella in chicken
๐ง Example 2: Listeria in ready-to-eat foods
๐ง Example 3: Waterborne pathogens
❗ Common errors and fixes
⚡ Performance optimization
❓ Getting help
✅ Data quality guidelines
๐ Model validation checklist
๐ Reporting standards
1. ๐ Introduction & Getting Started
✨ Welcome to MC2D! ✨
๐ Congratulations! You're about to use one of the most powerful risk assessment tools available!
The MC2D Process-Based Simulator is your Swiss Army knife for risk assessment! ๐ง Unlike traditional methods that mix everything together, MC2D gives you super-vision to see two critical dimensions separately:
๐ญ Variability – Natural differences between individuals
Example: Different people eat different amounts of food
๐น Think: "Differences between people"❓ Uncertainty – Lack of knowledge about parameters
Example: We're not exactly sure about contamination levels
๐ธ Think: "What we don't know"
๐ฏ The Magic: By separating these, you get clearer insights and better decisions!
๐ฅ Who Should Use This Manual?
Role Focus Areas Time Commitment ๐ถ First-time Users Sections 2, 3 30 minutes ๐ฌ Risk Assessors Sections 4-6 2-3 hours ๐ Researchers/Students All sections 4-5 hours ๐ Managers/Decision-makers Sections 1, 2, 10 1 hour
| Role | Focus Areas | Time Commitment |
|---|---|---|
| ๐ถ First-time Users | Sections 2, 3 | 30 minutes |
| ๐ฌ Risk Assessors | Sections 4-6 | 2-3 hours |
| ๐ Researchers/Students | All sections | 4-5 hours |
| ๐ Managers/Decision-makers | Sections 1, 2, 10 | 1 hour |
๐ What You Need Before Starting
✅ Basic computer skills
✅ Your data (or example data to practice)
✅ A specific risk question you want to answer
✅ About 30 minutes for your first simulation
✅ Curiosity! ๐ง
2. ⚡ Quick Start Guide
⏱️ Your First Simulation in 10 Minutes!
๐ฏ Goal: Run a complete risk assessment using a template model.
๐ Step 1: Launch the Application
Open the MC2D Simulator in your web browser ๐
You'll see this beautiful dashboard:
text╔═══════════════════════════════════════╗
║ ๐ฏ MC2D SIMULATOR v1.1.0 ║
║ Process-Based QMRA Simulation ║
╚═══════════════════════════════════════╝
Open the MC2D Simulator in your web browser ๐
You'll see this beautiful dashboard:
╔═══════════════════════════════════════╗ ║ ๐ฏ MC2D SIMULATOR v1.1.0 ║ ║ Process-Based QMRA Simulation ║ ╚═══════════════════════════════════════╝
๐ Step 2: Load a Template
Click → Monte Carlo Model Setup in sidebar
Select → "Salmonella in Whole Chickens" ๐
Click → "Load Template" ๐
Click → "Save Model" ๐พ (always save your starting point!)
Click → Monte Carlo Model Setup in sidebar
Select → "Salmonella in Whole Chickens" ๐
Click → "Load Template" ๐
Click → "Save Model" ๐พ (always save your starting point!)
๐ Template Loaded! You now have a complete working model!
๐ Step 3: Quick Simulation
Go to → Simulation Control
Set these values:
text⚙️ Settings:
┌─────────────────────────────────┐
│ • Variability iterations: 1000 │
│ • Uncertainty iterations: 100 │
│ • Random seed: 12345 │
└─────────────────────────────────┘
Click → "Validate Model" ✅ (checks for errors)
Click → "Run MC Simulation" ๐
Wait ⏳ (about 1-2 minutes)
Go to → Simulation Control
Set these values:
⚙️ Settings: ┌─────────────────────────────────┐ │ • Variability iterations: 1000 │ │ • Uncertainty iterations: 100 │ │ • Random seed: 12345 │ └─────────────────────────────────┘
Click → "Validate Model" ✅ (checks for errors)
Click → "Run MC Simulation" ๐
Wait ⏳ (about 1-2 minutes)
๐ Step 4: View Your First Results!
Go to → Basic Results
Select → "final_mpn" from dropdown
Behold! Your first histogram appears ๐
Go to → Basic Results
Select → "final_mpn" from dropdown
Behold! Your first histogram appears ๐
๐ What You're Seeing:
┌─────────────────────────────────────┐ │ Distribution of Salmonella Levels │ │ │ │ Mean: 15.2 CFU/g │ │ Median: 8.7 CFU/g │ │ 95th percentile: 45.3 CFU/g │ └─────────────────────────────────────┘
๐ Congratulations!
You've just completed your first MC2D simulation! Give yourself a pat on the back! ๐
3. ๐ฎ Understanding the Interface
๐ Main Dashboard Layout
text╔══════════════════════════════════════════════════════════════╗
║ ๐ฏ MC2D DASHBOARD ║
╠════════════════════════════════╦═════════════════════════════╣
║ ๐ LEFT SIDEBAR ║ ๐จ MAIN WORKSPACE ║
║ ║ ║
║ ๐ Distribution Fitting ║ This is where the magic ║
║ ๐️ Model Setup ║ happens! Each module ║
║ ๐ง Process Configuration ║ opens here when selected. ║
║ ⚡ Advanced Features ║ ║
║ ๐ Simulation Control ║ Think of it as your ║
║ ๐ Basic Results ║ workbench or canvas! ║
║ ๐ฌ Advanced Analysis ║ ║
║ ๐ Documentation ║ ║
║ ๐ License Management ║ ║
╚════════════════════════════════╩═════════════════════════════╝
╔══════════════════════════════════════════════════════════════╗ ║ ๐ฏ MC2D DASHBOARD ║ ╠════════════════════════════════╦═════════════════════════════╣ ║ ๐ LEFT SIDEBAR ║ ๐จ MAIN WORKSPACE ║ ║ ║ ║ ║ ๐ Distribution Fitting ║ This is where the magic ║ ║ ๐️ Model Setup ║ happens! Each module ║ ║ ๐ง Process Configuration ║ opens here when selected. ║ ║ ⚡ Advanced Features ║ ║ ║ ๐ Simulation Control ║ Think of it as your ║ ║ ๐ Basic Results ║ workbench or canvas! ║ ║ ๐ฌ Advanced Analysis ║ ║ ║ ๐ Documentation ║ ║ ║ ๐ License Management ║ ║ ╚════════════════════════════════╩═════════════════════════════╝
๐งฉ Module Roadmap
Module Icon Purpose Best For Distribution Fitting ๐ Analyze data, find best distributions Data preparation phase Model Setup ๐️ Start projects, use templates Beginning any project Process Configuration ๐ง Build your risk model step-by-step Model development Simulation Control ๐ Run Monte Carlo simulations Execution phase Basic Results ๐ View and explore outputs Immediate analysis Advanced Analysis ๐ฌ Deep dive, sensitivity, scenarios Detailed investigation Documentation ๐ Help guides and references Learning & troubleshooting
| Module | Icon | Purpose | Best For |
|---|---|---|---|
| Distribution Fitting | ๐ | Analyze data, find best distributions | Data preparation phase |
| Model Setup | ๐️ | Start projects, use templates | Beginning any project |
| Process Configuration | ๐ง | Build your risk model step-by-step | Model development |
| Simulation Control | ๐ | Run Monte Carlo simulations | Execution phase |
| Basic Results | ๐ | View and explore outputs | Immediate analysis |
| Advanced Analysis | ๐ฌ | Deep dive, sensitivity, scenarios | Detailed investigation |
| Documentation | ๐ | Help guides and references | Learning & troubleshooting |
๐ก Pro Navigation Tips
๐น Use templates – They're like training wheels! ๐ด
๐น Save frequently – Ctrl+S habit saves headaches! ๐พ
๐น Validate before running – Prevent "oops" moments! ✅
๐น Check Process Flow – See your model's "mind map"! ๐ง
๐น Use keyboard shortcuts – Faster navigation! ⌨️
4. ๐ Distribution Fitting Module
๐ฏ When to Use This Module?
๐ Use Distribution Fitting when:
๐ You have measurement data
❓ You need to characterize uncertainty
๐ฏ You want statistically rigorous inputs
๐ Step-by-Step: Complete Data Analysis
A. ๐ Quick Analysis (5 minutes)
๐ Choose data source:
textOptions:
• ๐ค Upload CSV (your own data)
• ๐ Use Example Data (practice)
• ⚠️ Use Censored Data (detection limits)
๐ฏ Select distributions:
text๐ For concentrations: Weibull, Lognormal, Gamma
๐ฒ For probabilities: Beta
๐ข For counts: Poisson, Negative Binomial
๐ Run analysis:
Click "Fit Distributions"
Wait for magic to happen! ✨
๐ Interpret results:
text๐ Best Fit = Lowest AIC Value!
Example Results:
┌─────────────────┬─────────┐
│ Distribution │ AIC │
├─────────────────┼─────────┤
│ ✅ Lognormal │ 250.3 │
│ ๐ธ Gamma │ 255.7 │
│ ๐น Weibull │ 260.1 │
└─────────────────┴─────────┘
๐ Choose data source:
Options: • ๐ค Upload CSV (your own data) • ๐ Use Example Data (practice) • ⚠️ Use Censored Data (detection limits)
๐ฏ Select distributions:
๐ For concentrations: Weibull, Lognormal, Gamma ๐ฒ For probabilities: Beta ๐ข For counts: Poisson, Negative Binomial
๐ Run analysis:
Click
"Fit Distributions"Wait for magic to happen! ✨
๐ Interpret results:
๐ Best Fit = Lowest AIC Value! Example Results: ┌─────────────────┬─────────┐ │ Distribution │ AIC │ ├─────────────────┼─────────┤ │ ✅ Lognormal │ 250.3 │ │ ๐ธ Gamma │ 255.7 │ │ ๐น Weibull │ 260.1 │ └─────────────────┴─────────┘
⚠️ Special: Censored Data Handling
What is censored data?
When your instrument says "I can't measure that precisely!"
๐ Detection Limit Examples: • "<10 CFU/g" → ๐ซ Left-censored • ">1000 CFU/g" → ๐ซ Right-censored • "Between 50-100" → ⚠️ Interval-censored
๐ How to format your data:
left,right NA,10 # <10 CFU/g 25,25 # Exactly 25 CFU/g 100,NA # >100 CFU/g 15,25 # Between 15-25 CFU/g
๐ก Pro Tips for Distribution Fitting
๐ Sample Size Matters:
n < 30: Be cautious! ⚠️
n = 30-100: Good for most analyses ๐
n > 100: Excellent! ๐
๐ฏ Distribution Selection:
textData Pattern → Recommended Distribution
───────────────────────────────────────
๐ Right-skewed positive data → Lognormal
⏰ Waiting times → Gamma/Weibull
๐ฒ Probabilities (0-1) → Beta
๐ข Count data → Poisson/Negative Binomial
✅ Validation Checklist:
Q-Q plot points follow straight line
P-P plot close to diagonal
AIC difference > 2 between best and second-best
Parameters make scientific sense
An example of Comprehensive distribution fitting report generated by MC2D Simulator: Distribution Fitting Module is available in this link.
๐ Sample Size Matters:
n < 30: Be cautious! ⚠️
n = 30-100: Good for most analyses ๐
n > 100: Excellent! ๐
๐ฏ Distribution Selection:
Data Pattern → Recommended Distribution ─────────────────────────────────────── ๐ Right-skewed positive data → Lognormal ⏰ Waiting times → Gamma/Weibull ๐ฒ Probabilities (0-1) → Beta ๐ข Count data → Poisson/Negative Binomial
✅ Validation Checklist:
Q-Q plot points follow straight line
P-P plot close to diagonal
AIC difference > 2 between best and second-best
Parameters make scientific sense
An example of Comprehensive distribution fitting report generated by MC2D Simulator: Distribution Fitting Module is available in this link.
5. ๐️ Building Your Risk Model
๐ง Process-Based Thinking: The Game Changer!
Think of your risk assessment as a story or recipe:
๐ The Salmonella Story:
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ ๐ Farm │────▶ ๐ Transport │────▶ ๐ช Retail │
│ Contamination│ │ Growth │ │ Storage │
└─────────────┘ └─────────────┘ └─────────────┘
│ │ │
▼ ▼ ▼
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ ๐ฉ๐ณ Home │────▶ ๐ฝ️ Serving │────▶ ๐ท Illness │
│ Cooking │ │ Transfer │ │ Risk │
└─────────────┘ └─────────────┘ └─────────────┘Each arrow = A Process in MC2D
Each box = Calculations that transform data
๐ง Creating Your First Custom Model
Step 1: ๐️ Define Processes
Process Name Type Icon Purpose Farm Contamination Input/Source ๐ Starting contamination level Transport Growth Processing Step ๐ Bacteria multiply during transport Retail Storage Processing Step ๐ช Further growth at store Home Cooking Processing Step ๐ฉ๐ณ Heat kills bacteria Serving Transfer Processing Step ๐ฝ️ Cross-contamination during serving Risk Calculation Risk Calculation ๐ท Calculate illness probability Final Results Output/Final ๐ Summary outputs
| Process Name | Type | Icon | Purpose |
|---|---|---|---|
| Farm Contamination | Input/Source | ๐ | Starting contamination level |
| Transport Growth | Processing Step | ๐ | Bacteria multiply during transport |
| Retail Storage | Processing Step | ๐ช | Further growth at store |
| Home Cooking | Processing Step | ๐ฉ๐ณ | Heat kills bacteria |
| Serving Transfer | Processing Step | ๐ฝ️ | Cross-contamination during serving |
| Risk Calculation | Risk Calculation | ๐ท | Calculate illness probability |
| Final Results | Output/Final | ๐ | Summary outputs |
Step 2: ✍️ Add Calculations (The Fun Part!)
Example: Cooking Process
# ๐ฏ Output Name: cooking_reduction # ๐ Type: Formula # ๐งฎ Formula: initial_concentration / 10^cooking_log_reduction # ๐ฌ Description: Heat reduces bacteria by log reduction factor
Example: Contamination Source
# ๐ฏ Output Name: initial_concentration # ๐ Type: Distribution # ๐ฒ Distribution: Lognormal # ๐ฏ MC2D Type: U (Uncertainty) # ⚙️ Parameters: meanlog=0.8, sdlog=1.2 # ๐ Units: CFU/g
๐ฏ MC2D Functions Cheat Sheet
Function Syntax Purpose Example mcstoc() ๐ฒ mcstoc(dist, type, ...)Create random variable mcstoc(rnorm, "U", mean=10, sd=2)mcdata() ๐ข mcdata(value, type)Fixed value mcdata(100, "0")ifelse() ๐ ifelse(cond, yes, no)Conditional logic ifelse(temp>70, kill, survive)
| Function | Syntax | Purpose | Example |
|---|---|---|---|
| mcstoc() ๐ฒ | mcstoc(dist, type, ...) | Create random variable | mcstoc(rnorm, "U", mean=10, sd=2) |
| mcdata() ๐ข | mcdata(value, type) | Fixed value | mcdata(100, "0") |
| ifelse() ๐ | ifelse(cond, yes, no) | Conditional logic | ifelse(temp>70, kill, survive) |
๐ก Formula Writing Tips
๐ Use Descriptive Names:
r✅ GOOD: cooking_temperature_c, retail_concentration_cfu_g
❌ BAD: x1, temp, conc
๐ Reference Correctly:
r# ✅ CORRECT ORDER:
initial <- mcstoc(rlnorm, "U", meanlog=2, sdlog=1)
growth <- exp(growth_rate * time)
final <- initial * growth
# ❌ WRONG ORDER:
final <- initial * growth # ERROR: initial not defined yet!
initial <- mcstoc(rlnorm, "U", meanlog=2, sdlog=1)
๐จ Common Patterns:
r# ๐ Exponential Growth
bacteria_at_time_t <- initial_count * exp(growth_rate * time)
# ๐ Log Reduction
survivors <- initial_count / 10^log_reduction
# ๐ Conditional Processing
final_level <- ifelse(contaminated == 1,
base_level + transfer,
base_level)
# ๐ฏ Dose-Response
risk <- 1 - exp(-dose * alpha)
๐ Use Descriptive Names:
✅ GOOD: cooking_temperature_c, retail_concentration_cfu_g ❌ BAD: x1, temp, conc
๐ Reference Correctly:
# ✅ CORRECT ORDER: initial <- mcstoc(rlnorm, "U", meanlog=2, sdlog=1) growth <- exp(growth_rate * time) final <- initial * growth # ❌ WRONG ORDER: final <- initial * growth # ERROR: initial not defined yet! initial <- mcstoc(rlnorm, "U", meanlog=2, sdlog=1)
๐จ Common Patterns:
# ๐ Exponential Growth bacteria_at_time_t <- initial_count * exp(growth_rate * time) # ๐ Log Reduction survivors <- initial_count / 10^log_reduction # ๐ Conditional Processing final_level <- ifelse(contaminated == 1, base_level + transfer, base_level) # ๐ฏ Dose-Response risk <- 1 - exp(-dose * alpha)
6. ⚙️ Running Simulations
๐ Simulation Setup Guide
๐ฏ Key Settings Explained:
Setting Icon What It Means Recommended nsv ๐ Variability iterations "Virtual people" in simulation Test: 1000, Final: 10000 nsu ❓ Uncertainty iterations Different "what-if" scenarios Test: 100, Final: 1000 Random Seed ๐ฑ Reproducibility key Same seed = Same results Any number (12345)
| Setting | Icon | What It Means | Recommended |
|---|---|---|---|
| nsv ๐ | Variability iterations | "Virtual people" in simulation | Test: 1000, Final: 10000 |
| nsu ❓ | Uncertainty iterations | Different "what-if" scenarios | Test: 100, Final: 1000 |
| Random Seed ๐ฑ | Reproducibility key | Same seed = Same results | Any number (12345) |
๐ Step-by-Step Simulation:
⚙️ Configure:
text⚡ Quick Test Settings:
┌──────────────────────────────────┐
│ • nsv: 1000 (variability) │
│ • nsu: 100 (uncertainty) │
│ • Random Seed: 12345 │
│ • Enable Validation: ✅ │
└──────────────────────────────────┘
✅ Validate:
Click "Validate Model"
Watch for green checkmarks! ✅✅✅
๐ Run:
Click "Run MC Simulation"
Watch the progress bar! █████░░░░░ 60%
⏱️ Time Estimates:
text๐ Simulation Times:
• Small model (1000/100): 1-2 minutes ⏱️
• Medium model (5000/200): 5-10 minutes ⏳
• Large model (10000/1000): 20-30 minutes ๐
An Example of the Comprehensive Monte Carlo Simulation Report generated by MC2D Simulator is available in this Link.
⚙️ Configure:
⚡ Quick Test Settings: ┌──────────────────────────────────┐ │ • nsv: 1000 (variability) │ │ • nsu: 100 (uncertainty) │ │ • Random Seed: 12345 │ │ • Enable Validation: ✅ │ └──────────────────────────────────┘
✅ Validate:
Click
"Validate Model"Watch for green checkmarks! ✅✅✅
๐ Run:
Click
"Run MC Simulation"Watch the progress bar! █████░░░░░ 60%
⏱️ Time Estimates:
๐ Simulation Times: • Small model (1000/100): 1-2 minutes ⏱️ • Medium model (5000/200): 5-10 minutes ⏳ • Large model (10000/1000): 20-30 minutes ๐
An Example of the Comprehensive Monte Carlo Simulation Report generated by MC2D Simulator is available in this Link.
๐ Understanding Your Results
๐จ Results Dashboard Tour:
๐ Overview Tab:
text๐ฏ KEY METRICS AT A GLANCE
┌─────────────────┬─────────────┐
│ Metric │ Value │
├─────────────────┼─────────────┤
│ ๐ฏ Mean Risk │ 2.3e-5 │
│ ๐ Median Risk │ 1.7e-5 │
│ ⚠️ 95th Percentile │ 8.9e-5 │
│ ๐ Standard Dev │ 1.8e-5 │
└─────────────────┴─────────────┘
๐ Distribution Analysis:
text๐ PLOT OPTIONS:
• ๐จ Histogram: Frequency distribution
• ๐ Density: Smooth probability curve
• ๐ฆ Boxplot: Summary statistics
• ๐ ECDF: Cumulative distribution
๐ Comparative Analysis:
Compare multiple outputs side-by-side!
๐ Overview Tab:
๐ฏ KEY METRICS AT A GLANCE ┌─────────────────┬─────────────┐ │ Metric │ Value │ ├─────────────────┼─────────────┤ │ ๐ฏ Mean Risk │ 2.3e-5 │ │ ๐ Median Risk │ 1.7e-5 │ │ ⚠️ 95th Percentile │ 8.9e-5 │ │ ๐ Standard Dev │ 1.8e-5 │ └─────────────────┴─────────────┘
๐ Distribution Analysis:
๐ PLOT OPTIONS: • ๐จ Histogram: Frequency distribution • ๐ Density: Smooth probability curve • ๐ฆ Boxplot: Summary statistics • ๐ ECDF: Cumulative distribution
๐ Comparative Analysis:
Compare multiple outputs side-by-side!
๐ฏ Interpreting Risk Numbers:
Example Result:
๐ฏ Probability of illness per serving: 2.3e-5 ๐ What this means: • 2.3 illnesses per 100,000 servings • Or 0.0023% chance per serving ๐ฏ Confidence Interval: [8.7e-6, 5.4e-5] • We're 95% confident true risk is between 0.87 and 5.4 per 100,000 servings
๐ Risk Benchmarks:
๐ Common Risk Targets: • ⭐ Excellent: <1e-6 (1 per million) • ✅ Good: 1e-6 to 1e-5 • ⚠️ Moderate: 1e-5 to 1e-4 • ❌ High: >1e-4
7. ๐ Advanced Features
๐ฌ Sensitivity Analysis: What Really Matters?
๐ฏ Purpose: Find the biggest levers in your system!
๐ How to Use:
Go to
Advanced Analysis→Sensitivity AnalysisSelect target (e.g.,
illness_risk)Click
Run Analysis
๐ Example Results:
๐ฏ SENSITIVITY RANKING: ┌──────────────────────┬─────────────┐ │ Input Variable │ Correlation │ ├──────────────────────┼─────────────┤ │ ๐ฅ cooking_temp │ -0.82 ⭐⭐⭐ │ │ ๐ฆ initial_conc │ 0.76 ⭐⭐ │ │ ⏰ storage_time │ 0.31 ⭐ │ │ ๐ฝ️ serving_size │ 0.12 │ └──────────────────────┴─────────────┘ ๐ก Interpretation: • ⭐⭐⭐ Strong influence (>0.7): Focus here! • ⭐⭐ Moderate influence (0.3-0.7): Important • ⭐ Weak influence (<0.3): Less critical
๐ Scenario Analysis: What-If Explorer
Ask questions like:
"What if we increase cooking temperature by 5°C?"
"What if contamination is reduced by 50%?"
"What if we add a new treatment step?"
๐ Setup:
๐ SCENARIO COMPARISON: ┌─────────────────┬────────────────────┐ │ Scenario │ cooking_temp (°C) │ ├─────────────────┼────────────────────┤ │ ๐ Current │ 70 │ │ ๐ Improved │ 75 │ │ ๐ฏ Optimal │ 80 │ └─────────────────┴────────────────────┘
๐ Results View:
๐ฏ RISK REDUCTION: • Current: 2.3e-5 risk • Improved: 8.7e-6 risk (62% reduction!) ๐ • Optimal: 2.1e-6 risk (91% reduction!) ๐๐
๐ Correlation Management
When to use: When variables move together!
Example: Larger chicken pieces might have higher contamination.
⚙️ How to Add:
Go to
Advanced Features→Correlation MatrixSelect two variables
Set correlation (e.g., 0.6)
Click
Add Correlation
๐ Correlation Guide:
๐ Strength Guide: • 0.0-0.3: Weak correlation • 0.3-0.7: Moderate correlation • 0.7-1.0: Strong correlation
8. ๐ก Practical Examples
๐ Example 1: Salmonella in Chicken - Complete Walkthrough
๐ Scenario:
Home-cooked chicken with potential undercooking
๐ Steps:
1. ๐ฏ Define Goal:
๐ฏ QUESTION: "What's the risk of Salmonella illness from home-cooked chicken, and which factors matter most?"
2. ๐ Data Collection:
๐ Data Sources: • 100 chicken samples tested ๐งช • Cooking temperature surveys ๐ฅ • Serving size data ๐ฝ️ • Dose-response parameters ๐
3. ๐️ Model Building:
๐งฉ PROCESS CHAIN: [Farm] → [Transport] → [Retail] → [Purchase] → [Home Storage] → [Cooking] → [Serving] → [Risk]
4. ⚙️ Simulation:
⚡ Settings: • nsv: 5000 (5,000 virtual households) • nsu: 200 (200 uncertainty scenarios) • Time: ~8 minutes ⏳
5. ๐ Results:
๐ฏ FINDINGS: • Mean risk: 3.2e-5 per serving • 95% of homes: <8.7e-5 risk • 5% of homes: >1.2e-4 risk ⚠️ ๐ฌ KEY INSIGHTS: • Cooking temperature is #1 factor (82% influence) • 15% of homes have dangerously low cooking temps • Recommendation: Public education on thermometer use
๐ง Example 2: Listeria in Soft Cheese
⚡ Quick Version:
Load
"Listeria RTE Foods"templateUpdate with your prevalence data
Run sensitivity analysis
Finding: Storage temperature dominates risk
Recommendation: Improve cold chain management
๐ง Example 3: Cryptosporidium in Drinking Water
๐ฏ Special Considerations:
Use censored data (many < detection limit)
Different dose-response for vulnerable groups
Consider filtration effectiveness
Account for seasonal variations
9. ๐ ️ Troubleshooting & FAQ
❗ Common Error Messages & Fixes
Error Icon Likely Cause Quick Fix "No calculations defined"❌ Empty model Add calculations in Process Module "Undefined variables"๐ Typo in name Use Formula Helper for correct names "Invalid formula syntax"✍️ Missing parentheses Click Validate Formula first Simulation too slow⏱️ Too many iterations Reduce nsv/nsu for testing "Distribution fitting failed"๐ฒ Poor starting values Try different distributions
| Error | Icon | Likely Cause | Quick Fix |
|---|---|---|---|
"No calculations defined" | ❌ | Empty model | Add calculations in Process Module |
"Undefined variables" | ๐ | Typo in name | Use Formula Helper for correct names |
"Invalid formula syntax" | ✍️ | Missing parentheses | Click Validate Formula first |
Simulation too slow | ⏱️ | Too many iterations | Reduce nsv/nsu for testing |
"Distribution fitting failed" | ๐ฒ | Poor starting values | Try different distributions |
⚡ Performance Optimization Tips
For Faster Runs:
๐ SPEED BOOSTERS: 1. Start small: nsv=1000, nsu=100 2. Use simpler distributions during development 3. Close other applications 4. Save & restart if app slows down 5. Use parallel processing if available
For Large Models:
๐️ LARGE MODEL STRATEGY: • Test sections individually • Run overnight for final simulations • Consider cloud computing options • Use checkpoint saves for long runs
❓ Frequently Asked Questions
Q: ๐ค How many iterations do I really need?
A: Start with 1000/100 for testing, use 10000/1000 for final results. More iterations = more precision but slower.
Q: ๐ฏ What's the difference between "U" and "V"?
A: U = Uncertainty (we don't know), V = Variability (differences between individuals).
Q: ๐ Can I use Excel files?
A: Convert to CSV first! MC2D loves CSV format.
Q: ๐พ How do I save my work?
A: Use Save Model in Setup module. Creates .rds file you can reload.
Q: ๐ฅ Can teams collaborate?
A: Yes! Share .rds files. Everyone needs MC2D access.
Q: ๐ Where do I get help?
A: Check Documentation module first, then email: mc2dsimulator@gmail.com
10. ⭐ Best Practices
✅ Data Quality Checklist
Before Starting Analysis:
๐ Data cleaned (no typos, consistent units)
⚠️ Missing values handled appropriately
๐ฏ Detection limits documented
๐ Sample size sufficient (n>30 preferred)
๐ Data source and method recorded
๐ Units consistent throughout dataset
๐งช Quality control measures documented
๐️ Model Development Checklist
At Each Stage:
๐งญ Processes follow logical sequence
✅ All formulas validated
๐ท️ Variable names descriptive
๐ Units consistent throughout model
๐ Assumptions documented
๐ Dependencies clear in Process Flow
๐ฏ Outputs align with objectives
๐ Simulation Checklist
Before Running:
✅ Model validated (no errors)
⚙️ Iteration counts appropriate for purpose
๐ฑ Random seed set for reproducibility
⏱️ Sufficient time allocated
๐พ Recent save completed
๐ฏ Clear question being answered
๐ Results Interpretation Guidelines
When Presenting Results:
๐ฏ Show Uncertainty: Always include confidence intervals
๐ Use Visuals: A good plot beats 1000 numbers
๐ Compare to Benchmarks: Regulatory limits, background levels
๐ก Highlight Key Findings: What matters most?
๐ Document Limitations: What don't we know?
๐ฏ Provide Clear Recommendations: What should we do?
๐ Professional Reporting Standards
Your Final Report Should Include:
๐ REPORT STRUCTURE: ┌─────────────────────────────────┐ │ 1. ๐ฏ Executive Summary (1 pg) │ │ 2. ๐ฏ Objectives & Scope │ │ 3. ๐ Methods & Data Sources │ │ 4. ๐ Results with Visuals │ │ 5. ๐ฌ Sensitivity Analysis │ │ 6. ๐ Scenario Comparisons │ │ 7. ๐ฏ Recommendations │ │ 8. ⚠️ Limitations & Uncertainties│ │ 9. ๐ Technical Appendix │ └─────────────────────────────────┘
๐ Visualization Standards:
Use consistent color schemes
Include uncertainty bands
Label axes clearly with units
Use log scales when appropriate
Make plots publication-ready
๐ฏ Final Words of Wisdom
๐ Top 10 Success Tips:
๐ฏ Start with templates – Don't reinvent the wheel!
✅ Validate often – Catch errors before they snowball
๐พ Save versions – Label clearly: v1_0_baseline, v1_1_scenarioA
๐ Document everything – Future-you will thank present-you
๐จ Use visuals – A picture is worth 1000 data points
๐ฏ Focus on decisions – What action will this inform?
๐ Consider uncertainty – It's not a bug, it's a feature!
๐ฅ Get feedback – Fresh eyes catch what you miss
⏱️ Be patient – Good analysis takes time
๐ Celebrate progress – Each simulation teaches something!
๐ฏ Start with templates – Don't reinvent the wheel!
✅ Validate often – Catch errors before they snowball
๐พ Save versions – Label clearly: v1_0_baseline, v1_1_scenarioA
๐ Document everything – Future-you will thank present-you
๐จ Use visuals – A picture is worth 1000 data points
๐ฏ Focus on decisions – What action will this inform?
๐ Consider uncertainty – It's not a bug, it's a feature!
๐ฅ Get feedback – Fresh eyes catch what you miss
⏱️ Be patient – Good analysis takes time
๐ Celebrate progress – Each simulation teaches something!
๐ Your Journey Ahead:
text๐ LEARNING PATH:
Week 1: ๐ฏ Templates & Basic Simulations
Week 2: ๐ง Custom Models & Formula Writing
Week 3: ๐ Advanced Analysis & Interpretation
Week 4: ๐จ Professional Reporting & Communication
Month 2+: ๐ Mastery & Teaching Others!
๐ LEARNING PATH: Week 1: ๐ฏ Templates & Basic Simulations Week 2: ๐ง Custom Models & Formula Writing Week 3: ๐ Advanced Analysis & Interpretation Week 4: ๐จ Professional Reporting & Communication Month 2+: ๐ Mastery & Teaching Others!
๐ Need Immediate Help?
text๐ฏ SUPPORT CHANNELS:
1. ๐ Documentation Module (in the app)
2. ✍️ Formula Writing Guide
3. ๐ก Template Examples
4. ๐ง Email: mc2dsimulator@gmail.com
5. ๐ Training workshops (inquire via email)
๐ฏ SUPPORT CHANNELS: 1. ๐ Documentation Module (in the app) 2. ✍️ Formula Writing Guide 3. ๐ก Template Examples 4. ๐ง Email: mc2dsimulator@gmail.com 5. ๐ Training workshops (inquire via email)
๐ Congratulations & Happy Simulating! ๐
You now have everything you need to become an MC2D master! Remember:
"The goal isn't perfection—it's making better decisions with the information you have."
Every risk assessment involves uncertainty. MC2D doesn't eliminate uncertainty—it helps you understand it, quantify it, and make better decisions despite it.
Go forth and simulate with confidence! ๐
๐ Prepared with care by:
Dr. Kshitij Shrestha
Application Developer
๐ง mc2dsimulator@gmail.com
*๐ MC2D Process-Based Simulator v1.1.0*
๐
Last Updated: [Current Date]
⭐ "Empowering better decisions through better risk assessment" ⭐
๐ Quick Start Guide
Get up and running in 5 steps. The fastest path from zero to your first result.
- Access the Live Demo – No installation needed.
- Load a Template – Go to 'Monte Carlo Model Setup'.
- Explore the Model – Check 'Process Configuration' and 'Process Flow'.
- Run a Simulation – Configure and run in 'Simulation Control'.
- Analyze Results – View outputs in 'Basic Results' and 'Advanced Analysis'.
For a visual walkthrough, see our Video Tutorials.
๐ Complete Formula Writing Guide
The heart of MC2D modeling. Learn to create robust calculations.
concentration <- mcstoc(rlnorm, type="U", meanlog=2, sdlog=0.5)
# Example: Using a previous output
exposure <- concentration * serving_size
Explore detailed sections on MC2D Functions, Distribution Reference, Common QMRA Patterns, and Troubleshooting in the application's built-in Documentation tab.
Documentation Inside the Application
The most comprehensive and up-to-date documentation is available within the MC2D Simulator itself under the 'Documentation' tab. It's interactive and always accessible as you work.
Open App to Access Full Docs
No comments:
Post a Comment