I have a PyMC model and I really like the pm.model_to_graphviz(model=model) functionality. I would like to include that graphviz in a paper that I’m writing. However, that graphviz plots the raw variable names defined within the model (things like ‘mu_X’ and ‘sigma_X’) – is there a way to provide pm.model_to_graphviz with a dict mapping from raw variable name to LaTeX-formatted strings like r’\mu_{\rm X}’ and r’\sigma_{\rm X} ?
I tried creating a similar pymc model with LaTeX variable names for graphviz purposes but it doesn’t work:
with pm.Model() as model:
mu_X = pm.Uniform(r'$\mu_{\rm X}$', lower=0,upper=1)
sigma_X = pm.Uniform(r'$\sigma_{\rm X}$', lower=0,upper=1)
pm.model_to_graphviz(model=model)
The resulting model graphviz doesn’t translate the LaTeX – is there an easy way to make this work? (again I don’t need the latex variables for my actual model that runs for the fitting – just for a separate pymc model construction like above for graphviz purposes only)