为什么Python中的综合控制方法包为所有潜在的控制分配相同的权重而不是优化?

问题描述 投票:0回答:1

这是我第一次使用综合控制方法包pysyncon进行研究。我试图创建一个综合俄罗斯来估计 2014 年之后制裁对俄罗斯 GDP 的影响,但大多数情况下,该方案只是取控制捐助池中所有国家的平均值(即分配相同的权重),而不是进行优化。有谁知道问题可能是什么?请参阅下面的代码。

dataprep_test = Dataprep(
    foo=df,
    predictors=["Agriculture, forestry, and fishing, value added (% of GDP)",
                "GDP per capita, PPP (constant 2017 international $)",
                "Industry (including construction), value added (% of GDP)",
                "Inflation, consumer prices (annual %)",
                "Manufacturing, value added (% of GDP)",
                "Net investment in nonfinancial assets (% of GDP)",
                "Oil rents (% of GDP)",
                "Population density (people per sq. km of land area)",
                "School enrollment, tertiary (% gross)",
                "Services, value added (% of GDP)",
                "Total natural resources rents (% of GDP)"],
    predictors_op="mean",
    time_predictors_prior=range(2000, 2014),
    dependent="GDP per capita, PPP (constant 2017 international $)",
    unit_variable="COUNTRY",
    time_variable="YEAR",
    treatment_identifier="Russian Federation",
    controls_identifier=['Albania', 'Algeria', 'Angola', 'Antigua and Barbuda', 'Argentina',
       'Armenia', 'Aruba', 'Australia', 'Azerbaijan', 'Bahamas, The',
       'Bahrain', 'Bangladesh', 'Barbados', 'Belarus', 'Belize', 'Benin',
       'Bermuda', 'Bhutan', 'Bolivia', 'Bosnia and Herzegovina',
       'Botswana', 'Brazil', 'Brunei Darussalam', 'Burkina Faso',
       'Burundi', 'Cabo Verde', 'Cambodia', 'Cameroon', 'Canada',
       'Central African Republic', 'Chad', 'Chile', 'China', 'Colombia',
       'Comoros', 'Congo, Dem. Rep.', 'Congo, Rep.', 'Costa Rica',
       "Cote d'Ivoire", 'Curacao', 'Dominica', 'Dominican Republic',
       'Ecuador', 'Egypt, Arab Rep.', 'El Salvador', 'Equatorial Guinea',
       'Eswatini', 'Ethiopia', 'Fiji', 'Gabon', 'Gambia, The', 'Georgia',
       'Ghana', 'Grenada', 'Guatemala', 'Guinea', 'Guinea-Bissau',
       'Guyana', 'Haiti', 'Honduras', 'Hong Kong SAR, China', 'Iceland',
       'India', 'Indonesia', 'Iran, Islamic Rep.', 'Iraq', 'Israel',
       'Jamaica', 'Japan', 'Jordan', 'Kazakhstan', 'Kenya', 'Kiribati',
       'Korea, Rep.', 'Kuwait', 'Kyrgyz Republic', 'Lao PDR', 'Lebanon',
       'Lesotho', 'Liberia', 'Libya', 'Macao SAR, China', 'Madagascar',
       'Malawi', 'Malaysia', 'Maldives', 'Mali', 'Marshall Islands',
       'Mauritania', 'Mauritius', 'Mexico', 'Micronesia, Fed. Sts.',
       'Moldova', 'Mongolia', 'Montenegro', 'Morocco', 'Mozambique',
       'Myanmar', 'Namibia', 'Nepal', 'New Zealand', 'Nicaragua', 'Niger',
       'Nigeria', 'North Macedonia', 'Norway', 'Oman', 'Pakistan',
       'Palau', 'Panama', 'Papua New Guinea', 'Paraguay', 'Peru',
       'Philippines', 'Puerto Rico', 'Qatar', 'Rwanda', 'Samoa',
       'San Marino', 'Saudi Arabia', 'Senegal', 'Serbia', 'Seychelles',
       'Sierra Leone', 'Singapore', 'Slovak Republic', 'Solomon Islands',
       'South Africa', 'Sri Lanka', 'St. Kitts and Nevis', 'St. Lucia',
       'St. Vincent and the Grenadines', 'Sudan', 'Suriname',
       'Switzerland', 'Tajikistan', 'Tanzania', 'Thailand', 'Timor-Leste',
       'Togo', 'Tonga', 'Trinidad and Tobago', 'Tunisia', 'Turkiye',
       'Turkmenistan', 'Tuvalu', 'Uganda', 'Ukraine',
       'United Arab Emirates', 'Uruguay', 'Uzbekistan', 'Vanuatu',
       'Viet Nam', 'West Bank and Gaza', 'Zambia', 'Zimbabwe'],
    time_optimize_ssr=range(2000,2014),
)

synth = Synth()
synth.fit(dataprep=dataprep_test)
synth.weights()

enter image description here

我尝试以多种方式修改代码 - 修改 time_predictors_prior 和 time_optimize_ssr 的时间范围、减少控制国家池、使用惩罚合成器代替等。但尚未找到解决此问题的方法。

python
1个回答
0
投票

我也遇到了同样的问题,请问你解决了吗?

© www.soinside.com 2019 - 2024. All rights reserved.