cp.plt: Plot data sequence, first and second-order derivative, and...

View source: R/main.R

cp.pltR Documentation

Plot data sequence, first and second-order derivative, and their local extrema

Description

Plot data sequence, first and second-order derivative, and their local extrema

Usage

cp.plt(x, order, icd.noise, H)

Arguments

x

numerical vector of signal or signal-plus-noise data

order

order of derivative of data

icd.noise

logical value indicating if data x includes noise

H

optional, vector of change-point locations

Value

plotting

Examples

l = 1200
h = seq(150,by=150,length.out=6)
jump = c(0,1.5,2,2.2,1.8,2,1.5)*3
beta1 = c(2,-1,2.5,-3,-0.2,2.5,-0.5)/50
signal = gen.signal(l,h,jump,beta1)
noise = rnorm(length(signal),0,1)
gamma = 25
sdata = smth.gau(signal+noise,gamma)
dy = diff(sdata)
ddy = diff(sdata,differences=2)
cp.plt(signal,0,FALSE)
points(signal+noise,col="grey")
cp.plt(dy,1,H=h)
cp.plt(ddy,2,H=h)

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