Skip to content

Graphical tools for CTNB

A CTBN with its CIMs

pyagrum.ctbn.plotTrajectory(v, traj, timeHorizon=None, plotname=None)

Section titled “pyagrum.ctbn.plotTrajectory(v, traj, timeHorizon=None, plotname=None)”

Plot a variable’s trajectory using matplotlib.pyplot.

  • Parameters:
    • v (pyagrum.DiscreteVariable) – Variable to follow.
    • traj (List [**Tuple [**float , str , str ] ]) – Trajectory to plot.
    • timeHorizon (float) – Maximum time length to show.
    • plotname (str) – Name of the plot.

pyagrum.ctbn.plotFollowVar(v, trajectories, timeHorizon=None, N=None, plotname=None)

Section titled “pyagrum.ctbn.plotFollowVar(v, trajectories, timeHorizon=None, N=None, plotname=None)”

Plot the evolution (the proportions of the states the variable transition into) of a variable over time.

  • Parameters:
    • v (pyagrum.DiscreteVariable) – The variable to follow.
    • trajectories (Dict [**int , List [**Tuple [**float , str , str ] ] ]) – Contains trajectories. The result is a mean over all the trajectories.
    • timeHorizon (float) – Maximum time length to plot. If None, then the entire time length of the trajectories is used.
    • N (int) – Number of division of interval [0, timeHorizon].
    • plotname (str) – Name of the plot. If None, the picked name is “Proportions for each state of {v.name()}”.