This interactive dashboard allows you to explore the HANK-SAM model's fiscal multipliers under different monetary and fiscal policy parameters.
- Real-time parameter adjustment: Modify model parameters and see results update automatically
- Multiple policy regimes: Compare standard Taylor rule, fixed nominal rate, and fixed real rate monetary policies
- Three fiscal policies: Analyze UI extensions, stimulus checks (transfers), and tax cuts
- Visual outputs:
- Fiscal multipliers over 20 quarters
- Consumption impulse responses
- Parameter summary display
- 🚀 Auto-deployment: GitHub Actions with MyBinder integration for seamless sharing
app.ipynb: Main Jupyter notebook dashboard (primary file for Voila)app.py: Python script version (jupytext sync with notebook)hank_sam.py: Core HANK-SAM model implementationenvironment.yml: Canonical conda environment with all dependenciespostBuild: MyBinder setup script for widget configuration
- Python: 3.11+ (specified in environment.yml)
- Environment: All dependencies managed via
environment.yml - Jupyter widgets: Pre-configured for Voila compatibility
# Create environment from dashboard directory
uv sync --all-groups # Recommended (~5s)
# or: conda env create -f environment.yml # Traditional (~3min)
conda activate hafiscal-dashboard
# Enable Jupyter widgets
jupyter nbextension enable --py widgetsnbextension --sys-prefixIf you have the main project environment:
# Activate your existing environment
conda activate hafiscal # or your environment name
# Install additional dashboard dependencies
pip install voila ipywidgets nbconvert
jupyter nbextension enable --py widgetsnbextension --sys-prefix# Run from project root directory (important!)
voila dashboard/app.ipynb --no-browserThen open your browser to the URL shown (typically http://localhost:8866).
# Run from project root directory
jupyter notebook dashboard/app.ipynbRun all cells to see the interactive dashboard in notebook mode.
🔬 Launch Dashboard on MyBinder - Zero setup required!
For All Repositories (GitHub Codespaces):
- Launch Codespaces: Click "Code" → "Codespaces" → "Create codespace"
- Wait for setup: Environment auto-configures (2-3 minutes)
- Run dashboard: Execute
dashboard/start-dashboard.shin terminal - Access dashboard: Click forwarded port 8866 in Ports tab
Note: MyBinder works for public repos immediately. Codespaces requires GitHub Pro/Team for private repos.
Create .devcontainer/devcontainer.json with this configuration:
Click to expand devcontainer.json
{
"name": "HANK-SAM Dashboard Environment",
"image": "mcr.microsoft.com/devcontainers/miniconda:3",
"onCreateCommand": "conda env create -f dashboard/environment.yml",
"forwardPorts": [8866],
"portsAttributes": {
"8866": {
"label": "Voila Dashboard",
"onAutoForward": "notify"
}
},
"customizations": {
"vscode": {
"extensions": ["ms-python.python", "ms-toolsai.jupyter"]
}
}
}Intelligent Hybrid Deployment:
✅ Auto-Detection: Automatically detects public vs private repositories
✅ Public Repos: MyBinder + GitHub Pages + downloadable packages
✅ Private Repos: Codespaces + downloadable packages
✅ Comprehensive Testing: All dashboard functionality verified automatically
✅ Smart PR Comments: Repository-specific deployment instructions
✅ Multi-Platform: Universal support for all deployment methods
Deployment Matrix:
| Repository Type | Live Dashboard | Download Package | Cloud Development |
|---|---|---|---|
| Public | ✅ GitHub Pages + MyBinder | ✅ Instant download | ✅ Codespaces |
| Private | ❌ (not accessible) | ✅ Instant download | ✅ Codespaces |
Triggered by:
- Push to main/master/dashboard branches
- Pull requests with dashboard changes
- Manual workflow dispatch
{{REPO_NAME}}/
├── .devcontainer/
│ └── devcontainer.json # GitHub Codespaces configuration
├── .github/workflows/
│ └── deploy-dashboard.yml # Automated testing & packaging
└── dashboard/
├── app.ipynb # Main dashboard notebook
├── app.py # Python script version (synced)
├── hank_sam.py # Core HANK-SAM model
├── hafiscal.py # Additional model components
├── environment.yml # Complete environment specification
├── postBuild # Jupyter widget setup script
├── start-dashboard.sh # One-click launcher
├── test_app.py # Dashboard functionality tests
├── test_hank_sam.py # Model validation tests
└── DASHBOARD_README.md # This documentation
Generated Artifacts:
setup-dashboard.sh- Universal setup script (conda/micromamba)README.md- Complete package documentationBUILD_INFO.txt- Version and build metadata
- Taylor Rule π coefficient (φπ): Central bank's response to inflation (1.0-3.0)
- Taylor Rule Y coefficient (φy): Central bank's response to output gap (0.0-1.0)
- Taylor Rule inertia (ρr): Interest rate smoothing parameter (0.0-0.95)
- Phillips curve slope (κp): Price flexibility parameter (0.01-0.2)
- Fiscal adjustment speed (φb): How quickly taxes adjust to debt (0.0-0.1)
- Real wage rigidity: Degree of wage stickiness (0.0-1.0)
- UI extension length: Duration of unemployment insurance extension (1-12 quarters)
- Stimulus check length: Duration of transfer payments (1-4 quarters)
- Tax cut length: Duration of tax reduction (1-16 quarters)
Shows the cumulative fiscal multiplier (output per dollar of fiscal spending) over time for each policy under different monetary regimes:
- Solid lines: Standard Taylor rule
- Dashed lines: Fixed nominal interest rate
- Dotted lines: Fixed real interest rate
Shows percentage deviation of consumption from steady state in response to each fiscal policy.
- UI extensions typically have the highest multipliers due to targeting liquidity-constrained households
- Fixed nominal/real rates amplify fiscal policy effects compared to active Taylor rule
- Tax cuts generally have lower multipliers due to savings leakage among higher-income households
- Simulation time: 15-30 seconds per run (normal for HANK models)
- Memory usage: ~2-4GB RAM recommended for smooth operation
- Browser compatibility: Works best in Chrome/Firefox with JavaScript enabled
graph LR
A[app.ipynb Dashboard] -->|imports| B[hank_sam.py]
A -->|parameter overrides| C[compute_fiscal_multipliers]
C -->|runs| D[Policy Experiments]
D -->|returns| E[Multipliers & IRFs]
E -->|displayed in| F[Interactive Plots]
G[environment.yml] -->|defines| H[Dependencies]
I[postBuild] -->|configures| J[Jupyter Widgets]
style A fill:#4a90e2
style B fill:#7ed321
style F fill:#f5a623
style G fill:#e67e22
style I fill:#9b59b6
- Edit & Push: Make changes to dashboard files, push to GitHub
- Automatic Testing: GitHub Actions runs comprehensive test suite
- Package Creation: Complete dashboard bundle generated automatically
- PR Integration: Auto-generated comments with testing instructions
- Ready to Deploy: Multiple deployment options available instantly
- Local editing: Edit
app.ipynborapp.py(automatically synced) - Local testing: Run via Voila or Jupyter notebook
- Environment updates: Modify
environment.yml(single source of truth) - Push & Go: Commit → Push → GitHub Actions handles the rest
✅ Repository Detection: Automatically identifies public vs private repo
✅ Environment Testing: Verify all dependencies install correctly
✅ Import Validation: Test all dashboard modules load properly
✅ Functionality Testing: Run complete test suite
✅ Adaptive Deployment:
- Public repos: Live GitHub Pages + MyBinder integration
- Private repos: Codespaces setup + package downloads
✅ Smart PR Comments: Repository-specific instructions
✅ Universal Packages: Self-contained bundles for all environments
✅ Professional Landing Pages: Beautiful HTML interfaces (public repos)
Zero manual configuration required! The workflow adapts automatically.
-
Import errors:
- Ensure you're in the
dashboard/directory - Check that environment is properly activated
- Verify
hank_sam.pyis in the same directory
- Ensure you're in the
-
Slow simulation updates:
- Normal behavior - HANK models are computationally intensive
- Consider closing other applications to free up memory
-
Widget display issues:
- Run:
jupyter nbextension enable --py widgetsnbextension --sys-prefix - Restart Jupyter/Voila after enabling extensions
- Run:
-
MyBinder timeouts:
- First launch takes 2-3 minutes to build environment
- Subsequent launches from same GitHub commit are faster
If dependencies are missing or outdated:
# Recreate environment from scratch
conda env remove -n hafiscal-dashboard
uv sync --all-groups # Recommended (~5s)
# or: conda env create -f environment.yml # Traditional (~3min)
conda activate hafiscal-dashboardRun the test suite to verify dashboard functionality:
# Run tests from project root directory
pytest dashboard/test_app.py dashboard/test_hank_sam.py -vIf you use this dashboard in your research, please cite the original HAFiscal paper and acknowledge the dashboard implementation.
Authors: Alan Lujan alujan@jhu.edu
License: Same as main HAFiscal project
Last Updated: July 2025