首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在colab中运行状态模型时出错"estimate_tweedie_power()缺少1必需的位置参数:'mu'“

在colab中运行状态模型时出错"estimate_tweedie_power()缺少1必需的位置参数:'mu'“
EN

Stack Overflow用户
提问于 2020-04-17 17:00:22
回答 1查看 470关注 0票数 0

在Google中对状态模型中的Tweedie分布进行建模,但是我在尝试使用estimate_tweedie_power函数时出错了。这是我笔记本上的密码。

代码语言:javascript
复制
#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'

EN

回答 1

Stack Overflow用户

发布于 2021-02-01 22:46:23

您可能需要使用以下内容:

代码语言:javascript
复制
tweedie_model.estimate_tweedie_power(tweedie_result.mu, method='brentq', low=1.01, high=5.0)

参考资料:https://www.statsmodels.org/stable/_modules/statsmodels/genmod/generalized_linear_model.html#GLM.estimate_tweedie_power

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61276846

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档