Learn R Programming

MHMM (version 1.0.0)

plot: Plots of an instance of '>mhmmresults

Description

Plots of an instance of '>mhmmresults

Usage

# S4 method for mhmmresults,numeric
plot(x, y,
  col = x@partitions$states[[y]], xlab = "Time", ylab = "Activity",
  ylim = range(na.omit(x@data@yi[[y]])))

Arguments

x

instance of '>mhmmresults.

y

numeric index of the subject to visualize.

col

numeric indicates the latent state at each time (length must be equal to the length of x)

xlab

character label of the x-axis

ylab

character label of the y-axis

ylim

numeric range of the y-axis

Examples

Run this code
# NOT RUN {
data(accelero)
# To make the estimation <5
res <- mhmm(accelero, K = 2, M = 4, nbcores = 1, nbinit = 5, iterSmall = 2)
plot(res, 1)

 
# }
# NOT RUN {
data(accelero)
# It is better to increase the number of random initializations
res <- mhmm(accelero, K = 2, M = 4, nbcores = 1)
plot(res, 1)
# }

Run the code above in your browser using DataLab