0

我正在尝试在 Python 中构建 GLM 模型。我正在使用 statsmodel 并根据我在保险领域的知识,我的因变量具有 Tweedie 分布。以下是我使用的一段代码:

practice_model = practice_model = sm.GLM(data.endog, data.exog, family = sm.families.Tweedie(link = sm.families.links.log))
practice_results = practice_model.fit()

我收到一个错误:module 'statsmodels.genmod.families' has no attribute 'Tweedie'

有人可以帮我理解我的模型/语法的哪一部分不正确吗?

PS:我能够使用 Gamma Family 构建 GLM 模型。

4

0 回答 0