steve-the-bayesian / BOOM

A C++ library for Bayesian modeling, mainly through Markov chain Monte Carlo, but with a few other methods supported. BOOM = "Bayesian Object Oriented Modeling". It is also the sound your computer makes when it crashes.
GNU Lesser General Public License v2.1
35 stars 14 forks source link

Multiple Trigonometric Terms #39

Closed alexiosg closed 5 years ago

alexiosg commented 5 years ago

Adding multiple cycles (via addTrig), but output only returns sd of one.

Reproducible (and artificial example):

library(bsts) data(AirPassengers) y <- log(AirPassengers) ss <- AddLocalLinearTrend(list(), y) ss <- AddTrig(ss, y, period = 20, frequencies = 1) ss <- AddTrig(ss, y, period = 41, frequencies = 1)

model <- bsts(y, state.specification = ss, niter = 500)

only one available:

model$trig.coefficient.sd

Thanks, Alexios

ok, so two components are actually returned but it is a naming issue since they have the same names and so the listing does not show them (but available by using names(model))