acrossthetidyverse / tidycast

A survey of the Tidyverse packages :star:s & CRAN downloads with forecasts
1 stars 0 forks source link

`tscount` and `broom` #1

Open maelle opened 7 years ago

maelle commented 7 years ago

Bad news:

library("tscount")
###Campylobacter infections in Canada (see help("campy"))
interventions <- interv_covariate(n=length(campy), tau=c(84, 100),
  delta=c(1, 0)) #detected by Fokianos and Fried (2010, 2012)
#Linear link function with Negative Binomial distribution:
campyfit <- tsglm(campy, model=list(past_obs=1, past_mean=13),
  xreg=interventions, distr="nbinom")
broom::glance(campyfit)
Error: glance doesn't know how to deal with data of class tsglm

Which means working without broom / creating the broom tool for tsglm.

maelle commented 7 years ago

But maybe we can just use a Poisson/quasi-Poisson/negative binomial model via glm or glm.nb.