# NOT RUN {
# First, we need a model that we want to visualise, we create
# one using the learnModel function.
fit <- learnModel(data = hmmaExampleData, amountOfStates = 3)
# To visualise the states and transitions, we use the visualise method.
# Only lines with a weight of 0.10 are drawn.
visualise(fit, minProb = 0.10)
# When it is not desired to relate the width of a line with its weight,
# this can be disabled:
visualise(fit, minProb = 0.10, relateWidthWithWeight = FALSE)
# Finally, it is possible to use a sigmoid instead of a linear relation:
visualise(fit, minProb = 0.10, widthType = 'sigmoid')
# To visualise the BNs within the states, use the code below
library(bnlearn)
graphviz.plot(fit$parms.emission[[1]])
# }
Run the code above in your browser using DataLab