| name | lgd-model |
| description | 违约损失率(LGD)建模工具,实现考虑抵押品的回收率估计、巴塞尔初级IRB法、历史平均法与Beta分布拟合。适用于信用风险建模教学与LGD模型原型验证。模型基于简化假设和历史数据,需人工复核,抵押品折损参数为示意值,不可用于正式监管资本计算。 |
| version | 1.0.0 |
| author | wangyi |
lgd-model
违约损失率(LGD)建模工具,估算违约后的回收率、抵押品折损,并计算 LGD 分布。
脚本API
lgd_with_collateral(ead, collateral_value, collateral_type='无抵押', seniority='senior', discount_rate=0.05, recovery_period_months=None)
考虑抵押品的 LGD 计算。
必填: ead, collateral_value
lgd_basel(ead, secured=False, seniority='senior')
巴塞尔初级 IRB 法 LGD。
必填: ead
lgd_historical_average(historical_lgds, downturn_adjustment=0.0)
历史平均法 LGD 计算。
必填: historical_lgds
lgd_beta_distribution(mean_lgd, std_lgd, n_simulations=10000, seed=42)
使用 Beta 分布建模 LGD 分布。
必填: mean_lgd, std_lgd
calculate_lgd(method='collateral')
统一 LGD 计算接口。
调用示例
python scripts/main.py \
--method <method> \
--collateral-type <collateral_type> \
--collateral-value <collateral_value> \
--discount-rate <discount_rate> \
--downturn-adjustment <downturn_adjustment> \
--ead <ead> \
--historical-lgds <historical_lgds> \
--mean-lgd <mean_lgd> \
--n-simulations <n_simulations> \
--recovery-period-months <recovery_period_months> \
--secured <secured> \
--seed <seed> \
--seniority <seniority> \
--std-lgd <std_lgd>