Learn R Programming

fpopw (version 1.1)

Fpsn: Fpsn

Description

Function to run the pDPA algorithm (Rigaill 2010 and 2015). It uses functional pruning and segment neighborhood. It optimizes the L2-loss for 1 to Kmax changes.

Usage

Fpsn(x, Kmax, mini = min(x), maxi = max(x))

Arguments

x

a numerical vector to segment

Kmax

max number of segments (segmentations in 1 to Kmax segments are recovered).

mini

minimum mean segment value to consider in the optimisation

maxi

maximum mean segment value to consider in the optimisation

Value

return a list with a matrix t.est containing the change-points of the segmentations in 1 to Kmax changes and, the cost J.est in 1 to Kmax changes.

Examples

Run this code
# NOT RUN {
x <- c(rnorm(100), rnorm(10^3)+2, rnorm(1000)+1)
res <- Fpsn(x=x, K=100)
select.res <- select_Fpsn(res, method="givenVariance")
smt <- getSMT(res, select.res)
# }

Run the code above in your browser using DataLab