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.
# S4 method for PSTf
ppplot(object, path, gain, C, cex.plot = 1, nsize = 0.3, nlab=TRUE,
psize = nsize/2, pruned.col = "red", div.col = "green", ...)
a probabilistic suffix tree, i.e., an object of class "PSTf"
as returned by the pstree
, prune
or tune
function.
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.
character or function. Gain function, see prune
.
numeric. Value of the cutoff used by the gain function, see prune
.
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.
numeric. Size of the circles representing the nodes.
logical. Should the node label be displayed inside the circle?
numeric. Size of the circles representing the outcome of the gain function.
character. Color used to represent a terminal node which provides no information gain relative to its parent.
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.
Alexis Gabadinho
For more details, see Gabadinho 2016.
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.
cplot
, prune
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))
Run the code above in your browser using DataLab