R/plotSeries.R
plot_state_probability.Rd
Plot the estimated hidden path along with many other customizable options.
plot_state_probability(fit, stateProbability = "smoothed", features = NULL, stateProbabilityFunction = median, stateProbabilityInterval = posterior_intervals(c(0.1, 0.9)), chain = 1, main = NULL, xlab = NULL, ylab = NULL, addLegend = TRUE, legend.cex = 1, ...)
fit | An object returned by either |
---|---|
stateProbability | An optional character string with the name of the quantity used to classify the observations (either filtered or smoothed). It allows for partial matching. It defaults to the smoothed probability. |
features | An optional vector of character strings with the names of the features to include in the plot. These may be stateShade (shaded background), probabilityColoredLine (colored probability line), probabilityColoredDots (colored probability dots), probabilityFan (shaded probability fan for posterior intervals), bottomColoredMarks (colored marks on the lower axis), topColoredMarks (colored marks on the top axis). All colors are based on the hidden state assigned to each time step using the stateProbability quantity. Note that more than one feature may be plotted at the same time. It allows for partial matching. It defaults to none. |
stateProbabilityFunction | An optional function applied to the samples corresponding to one time step t, one hidden state k. The observation at time step t is then assigned to the hidden state with largest value. Note that the user needs to supply a function as an argument, and not a character string with the name of the function. It defaults to the |
stateProbabilityInterval | An optional function returning the upper and lower bound of the posterior intervals, such as |
chain | An optional integer number between 1 and the number of chains M. Only the samples generated by the selected chain are considered. It defaults to the first chain. |
main | An optional character string with the overall title for the plot. |
xlab | An optional character string with the title for the horizontal axis. |
ylab | An optional character string with the title for the vertical axis. |
addLegend | An optional boolean indicating whether a legend should be included. |
legend.cex | A numerical value giving the amount by which plotting legend text and symbols should be magnified relative to the default. It defaults to one. |
... | Arguments to be passed to the |
Other visualization functions: get_current_theme
,
get_default_theme
,
modify_theme_entry
,
plot_ppredictive
,
plot_series
, theme
# NOT RUN { plot_state_probability( myFit, stateProbability = "filtered", features = c("stateShade", "probabilityFan", "bottomColoredMarks"), chain = 2 ) # }