# graph: Graph generation In gfpop: Graph-Constrained Functional Pruning Optimal Partitioning

 graph R Documentation

## Graph generation

### Description

Graph creation using component functions `Edge`, `StartEnd` and `Node`

### Usage

``````graph(
...,
type = "empty",
decay = 1,
gap = 0,
penalty = 0,
K = Inf,
a = 0,
all.null.edges = FALSE
)
``````

### Arguments

 `...` This is a list of edges definied by functions `Edge`, `StartEnd` and `Node`. See gfpop functions `gfpop::Edge()`, `gfpop::StartEnd()` and `gfpop::Node()` `type` a string equal to `"std"`, `"isotonic"`, `"updown"` or `"relevant"` to build a predefined classic graph `decay` a nonnegative number to give the strength of the exponential decay into the segment `gap` a nonnegative number to constrain the size of the gap in the change of state `penalty` a nonnegative number equals to the common penalty to use for all edges `K` a positive number. Threshold for the Biweight robust loss `a` a positive number. Slope for the Huber robust loss `all.null.edges` a boolean. Add null edges to all nodes automatically

### Value

a dataframe with 9 variables : columns are named `"state1"`, `"state2"`, `"type"`, `"parameter"`, `"penalty"`, `"K"`, `"a"`, `"min"`, `"max"` with additional `"graph"` class.

### Examples

``````graph(type = "updown", gap = 1.3, penalty = 5)

graph(Edge("Dw","Dw"),
Edge("Up","Up"),
Edge("Dw","Up","up", gap = 0.5, penalty = 10),
Edge("Up","Dw","down"),
StartEnd("Dw","Dw"),
Node("Dw",0,1),
Node("Up",0,1))

graph(Edge("1", "2", type = "std"),
Edge("2", "3", type = "std"),
Edge("3", "4", type = "std"),
StartEnd(start = "1", end = "4"),
all.null.edges = TRUE)
``````

gfpop documentation built on April 1, 2023, 12:22 a.m.