Created
September 12, 2025 14:53
-
-
Save abikoushi/44d3bdc8ae5bb96cb220c41507a0cf5e to your computer and use it in GitHub Desktop.
TikZ bayesnet example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| \documentclass[tikz, border=14pt]{standalone} | |
| \usepackage{tikz} | |
| \usetikzlibrary{bayesnet} | |
| \begin{document} | |
| \begin{tikzpicture} | |
| \node[obs] (x) {$X$}; | |
| \node[obs, above right = of x] (z) {$Z$}; | |
| \node[obs, below right = of z] (y) {$Y$}; | |
| \edge{x}{y}; | |
| \edge{z}{y}; | |
| \edge{z}{x}; | |
| \plate {plate1} {(x)(y)(z)} {$i=1,\ldots, n$ }; | |
| \node[latent, right = of y] (x2) {$X^\ast$}; | |
| \node[latent, above right = of x2] (z2) {$Z^\ast$}; | |
| \node[latent, below right = of z2] (y2) {$Y^\ast$}; | |
| \edge{x2}{y2}; | |
| \edge{z2}{y2}; | |
| \node[latent, left = of x] (phi) {$\phi$}; | |
| \node[latent, above right = of z] (gamma) {$\gamma$}; | |
| \node[latent, below right = of y] (psi) {$\Psi$}; | |
| \edge{psi}{y,y2}; | |
| \edge{gamma}{z, z2}; | |
| \edge{phi}{x}; | |
| \end{tikzpicture} | |
| \end{document} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment