Fpsn_w: Fpsn_w

View source: R/fpaccess.R

Fpsn_wR Documentation

Fpsn_w

Description

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

Usage

Fpsn_w(x, w, Kmax, mini = min(x), maxi = max(x))

Arguments

x

a numerical vector to segment

w

a numerical vector of weights (values should be larger than 0).

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 costs J.est in 1 to Kmax 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)

fpopw documentation built on June 7, 2022, 1:09 a.m.

Related to Fpsn_w in fpopw...