gfpop: Graph-Constrained Functional Pruning Optimal Partitioning...

Description Usage Arguments Value

View source: R/gfpop.R

Description

Functional pruning optimal partitioning with a graph structure to take into account constraints on consecutive segment parameters. The user has to specify the graph he wants to use (see the graph function) and a type of cost function. This is the main function of the gfpop package.

Usage

1
gfpop(data, mygraph, type = "mean", weights = NULL, testMode = FALSE)

Arguments

data

vector of data to segment

mygraph

dataframe of class "graph" to constrain the changepoint inference

type

a string defining the cost model to use: "mean", "variance", "poisson", "exp", "negbin"

weights

vector of weights (positive numbers), same size as data

testMode

boolean. False by default. Used to debug the code

Value

a gfpop object = (changepoints, states, forced, parameters, globalCost)

changepoints

is the vector of changepoints (we give the last element of each segment)

states

is the vector giving the state of each segment

forced

is the vector specifying whether the constraints of the graph are active (=1) or not (=0)

parameters

is the vector of successive parameters of each segment

globalCost

is a number equal to the total loss: the minimal cost for the optimization problem with all penalty values excluded


gfpop documentation built on Feb. 17, 2021, 5:08 p.m.

Related to gfpop in gfpop...