Quick Start Guide (5 Minutes)
Get up and running with CRML in just 5 minutes!
Prerequisites
- Python 3.8 or higher
- pip package manager
Step 1: Install CRML (30 seconds)
pip install crml-lang
Verify installation:
crml --version
Step 2: Create Your First Model (2 minutes)
Create a file called my-first-model.yaml:
crml: "1.1"
meta:
name: "my-first-risk-model"
description: "A simple phishing risk model"
model:
assets:
cardinality: 100 # 100 employees
frequency:
model: poisson
parameters:
lambda: 0.10 # 10% chance per employee per year
severity:
model: lognormal
parameters:
median: "22 000" # $22K median loss
currency: USD
sigma: 1.0 # Moderate variability
What this models: - 100 employees, each with 10% chance of clicking a phishing link - Expected ~10 incidents per year - Each incident costs ~$22K on average
Step 3: Validate Your Model (30 seconds)
crml validate my-first-model.yaml
You should see:
β CRML model is valid
Step 4: Run Simulation (1 minute)
crml simulate my-first-model.yaml --runs 10000
You'll see results like:
π Simulation Results
ββββββββββββββββββββββββββββββββββββββββββββββ
Expected Annual Loss (EAL): $220,000
VaR 95%: $450,000
VaR 99%: $650,000
Simulation completed in 1.2s
Step 5: Try the Web Platform (1 minute)
Want a visual interface? Try the interactive simulation page:
# Clone the repo (if you haven't)
git clone https://github.com/Faux16/crml.git
cd crml/web
# Install and run
npm install
npm run dev
Visit http://localhost:3000/simulation
What You Just Did
β
Installed CRML
β
Created a risk model
β
Validated it
β
Ran a Monte Carlo simulation
β
Got risk metrics (EAL, VaR)
Next Steps
Learn More
- Writing CRML Models - Comprehensive guide
- Understanding Parameters - How to choose values
- Examples - Pre-built models
Try Different Scenarios
- Modify
lambdato see how frequency affects risk - Change
medianto model different loss amounts - Increase
cardinalityfor larger organizations
Advanced Features
- Export results:
crml simulate model.yaml --format json > results.json - Use in Python:
from crml import CRMLModel - Build complex models with mixture distributions
Common Issues
"Command not found: crml"
- Make sure Python's bin directory is in your PATH
- Try: python -m crml.cli --help
"Invalid YAML"
- Check indentation (use spaces, not tabs)
- Run crml validate to see specific errors
"Simulation takes too long"
- Reduce --runs to 1000 for faster results
- Default 10,000 runs is recommended for accuracy
Get Help
- π Full Documentation
- π§ͺ Interactive Simulation
- π¬ GitHub Issues
- π§ Email Support
Ready to build real risk models? Check out the Writing CRML guide!