Runs the dpseg recursion for different values of the
penalty parameter P and returns a matrix with the used
P values, the resulting number of segments and (optionally)
the median of segment variance of residuals.
Usage
scanP(x, y, P, var = TRUE, use.matrix = TRUE, plot = TRUE,
verb = 1, ...)
Arguments
x
x-values
y
y-values
P
vector of penalties P to scan
var
add the median of the variances of residuals of all
segments to output (save time by var=FALSE)
use.matrix
use the stored scoring function matrix for more
efficient scans; set this to FALSE if you run into
memory problems
Returns a matrix with the penalties P in the first column,
the number of segments in the second column and the median of
variances in the third column.
# NOT RUN {x <- oddata$Time
y <- log(oddata$A5)
par(mai=c(par("mai")[1:3], par("mai")[2])) # to show right axissp <- scanP(x=x, y=y, P=seq(-.01,.1,length.out=50), plot=TRUE)
# }