dataRWAR: Generating data function with the deCAFS model

Description Usage Arguments Value Examples

View source: R/dataGenerator.R

Description

Generate a Realization from the deCAFS model (see 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)

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
dataRWAR(
  N = 1000,
  sdEta = 1,
  sdNu = 1,
  phi = 0.5,
  type = c("none", "up", "updown", "rand1"),
  nbSeg = 20,
  jumpSize = 1,
  seed = 42
)

Arguments

N

number of data points

sdEta

standard deviation in Random Walk

sdNu

standard deviation in AR(1)

phi

AR(1) autocorrelation parameter

type

possible scenarios for the jump structure

nbSeg

number of segments

jumpSize

max size of the jumps

seed

random number generator seed (default is 42)

Value

A list containing:

y

the data sequence,

signal

the underlying signal without the superimposed AR(1) noise,

changepoints

the changepoint indices

Examples

1
myData <- dataRWAR(1000, sdEta = 0.1, sdNu = 0.1, type = "rand1",  nbSeg = 10, seed = 86)

vrunge/ARRWestim documentation built on Feb. 20, 2021, 9:35 a.m.