# Generate an artificial event with white noise

### Description

This function generates a box, cliff-ramp, ramp-cliff or a sine function with different levels of white noise as the background noise. Length of the generated event is 128. Generation of events are similar to that of Cylinder-Bell-Funnel dataset in the reference below (Keogh and Lin 2005).

### Usage

1 |

### Arguments

`type` |
type of the event to be generated. There are four options: ‘box’, ‘rc’,‘cr’,‘sine’ representing a box, cliff-ramp, ramp-cliff or a sine function. |

`A` |
amplitude of the event; default is 10. |

`sigma` |
a scalar specifying the level of white noise. Default is 1, which means the standard deviation of noise is 1. |

### Value

an artificial event with white noise.

### References

Eamonn Keogh and Jessica Lin (2005). Clustering of time-series subsequences is meaningless: implications for previous and future research.
*Knowl. Inf. Syst.*, **8**(2), 154-177. http://dblp.uni- trier.de/db/journals/kais/kais8.html#KeoghL05.

Yanfei Kang, Kate Smith-Miles, Danijel Belusic (2013). How to extract meaningful shapes from noisy time-series subsequences? *2013 IEEE Symposium on
Computational Intelligence and Data Mining*, Singapore, 65-72. http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=6597219&isnumber=6597208.

Yanfei Kang, Danijel Belusic, Kate Smith-Miles (2014). Detecting and Classifying Events in Noisy Time Series. *J. Atmos. Sci.*, **71**, 1090-1104.
http://dx.doi.org/10.1175/JAS-D-13-0182.1.

### Examples

1 2 3 4 5 6 7 8 9 10 | ```
# generate a box function with white noise
set.seed(123)
x1 = cbfs(type = 'box', sigma = 1)
# generate a box function with higher level noise
set.seed(123)
x2 = cbfs(type = 'box', sigma = 3)
# plot them
par(mfrow=c(1,2))
plot(x1,type='l',xlab='t',ylab=expression(x[1]))
plot(x2,type='l',xlab='t',ylab=expression(x[2]))
``` |