Running Decomposition
What Is Decomposition Analysis?
Decomposition analysis breaks down your model's predictions to show how much each variable group contributes to your KPI over time. It answers the fundamental question: "What's driving my business results?"
Purpose: Break down model predictions to show time-series contributions by group (Media, Price, Promotions, etc.) and identify which factors drive KPI performance.
Prerequisites
Before running decomposition:
Required:
✓ Model must be fitted (OLS or Bayesian)
✓ Variables must be organized into contribution groups
✓ Groups must be saved in Contribution Groups page
Recommended:
✓ Colors assigned to each group
✓ Adjustment parameters configured (if needed)
✓ Model diagnostics reviewed and passed
Accessing Decomposition
Navigation:
Click "Decomposition" in the left sidebar
Select your fitted model from dropdown
Choose decomposition type (OLS or Bayesian)
Click "Run Decomposition"
Decomposition Types
OLS Decomposition
Uses: Point estimates from OLS regression
Characteristics:
Single value per variable per time period
Deterministic contributions
Fast calculation
Standard approach
When to Use:
Default choice for most analyses
When using OLS models
For clear, simple reporting
When speed matters
Bayesian Decomposition
Uses: Posterior mean estimates from Bayesian inference
Characteristics:
Based on MCMC samples
Reflects parameter uncertainty
Point estimates from posterior distribution
Same format as OLS in charts
When to Use:
When model is Bayesian
When uncertainty quantification is important
For models with informative priors
When Bayesian inference has been run
Note: Both types produce the same chart format - the difference is which coefficients are used in calculation.
The Decomposition Process
How Contributions Are Calculated
For each variable at each time period:
For the constant term:
For each group at each time period:
Total:
Mathematical Example
Model: Sales = 1000 + 2.5×TV + 1.8×Digital + 0.5×Price
Week 1 Values:
TV = 100
Digital = 50
Price = 200
Contributions:
Base (constant): 1000
TV: 2.5 × 100 = 250
Digital: 1.8 × 50 = 90
Price: 0.5 × 200 = 100
Predicted Sales: 1000 + 250 + 90 + 100 = 1440
If TV and Digital are grouped as "Media":
Media contribution = 250 + 90 = 340
Running Main Decomposition
Step 1: Select Model
Model dropdown shows:
Model name
KPI variable
Number of variables
Model type (OLS/Bayesian)
Select your desired model for decomposition analysis
Step 2: Choose Decomposition Type
Toggle between:
OLS: Uses OLS coefficients (default)
Bayesian: Uses Bayesian posterior means
Indicator shows: Current selection with icon
📊 OLS Mode
🎯 Bayesian Mode
Step 3: Click "Run Decomposition"
Button initiates:
Retrieval of contribution group settings
Calculation of contributions for all time periods
Application of any adjustments
Generation of charts
Processing:
Usually completes in 1-3 seconds
Progress indicator shown
Charts appear when complete
Step 4: View Results
Two main charts appear:
Actual vs Predicted (Line Chart)
Contribution Breakdown (Stacked Bar Chart)
Main Decomposition Chart
Actual vs Predicted Line Chart
Purpose: Verify model fit and see predictions over time
Chart Elements:
Black Line: Actual KPI values from your data
Shows real historical performance
Ground truth
Red Dashed Line: Model predicted values
Sum of all group contributions
Should track actual closely
Good Fit Indicators:
Lines track closely together
Predicted captures peaks and troughs
Small gaps between lines
Poor Fit Indicators:
Large persistent gaps
Predicted misses major movements
Systematic over/under-prediction
Interactive Features:
Zoom in/out
Pan across time
Hover for exact values
Reset view
Contribution Breakdown Stacked Bar Chart
Purpose: Show how each group contributes to predicted value over time
Chart Structure:
Stacked Bars:
Each bar represents one time period
Bar height = Predicted KPI value
Each color segment = one group's contribution
Segments stack to show total
Colors:
Each group has assigned color
Consistent across all periods
Base usually gray at bottom
Marketing groups in distinctive colors
Time Axis (X):
Date or time period
Chronological order
Can zoom to focus on specific periods
Value Axis (Y):
KPI units (sales, revenue, etc.)
Shows contribution magnitude
Starts at zero (or negative if applicable)
Legend:
Shows all groups and colors
Click to hide/show groups
Helps isolate specific contributions
Reading the Chart
Largest Contributors:
Tallest segments drive KPI most
Usually Base and main marketing groups
Variability:
Segments that change height over time
Indicate campaign-driven effects
Show responsiveness to marketing
Consistency:
Steady height segments
Represent stable baseline
Often Base and seasonality
Timing:
When do segments spike?
Align with known campaigns?
Seasonal patterns visible?
Negative Contributions:
Segments below zero line
Usually price increases or negative coefficients
Pull KPI down
Interactive Chart Features
Zoom and Pan
Mouse Wheel Zoom:
Scroll to zoom in/out
Focus on specific time periods
Maintain aspect ratio
Selection Zoom:
Click and drag to select area
Zooms to selected region
Detailed view of period
Pan:
Click and drag to move view
Navigate across time
Explore different periods
Reset:
Click reset button
Return to full view
Restore original zoom level
Toolbar Options
Available tools:
🔍 Zoom
➕ Zoom In
➖ Zoom Out
✋ Pan
🔄 Reset
Location: Top right of chart
Tooltip Information
Hover over any element:
On bars:
Time period
Group name
Contribution value
Percentage of total
On lines:
Date
Actual value
Predicted value
Difference
Legend Interaction
Click legend items to:
Hide/show specific groups
Isolate contributions
Compare subsets
Focus on specific drivers
Use cases:
Hide Base to see only marketing
Show only Media groups
Compare price vs. promotions
Group Decomposition (Drill-Down)
Purpose
Drill into a specific group to see individual variable contributions within that group.
Example: After seeing "Media" is a major contributor, drill down to see TV vs. Digital vs. Radio performance.
Running Group Decomposition
Step 1: Select Group
Dropdown shows all groups from main decomposition
Choose group to analyze in detail
Step 2: Click "Run Group Decomposition"
Calculates individual variable contributions
Shows only variables in selected group
Step 3: View Variable-Level Chart
Stacked bars show individual variables
Black line shows total group contribution
Each variable is a different color/shade
Group Decomposition Chart
Structure:
Similar to main chart but variable-level
Each variable within the group shown separately
Total line shows overall group contribution
Insights:
Which specific channels drive the group?
Are all channels contributing or just one?
How do individual channels compare?
Example:
Interpreting Decomposition Results
What to Look For
1. Largest Contributors
Which groups have biggest bars?
These are your primary drivers
Focus optimization efforts here
2. Variability vs. Stability
Changing heights = campaign-driven
Steady heights = baseline effects
Helps identify controllable factors
3. Temporal Patterns
When do contributions spike?
Align with known activities?
Seasonal patterns?
4. Negative Contributions
Which factors reduce KPI?
Usually price increases
Understand trade-offs
5. Model Fit
Do actual and predicted align?
Large gaps indicate missing factors
Overall fit quality
Common Patterns
Pattern 1: Base-Driven
Large steady Base contribution
Small variable marketing contributions
Indicates strong organic baseline
Interpretation: Marketing has modest incremental impact
Pattern 2: Media-Driven
Large variable Media contributions
Media spikes align with campaigns
Base is smaller
Interpretation: Marketing is primary growth driver
Pattern 3: Promotional
Spikes in promotion group
Regular promotional calendar visible
Clear lift during promotions
Interpretation: Promotions create significant lift
Pattern 4: Seasonal
Regular cyclical patterns
Seasonality group varies predictably
Annual rhythm visible
Interpretation: Strong seasonal effects on KPI
Troubleshooting
Charts Don't Appear
Possible causes:
Groups not configured
Model not fitted
Contribution groups not saved
Solutions:
Verify groups are assigned in Contribution Groups
Confirm "Save Groups" was clicked
Re-run model fitting if needed
Check browser console for errors
Contributions Don't Sum to Predicted
This should never happen - if it does:
Browser display issue
Recalculate decomposition
Contact support
Expected: Bar heights should exactly equal predicted line
Colors Are Wrong
If colors don't match expectations:
Check color assignment in Contribution Groups
Verify "Save Groups" was clicked
Refresh page and re-run
Missing Groups
If some groups don't appear:
Check that variables are assigned to those groups
Verify group names are consistent
Ensure coefficients exist for those variables
Negative Total Contributions
Possible in some cases:
When many variables have negative coefficients
Price increases reduce demand
Legitimate model result
Verify: Check if this makes business sense
Best Practices
Start with Main Decomposition:
Get overview first
Understand major drivers
Then drill into specifics
Use Zoom Strategically:
Focus on campaign periods
Examine anomalies
Compare year-over-year
Run Both OLS and Bayesian:
Compare point estimates
Understand uncertainty impact
Use appropriate method for decision
Document Insights:
Screenshot key charts
Note patterns observed
Record business explanations
Share with Stakeholders:
Export charts
Prepare interpretations
Tell the story
Workflow Summary
Complete decomposition workflow:
Verify Setup
Model fitted
Groups configured
Colors assigned
Run Main Decomposition
Select model
Choose OLS/Bayesian
Click Run
Analyze Main Charts
Review actual vs. predicted
Examine contribution breakdown
Identify key patterns
Drill Into Groups
Select major contributor groups
Run group decomposition
Analyze variable-level details
Export and Share
Generate reports
Share insights
Support decisions
Next Steps
After running decomposition:
Proceed to Interpreting Results for detailed analysis guidance
Calculate ROI by Channel
Analyze Seasonal Patterns
Export Decomposition Data for further analysis
Last updated