ppplot: Plotting a branch of a probabilistic suffix tree

Description Usage Arguments Details Author(s) References See Also Examples

Description

The ppplot function displays the probability distributions of a node and all its parent nodes (suffixes) in the tree. IF the name of a gain function and a vector of pruning cutoffs are provided, the graphic will display the outcomes of the gain function, i.e., whether a node represents an information gain relative to its parent.

Usage

1
2
3
## S4 method for signature 'PSTf'
ppplot(object, path, gain, C, cex.plot = 1, nsize = 0.3, nlab=TRUE,
	psize = nsize/2, pruned.col = "red", div.col = "green", ...)

Arguments

object

a probabilistic suffix tree, i.e., an object of class "PSTf" as returned by the pstree, prune or tune function.

path

character. Either a character string representing the node label (i.e., the context) where symbols are separated by '-', or a vector where each element is a symbol. See example.

gain

character or function. Gain function, see prune.

C

numeric. Value of the cutoff used by the gain function, see prune.

cex.plot

numeric. Expansion factor for setting the size of the font for the axis labels and names. The default value is 1. Values lesser than 1 will reduce the size of the font, values greater than 1 will increase the size.

nsize

numeric. Size of the circles representing the nodes.

nlab

logical. Should the node label be displayed inside the circle?

psize

numeric. Size of the circles representing the outcome of the gain function.

pruned.col

character. Color used to represent a terminal node which provides no information gain relative to its parent.

div.col

character. Color used to represent an internal node which provides information gain relative to its parent.

...

additional parameters to be passed to the plot function.

Details

For more details, see Gabadinho 2016.

Author(s)

Alexis Gabadinho

References

Gabadinho, A. & Ritschard, G. (2016). Analyzing State Sequences with Probabilistic Suffix Trees: The PST R Package. Journal of Statistical Software, 72(3), pp. 1-39.

See Also

cplot, prune

Examples

1
2
3
4
data(s1)
s1.seq <- seqdef(s1)
S1 <- pstree(s1.seq, L=5, ymin=0.001)
ppplot(S1, "a-a-b-b-a", gain="G1", C=c(1.1, 1.2))

Example output

Loading required package: TraMineR

TraMineR stable version 2.0-7 (Built: "Sat,)
Website: http://traminer.unige.ch
Please type 'citation("TraMineR")' for citation information.

Loading required package: RColorBrewer

PST version 0.94 (Built: 2017-09-22)
Website: http://r-forge.r-project.org/projects/pst
 [>] 2 distinct states appear in the data: 
     1 = a
     2 = b
 [>] state coding:
       [alphabet]  [label]  [long label] 
     1  a           a        a
     2  b           b        b
 [>] 1 sequences in the data set
 [>] min/max sequence length: 27/27
 [>] 1 sequence(s) - min/max length: 27/27
 [>] max. depth L=5, nmin=1, ymin=0.001
     [L]  [nodes]
       0        1
       1        2
       2        4
       3        8
       4       15
       5       17
 [>] computing sequence(s) likelihood ... (0.012 secs)
 [>] total time: 0.316 secs
 [>] retrieving from node: e
 [>] longest suffix in the tree is: a-b-b-a-a
 [>] retrieving from node: a-b-b-a
 [>] retrieving from node: a-b-b-a
 [>] retrieving from node: b-b-a
 [>] retrieving from node: b-a
 [>] retrieving from node: a

PST documentation built on May 2, 2019, 3:43 a.m.

Related to ppplot in PST...