negbin_series: Simulated Negative Binomial Time Series Data

negbin_seriesR Documentation

Simulated Negative Binomial Time Series Data

Description

See example for code for reproducing the data. This was used in Helske and Vihola (2021).

Format

A time series mts object with 200 time points and two series.

References

Helske J, Vihola M (2021). bssm: Bayesian Inference of Non-linear and Non-Gaussian State Space Models in R. The R Journal (2021) 13:2, 578-589. https://doi.org/10.32614/RJ-2021-103

See Also

negbin_model

Examples

# The data was generated as follows:
set.seed(123)
n <- 200
sd_level <- 0.1
drift <- 0.01
beta <- -0.9
phi <- 5

level <- cumsum(c(5, drift + rnorm(n - 1, sd = sd_level)))
x <- 3 + (1:n) * drift + sin(1:n + runif(n, -1, 1))
y <- rnbinom(n, size = phi, mu = exp(beta * x + level))


bssm documentation built on Nov. 2, 2023, 6:25 p.m.