pqplot {PST} | R Documentation |
Prediction quality plot
Description
Plot the predicted probability of each state in a sequence
Usage
## S4 method for signature 'PSTf,stslist'
pqplot(object, data, cdata, L, stcol, plotseq=FALSE,
ptype="b", cex.plot=1, space=0,
measure="prob", pqmax, seqscale, ...)
Arguments
object |
a probabilistic suffix tree, i.e., an object of class |
data |
a sequence object, i.e., an object of class |
cdata |
Not implemented yet. |
L |
integer. Maximal context length for sequence prediction. This is the same as pruning the PST by removing all nodes of depth<L before prediction. |
stcol |
character. Color to use to plot the prediction qualities. |
plotseq |
logical. If TRUE, the sequence is displayed separately, and the prediction plot is plotted above. |
ptype |
character. Type of plot, either |
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. |
space |
numeric. Space separating each state in the plot. |
measure |
character. Measure used for prediction quality. Either |
pqmax |
numeric. Maximum coordinate for the prediction quality plot, i.e. the max of the y axis. |
seqscale |
numeric. If |
... |
optional graphical parameters to be passed to the plot function. |
Details
The pqplot()
function displays either the predicted probabilities or the log-loss for each position of a single sequence as a series of barplots. 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), 1-39.
Examples
data(s1)
s1 <- seqdef(s1)
S1 <- pstree(s1, L=3)
z <- seqdef("a-b-a-a-b")
pqplot(S1, z)
pqplot(S1, z, measure="logloss", plotseq=TRUE)