Learn R Programming

dpseg (version 0.1.1)

predict.dpseg: Predict method for `dpseg` segmentations

Description

Predicted values based on a data segmentation model from dpseg.

Usage

# S3 method for dpseg
predict(object, xout, ...)

Arguments

object

result object returned by function dpseg

xout

new x-values at which to predict \(\hat{y}\)

...

not used

Value

Returns predicted linear segments as x,y coordinates (grDevices::xy.coords) at xout.

Examples

Run this code
# NOT RUN {
x <- oddata$Time
y <- log(oddata$A5)
segs <- dpseg(x=x, y=y, P=0.0001)

## predict method
plot(x=x, y=y, pch=19, cex=0.5)
lines(predict(segs), col=2, lwd=2)
# }

Run the code above in your browser using DataLab