SimuWaveInv {L0TFinv} | R Documentation |
Simulate Wave Data
Description
This function generates data points of piecewise linear trends.
Usage
SimuWaveInv(n, sigma, seed = NA, tau, h, a0 = 0)
Arguments
n |
Number of data points |
sigma |
Standard deviation of the noise added to the signal |
seed |
An optional seed for random number generation to make results reproducible |
tau |
The locations of change points in the underlying trend |
h |
The slope of the |
a0 |
The initial point value |
Value
A list containing the piecewise linear simulated data and the underlying trend:
x |
The set { |
y |
The piecewise linear simulated data of length |
y0 |
The underlying trend of length |
setA |
The set of position indicators of change points in the simulated data |
tau |
The locations of change points in the underlying trend |
See Also
Examples
tau = c(0.1, 0.3, 0.4, 0.7, 0.85)
h = c(-1, 5, 3, 0, -1, 2)
a0 = -10
WaveData <- SimuWaveInv(n = 650, sigma = 0.1, seed = 50, tau = tau, h = h, a0 = a0)
plot(WaveData$x, WaveData$y, xlab="", ylab="")
lines(WaveData$x, WaveData$y0, col = "red")
print(WaveData$setA)
print(WaveData$tau)
[Package L0TFinv version 0.1.0 Index]