| name | sovereign-debt |
| description | 主权债务分析,计算债务/GDP动态、融资成本与简化违约风险模型。适用于主权风险分析的。违约风险模型为简化阈值法,未考虑政治风险与或有负债,不构成投资建议。 |
| version | 1.0.0 |
| author | wangyi |
sovereign-debt
主权债务分析工具,计算债务/GDP 动态、融资成本和违约风险,仅使用 Python 标准库。
📌 说明:本工具基于简化模型实现,仅使用 Python 标准库。结果仅供学习参考,不构成投资建议。
脚本API
debt_dynamics(debt_to_gdp, real_interest_rate, real_growth_rate, primary_balance, forecast_horizon=10, scenario='baseline')
债务/GDP 动态模拟。
必填: debt_to_gdp, real_interest_rate, real_growth_rate, primary_balance
financing_cost_analysis(total_debt, debt_structure, gdp, foreign_reserves=0, maturing_debt_1y=0)
融资成本分析。
必填: total_debt, debt_structure, gdp
default_risk_assessment(debt_to_gdp, real_interest_rate, real_growth_rate, interest_to_revenue, current_account_to_gdp=0, external_debt_ratio=0, reserves_to_short_term_debt=0)
违约风险评估。
必填: debt_to_gdp, real_interest_rate, real_growth_rate, interest_to_revenue
analyze_sovereign_debt(method='default_risk')
统一主权债务分析接口。
调用示例
python scripts/main.py \
--method <method> \
--current-account-to-gdp <current_account_to_gdp> \
--debt-structure <debt_structure> \
--debt-to-gdp <debt_to_gdp> \
--external-debt-ratio <external_debt_ratio> \
--forecast-horizon <forecast_horizon> \
--foreign-reserves <foreign_reserves> \
--gdp <gdp> \
--interest-to-revenue <interest_to_revenue> \
--maturing-debt-1y <maturing_debt_1y> \
--primary-balance <primary_balance> \
--real-growth-rate <real_growth_rate> \
--real-interest-rate <real_interest_rate> \
--reserves-to-short-term-debt <reserves_to_short_term_debt> \
--scenario <scenario> \
--total-debt <total_debt>