| name | esg-portfolio |
| description | ESG优化,整合环境、社会和治理评分,支持排除法与优化整合法构建ESG组合。适用于ESG投资策略的。ESG评分为示意值,未对接真实评级数据源,不构成投资建议。 |
| version | 1.0.0 |
| author | wangyi |
esg-portfolio
ESG 投资组合工具,整合环境、社会和治理(ESG)评分,支持排除法、优化整合法构建ESG投资组合,仅使用 Python 标准库。
📌 说明:本工具基于简化模型实现,仅使用 Python 标准库。结果仅供学习参考,不构成投资建议。
脚本API
compute_esg_scores(e_scores, s_scores, g_scores, weights=(1 / 3, 1 / 3, 1 / 3))
计算综合ESG评分。
必填: e_scores, s_scores, g_scores
portfolio_esg_score(weights, esg_scores)
计算投资组合的加权ESG评分。
必填: weights, esg_scores
negative_screening(benchmark_weights, esg_scores, threshold=5.0, asset_names=None)
负面排除法:排除ESG评分低于阈值的资产。
必填: benchmark_weights, esg_scores
positive_screening(benchmark_weights, esg_scores, top_percent=0.7, asset_names=None)
正面筛选法:仅保留ESG评分最高的前N%资产。
必填: benchmark_weights, esg_scores
sector_exclusion(benchmark_weights, esg_scores, sector_mapping, excluded_sectors, asset_names=None)
行业排除法:排除特定行业的资产。
必填: benchmark_weights, esg_scores, sector_mapping, excluded_sectors
esg_tilt(benchmark_weights, esg_scores, tilt_factor=1.0, max_deviation=0.1)
ESG倾斜法:在基准基础上向高ESG资产倾斜。
必填: benchmark_weights, esg_scores
esg_optimization(benchmark_weights, esg_scores, mean_returns, cov_matrix, esg_target=None, risk_aversion=1.0, esg_preference=0.5, max_deviation=0.15, n_iter=10000, seed=42)
ESG优化整合法。
必填: benchmark_weights, esg_scores, mean_returns, cov_matrix
objective(weights)
目标函数。
必填: weights
调用示例
python scripts/main.py \
--weights <weights> \
--esg-scores <esg_scores> \