lindeloev / mcp

Regression with Multiple Change Points
http://lindeloev.github.io/mcp
105 stars 19 forks source link

NB support #89

Open wangxinge opened 4 years ago

wangxinge commented 4 years ago

Hi there, Can I use glm.nb for the regression? Thank you!

lindeloev commented 4 years ago

Negative Binomial regression is not natively supported yet, but I will make it a priority adding it. Specifically:

Until then, should be able to "hack" it by looking at the JAGS code in fit$jags_code for a regular binomial model and replace dbin(y_[i_], N[i_]) with dnegbin(y_[i_], shape) and add an appropriate prior, e.g., for shape ~ dunif(0, 50). Then feed that string into mcp again via mcp(model, data, jags_code = your_updated_code). This won't return posterior samples for shape, unfortunately.