SimuBlocksInv {L0TFinv}R Documentation

Simulate Blocks Data

Description

This function generates data points of piecewise constant trends.

Usage

SimuBlocksInv(n, sigma, seed = NA, tau, h)

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

Details

Value

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

x

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

y

The piecewise constant 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

Examples

tau = c(0.1, 0.3, 0.4, 0.7, 0.85)
h = c(-1, 5, 3, 0, -1, 2)
BlocksData <- SimuBlocksInv(n = 350, sigma = 0.1, seed = 50, tau = tau ,h = h)
plot(BlocksData$x, BlocksData$y, xlab="", ylab="")
lines(BlocksData$x, BlocksData$y0, col = "red")
print(BlocksData$setA)
print(BlocksData$tau)

[Package L0TFinv version 0.1.0 Index]