I'm trying to model a time series with BSTS having a Poisson response variable. However, I just get an error message. Here is a reproducible example:
library(bsts)
holiday.list <- list(NamedHoliday("MemorialDay"),
NamedHoliday("IndependenceDay"),
NamedHoliday("LaborDay"),
NamedHoliday("Thanksgiving"),
NamedHoliday("Christmas"),
NamedHoliday("NewYearsDay"))
data <- ts(as.integer(EuStockMarkets))
ss <- AddLocalLinearTrend(list(), data)
ss <- AddRegressionHoliday(ss, data, holiday.list=holiday.list, time0=as.Date("1991-01-01"))
ss <- AddSeasonal(ss, data, nseasons=7) # weekly seasonal
bsts.poisson <- bsts(data, state.specification=ss, niter=500, family="poisson")
This exits with code 134 and prints the following message:
Abort trap: 6
It works without error when I remove the family="poisson"
argument, but I need a Poisson response, not Gaussian. What am I doing wrong?
Edit: I know stock market data shouldn't really be a Poisson process. It is not what I'm modeling in my actual work. It's just a convenient substitute to provide a reproducible example.
Edit: Some version info - R version 3.6.0 (2019-04-26)
, Platform: x86_64-apple-darwin13.4.0 (64-bit)
, Running under: macOS Mojave 10.14.6
other attached packages:
[1] bsts_0.9.1 xts_0.11-2 zoo_1.8-6
[4] BoomSpikeSlab_1.1.1 Boom_0.9.1 MASS_7.3-51.4