LaTeX code for algo that simulates inhibitions with model averaging.
\documentclass{article}
\usepackage{amsmath}
\usepackage{algorithm}
\usepackage[noend]{algpseudocode}
\makeatletter
\def\BState{\State\hskip-\ALG@thistlm}
\makeatother
\begin{document}
Let $X$ be node in the causal graph. Given model averaging results M, let $P_M(Y\leftrightarrow X)$, $P_M(Y \rightarrow X)$ be, respectively, the proportion of times an edge between Y and X appears, the proportion of times when it does appear, the edge is directed from Y to X. Let $I_X$ be an inhibition on X. Then given model averaging results M, we simulate the effect of $I_X$, producing model averaging results $M_{I_X}$. The simulation uses the following algorithm (pseudocode):
\begin{algorithm}
\caption{Simulate Inhibition}\label{euclid}
\begin{algorithmic}[1]
\Procedure{SimInhibition}{}
\State $wl \gets \textit{an empty whitelist object}$
\For{each node $Y \mid Y \neq X$}
\State $U1$, $U2$ $\sim$ uniform(0,1)
\If {$U1 > P_M(Y\leftrightarrow X)$}
\If {$U2 > P_M(X_j \rightarrow X_i)$ }
\State add $X_j \rightarrow X_i$ to whitelist
\Else
\State add $X_j \leftarrow X_i$ to whitelist
\EndIf
\EndIf
\EndFor
\State $M_{I_X} \gets ModelAveraging(data, whitelist)$
\State \Return $M_{I_X}$
\EndProcedure
\end{algorithmic}
\end{algorithm}
\begin{algorithm}
\caption{Simulate Inhibitions}\label{euclid}
\begin{algorithmic}[1]
\Procedure{SimInhibitions}{M, S}
\State create an empty whitelist object
\For{each node $X \in S$}
\For{each node $Y \mid Y \neq X$}
\If{$Y \rightarrow X$ or $Y \leftarrow X$ $\notin$ whitelist }
\State $U1$, $U2$ $\sim$ uniform(0,1)
\If {$U1 > P_M(Y\leftrightarrow X)$}
\If {$U2 > P_M(X_j \rightarrow X_i)$ }
\State add $X_j \rightarrow X_i$ to whitelist
\Else
\State add $X_j \leftarrow X_i$ to whitelist
\EndIf
\EndIf
\EndIf
\EndFor
\EndFor
\State $M_{I_X} \gets ModelAveraging(data, whitelist)$
\State \Return $M_{I_X}$
\EndProcedure
\end{algorithmic}
\end{algorithm}
\end{document}