dataRWAR | R Documentation |
Generate a Realization from the RWAR model (check the references for further details).
y_t = μ_t + ε_t
where
μ_t = μ_{t-1} + η_t + δ_t, \quad η_t \sim N(0, σ_η^2), \ δ_t \ \in R
and
ε_t = φ ε_{t-1} + ν_t \quad ν_t \sim N(0, σ_ν^2)
dataRWAR( n = 1000, sdEta = 0, sdNu = 1, phi = 0, type = c("none", "up", "updown", "rand1"), nbSeg = 20, jumpSize = 1 )
n |
The length of the sequence of observations. |
sdEta |
The standard deviation of the Random Walk Component on the signal drift |
sdNu |
The standard deviation of the Autocorrelated noise |
phi |
The autocorrelation parameter φ |
type |
Possible change scenarios for the jump structure (default: |
nbSeg |
Number of segments |
jumpSize |
Maximum magnitude of a change |
A list containing:
y
the data sequence,
signal
the underlying signal without the superimposed AR(1) noise,
changepoints
the changepoint locations
Romano, G., Rigaill, G., Runge, V., Fearnhead, P. Detecting Abrupt Changes in the Presence of Local Fluctuations and Autocorrelated Noise. arXiv preprint https://arxiv.org/abs/2005.01379 (2020).
library(ggplot2) set.seed(42) Y = dataRWAR(n = 1e3, phi = .5, sdEta = 3, sdNu = 1, jumpSize = 15, type = "updown", nbSeg = 5) y = Y$y ggplot(data.frame(t = 1:length(y), y), aes(x = t, y = y)) + geom_point() + geom_vline(xintercept = Y$changepoints, col = 4, lty = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.