Fpop | R Documentation |
Function to run the Fpop algorithm (Maidstone et al. 2016). It uses functional pruning and optimal partionning. It optimizes the L2-loss for a penalty lambda per change.
Fpop(x, lambda, mini = min(x), maxi = max(x))
x |
a numerical vector to segment |
lambda |
the penalty per changepoint (see Maidstone et al. 2016) |
mini |
minimum mean segment value to consider in the optimisation. |
maxi |
maximum mean segment value to consider in the optimisation. |
return a list with a vector t.est containing the position of the change-points, the number of changes K and, the cost J.est.
x <- c(rnorm(100), rnorm(10^3)+2, rnorm(1000)+1) est.sd <- sdDiff(x) ## rough estimate of std-deviation res <- Fpop(x=x,lambda=2*est.sd^2*log(length(x))) smt <- getSMT(res)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.