GLM model with a Tweedie distribution

2k views Asked by At

I am trying to build a GLM model in Python. I am using statsmodel and based on the domain knowledge that I have in insurance, my dependent variable has Tweedie distribution. Following is the piece of code I have used:

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

I get an error as: module 'statsmodels.genmod.families' has no attribute 'Tweedie'

Can someone please help me to understand what part of my model/syntax is incorrect?

P.S: I was able to build the GLM model using a Gamma Family.

0

There are 0 answers