Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

sim.seasonalNoise

Generation of Background Noise for Simulated Timeseries


Description

Generation of a cyclic model of a Poisson distribution as background data for a simulated timevector.

The mean of the Poisson distribution is modelled as:

mu = exp(A * sin( frequency * omega * (t + phi)) + alpha + beta * t + K * state)

Usage

sim.seasonalNoise(A = 1, alpha = 1, beta = 0, phi = 0,
                  length, frequency = 1, state = NULL, K = 0)

Arguments

A

amplitude (range of sinus), default = 1.

alpha

parameter to move along the y-axis (negative values not allowed) with alpha > = A, default = 1.

beta

regression coefficient, default = 0.

phi

factor to create seasonal moves (moves the curve along the x-axis), default = 0.

length

number of weeks to model.

frequency

factor to determine the oscillation-frequency, default = 1.

state

if a state chain is entered the outbreaks will be additional weighted by K.

K

additional weigth for an outbreak which influences the distribution parameter mu, default = 0.

Value

an object of class seasonNoise which includes the modelled timevector, the parameter mu and all input parameters.

Author(s)

M. Höhle, A. Riebler, C. Lang

See Also

Examples

season <- sim.seasonalNoise(length = 300)
plot(season$seasonalBackground,type = "l")

# use a negative timetrend beta
season <- sim.seasonalNoise(beta = -0.003, length = 300)
plot(season$seasonalBackground,type = "l")

surveillance

Temporal and Spatio-Temporal Modeling and Monitoring of Epidemic Phenomena

v1.19.1
GPL-2
Authors
Michael H<f6>hle [aut, ths] (<https://orcid.org/0000-0002-0423-6702>), Sebastian Meyer [aut, cre] (<https://orcid.org/0000-0002-1791-9449>), Michaela Paul [aut], Leonhard Held [ctb, ths], Howard Burkom [ctb], Thais Correa [ctb], Mathias Hofmann [ctb], Christian Lang [ctb], Juliane Manitz [ctb], Andrea Riebler [ctb], Daniel Saban<e9>s Bov<e9> [ctb], Ma<eb>lle Salmon [ctb], Dirk Schumacher [ctb], Stefan Steiner [ctb], Mikko Virtanen [ctb], Wei Wei [ctb], Valentin Wimmer [ctb], R Core Team [ctb] (A few code segments are modified versions of code from base R)
Initial release
2021-03-30

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.