select_Fpsn {fpopw}R Documentation

select_Fpsn

Description

function to select the number of changepoints after Fpsn or Fpsn_w using the penalty of Lebarbier 2005 given a estimator of the variance

Usage

select_Fpsn(
  res_fpsn,
  method = "givenVariance",
  sigma = sdDiff(res_fpsn$signal)
)

Arguments

res_fpsn

output of Fpsn or Fpsn_w containg the costs in J.est and the segmented signal

method

one of (1) "givenVariance" = using the penalty of Lebarbier 2005 given a estimator of the variance, (2) "biggest.S3IB" = biggest=TRUE in saut taken from S3IB, (3) "notbiggest.S3IB" biggest=FALSE in saut taken from S3IB.

sigma

variance used of the selection. If NULL use MAD on unweighted data.

Value

return an integer: selected number of changes

Examples

x <- c(rnorm(100), rnorm(10^3)+2, rnorm(1000)+1)
res <- Fpsn_w(x=x, w=rep(1, length(x)), K=100)
select.res <- select_Fpsn(res, method="givenVariance")
smt <- getSMT(res, select.res)

[Package fpopw version 1.1 Index]