slopeOP (version 1.0.0)

plot.slopeOP: plot.slopeOP

Description

Plot the result of the slopeOP function and the data

Usage

# S3 method for slopeOP
plot(x, ..., data, chpt = NULL, states = NULL)

Arguments

x

a slopeOP class object

...

other parameters

data

the data from which we get the slopeOP object x

chpt

vector of changepoints of the model

states

vector of states of the model

Value

plot data and the inferred slopeOP result (and the model if specified in 'chpt' and 'states' parameters)

Examples

Run this code
# NOT RUN {
myData <- slopeData(index = c(1,100,200,300), states = c(0,5,3,6), noise = 2)
s <- slopeOP(data = myData, states = 0:6, penalty = 20)
plot(s, data = myData, chpt = c(1,100,200,300), states = c(0,5,3,6))
# }

Run the code above in your browser using DataCamp Workspace