Vinecop.plot
- Vinecop.plot(self: pyvinecopulib.Vinecop, tree: object = None, add_edge_labels: bool = True, layout: str = 'graphviz', vars_names: object = None) None
Generates a plot for the Vinecop object.
This method generates a plot of the vine copula structure. It can be used to visualize the tree structure of the vine copula.
- Parameters:
tree (List[int] (default=None)) – The tree indice(s) to plot. If None, all trees are plotted.
add_edge_labels (bool (default=True)) – Whether to add edge labels to the plot.
layout (str (default="graphviz")) – The layout to use for plotting. Either “graphviz” or “spring_layout”.
vars_names (List[str] (default=None)) – The names of the variables for the vine model. If None, the indices are used.
- Returns:
Nothing, the function generates a plot and shows it using matplotlib.
Usage
import pyvinecopulib as pv import numpy as np np.random.seed(1234) u = np.random.uniform(0, 1, size=(20, 10)) vc = vc = pv.Vinecop(u, controls=pv.FitControlsVinecop(family_set=[pv.BicopFamily.indep])) vc.plot(tree=[0, 1, 2]) # Plots the first three trees vars_names = ["X" + str(i) for i in range(10)] vc.plot(vars_names=vars_names) # Using variable names for the plot