在Google中对状态模型中的Tweedie分布进行建模,但是我在尝试使用estimate_tweedie_power函数时出错了。这是我笔记本上的密码。
#Training model
tweedie_model = sm.GLM(y_train, X_train, exposure = df_train.exposure, family=sm.families.Tweedie(link=None,var_power=1.5,eql=True))
tweedie_result = tweedie_model.fit()
#Using the initial model output to decide the optimum index parameter "p"
GLM.estimate_tweedie_power(training_result, method='brentq', low=1.01, high=5.0)以下是运行estimate_tweedie_power函数时的错误。
estimate_tweedie_power()缺少一个必需的位置参数:'mu'
发布于 2021-02-01 22:46:23
您可能需要使用以下内容:
tweedie_model.estimate_tweedie_power(tweedie_result.mu, method='brentq', low=1.01, high=5.0)https://stackoverflow.com/questions/61276846
复制相似问题