generator: Generate a time series containing a Visual Charting Pattern.

Description Usage Arguments Details Value Examples

View source: R/generator.R

Description

This function lets you generate any pattern you specify in the parameters. For known definitions, either check the examples or the vignettes. This is mainly used to test either your own or this smoothing and recognition function.

Usage

1
2
3
generator(start = 0, dlength = 100, tot.spread = 100, presig = 0,
  postsig = 0, plength = 0, parts = c(15, 25, 50, 75, 85), sprd = c(50,
  25, 100, 25, 50))

Arguments

start

Starting value

dlength

Integer. Length of the signal part of the time series

tot.spread

Integer. Difference between the lowest and highest value of the time series

presig

Integer. Length of the pre-signal part of the time series

postsig

Integer. Length of the post-signal part of the time series

plength

No longer needed, kept for compatability. Set to 0.

parts

Vector of Integers. Must be the same length as sprd Defines how far the extrema lie apart from another (in percent) PREVIOUSLY: Vector must contain plength + 2 elements, the first element being 0 and the last 100.

sprd

Vector of Integers. Must be the same length as parts Defines the value of the extrema in percent of tot.spread in relation to start. PREVIOUSLY: Vector must contain plength + 2 elements, the first and last elemnt should be 0.

Details

For an overview of the package capabilities, click here rpatrec

Value

Time series with (optional) pre- or post signal, and the specified pattern.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 
#create a standard HS pattern:
generator()
#

#create a shifted head and shoulders pattern
generator(sprd = c(20,10,90,40,60))
#
#create a Double Tops pattern
generator(plength=3,parts=c(25,50,75),sprd=c(80,40,80))
#
#create a Rectangle Tops pattern
generator(plength=5,parts=c(20,40,50,60,80),sprd=c(80,40,80,40,80))
#
#create a single peak, 10 data points, max is approximately 10
generator(0,10,10,0,0,0,50,100)

## End(Not run)

rpatrec documentation built on May 1, 2019, 11:17 p.m.