gen.signal: Simulate different types of signal

View source: R/main.R

gen.signalR Documentation

Simulate different types of signal

Description

Simulate different types of signal

Usage

gen.signal(l, h, jump, b1, rep, shift)

Arguments

l

length of data, if data is periodic then the length of period

h

numerical vector of change-point locations

jump

numerical vector of jump height at change-point locations

b1

numerical vector of piecewise slopes

rep

number of periods if data is periodic, default is 1

shift

numerical vector of vertical shifts for each period, default is 0

Value

a vector of simulated signal

Examples

l = 1200
h = seq(150,by=150,length.out=6)
jump = rep(0,7)
beta1 = c(2,-1,2.5,-3,-0.2,2.5)/50
beta1 = c(beta1,-sum(beta1*(c(h[1],diff(h))))/(l-tail(h,1)))
signal = gen.signal(l,h,jump,beta1)

zhibinghe/ChangePoint documentation built on Feb. 22, 2025, 12:34 p.m.