Generate data with a given continuous piecewise linear model
slopeData(index, states, noise = 0, outlierDensity = 0, outlierNoise = 50)
a vector of increasing changepoint indices
vector of successive states
noise level = standard deviation of an additional normal noise
probability for a datapoint to be an outlier (has to be close to 0)
noise level for outlier data points
a vector of simulated data
# NOT RUN { myData <- slopeData(index = c(1,100,200,300), states = c(0,5,3,6), noise = 1) # }
Run the code above in your browser using DataLab