Learn R Programming

L0TFinv (version 0.1.0)

SimuWaveInv: Simulate Wave Data

Description

This function generates data points of piecewise linear trends.

Usage

SimuWaveInv(n, sigma, seed = NA, tau, h, a0 = 0)

Value

A list containing the piecewise linear simulated data and the underlying trend:

x

The set { \(\frac{1}{n}\), \(\frac{2}{n}\), \(\frac{3}{n}\),..., \(1\) }

y

The piecewise linear simulated data of length \(n\)

y0

The underlying trend of length \(n\)

setA

The set of position indicators of change points in the simulated data

tau

The locations of change points in the underlying trend

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 \(length(tau)+1\) segments of the underlying trend

a0

The initial point value

See Also

SimuBlocksInv

Examples

Run this code
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)

Run the code above in your browser using DataLab