%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  File: utils.tex
%
%  Utilities for typesetting in latex
%
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\newcommand{\K}{\B{K}_{\B{\theta}}}
\long\def\cut#1{}

%integration
\newcommand{\SI}{{Supplementary Information}}
\newcommand{\gppvae}{GPPVAE}
\newcommand{\joint}{\gppvae-joint}
\newcommand{\dis}{\gppvae-dis}
\newcommand{\eg}{\textit{e.\,g., }}
\newcommand{\Eg}{\textit{E.\,g.,}}
\newcommand{\ie}{\textit{i.\,e., }}
\newcommand{\Ie}{\textit{I.\,e.}}
\newcommand{\etal}{\textit{et al.}}
\newcommand{\etc}{\textit{etc}.,}

\newcommand{\dx}{\text{diag}(\B{x})}
\newcommand{\be}{\begin{equation}}
\newcommand{\ee}{\end{equation}}
\newcommand{\bea}{\begin{eqnarray}}
\newcommand{\eea}{\end{eqnarray}}
\newcommand{\beas}{\begin{eqnarray*}}
\newcommand{\eeas}{\end{eqnarray*}}
\newcommand{\logdet}[1]{\log\left\lvert{#1}\right\rvert}

\newcommand{\kron}{\otimes}
\newcommand{\half}{\frac{1}{2}}
\newcommand{\iid}{{\it iid~}}

\newcommand{\const}{{\rm const.}}
\newcommand{\matlab}{${\rm Matlab}^{\Pisymbol{psy}{226}}$}
\newcommand{\from}[2]{{\color{red}\fbox{#1} #2}}
\newcommand{\TODO}[1]{{\color{red}\fbox{TODO} #1}}
\newcommand{\CHANGE}[1]{{\color{blue} #1}}

% for commenting
\newcommand{\fpc}[1]{{\color{blue} #1}}
\newcommand{\micha}[1]{{\color{orange}#1}}
\newcommand{\mm}[1]{{\color{green}#1}}
\newcommand{\GPT}[1]{{\color{blue} #1}}

% Distributions
\newcommand{\Pht}{\B{P}^{\frac{T}{2}}}
\newcommand{\Ph}{\B{P}^{\frac{1}{2}}}
\newcommand{\normal}[2]{\mathcal{N}\left(\, {#1} \,,\, {#2} \,\right)}
\newcommand\Normal[3]{\normal{ {#1} \, \big| \, {#2} }{ {#3} }}
\newcommand{\dgamma}[2]{\Gamma\left(#1 \given #2\right)}
\newcommand{\simnormal}[2]{\sim\mathcal{N}\left(#1,  #2\right)}
\newcommand{\simnorm}[2]{\sim\mathcal{N}\left(#1,\:#2\right)}
%true,false
\newcommand{\true}{\text{true}}
\newcommand{\false}{\text{false}}

% calH, calD
\newcommand{\calH}{\mathcal{H}}
\newcommand{\calD}{\mathcal{D}}

%
\newcommand{\indep}{\bot \hspace{-0.6em} \bot}
\newcommand{\given}{\,|\,}
\newcommand{\twolines}{\,||\,}
\newcommand{\narroweq}{\!\!=\!\!}

% Parents and children
\newcommand{\pa}[1]{{\rm pa_\mathit{#1}}}
\newcommand{\cp}[2]{{\rm cp_\mathit{#1}^{(\mathit{#2})}}}
\newcommand{\ch}[1]{{\rm ch_\mathit{#1}}}

\newcommand{\cip}{\mbox{$\perp\!\!\!\perp$}}
\newcommand{\condindep}[3]{#1~\cip~#2~|~#3}
\newcommand{\nocondindep}[3]{#1~\mbox{$\not\!\perp\!\!\!\perp$}~#2~|~#3}
\newcommand{\dir}[2]{{\rm Dir}(#1|#2)}

\newcommand{\llangle}{{\langle \hspace{-0.7mm} \langle}}
\newcommand{\rrangle}{{\rangle \hspace{-0.7mm} \rangle}}
\newcommand{\define}{\stackrel{\mathrm{def}}{=}}

\newcommand{\La}{\left\langle}
\newcommand{\Ra}{\right\rangle}
\newcommand{\EXP}[1]{\left\langle #1 \right\rangle}
\newcommand{\vectwo}[2]{\left[\begin{array}{c} #1 \\ #2 \end{array}\right]}
\newcommand{\vecn}[1]{\left[\begin{array}{c} #1 \end{array}\right]}
\newcommand{\col}{\mathrm{vec}}
\newcommand{\colI}{\mathrm{vecI}}
\newcommand{\T}{{\top}}
\newcommand{\diag}{{\rm diag}}
\newcommand{\tr}[1]{\text{tr}\left(#1\right)}
\newcommand{\mean}{\mbox{mean}}
\newcommand{\std}{\mbox{std}}
\newcommand{\diff}[1]{{\,d#1}}
\newcommand{\vgraph}[1]{
  \newpage
  \begin{center}
  {\large \bf #1}
  \end{center}
  \vspace{2mm}
}
\newcommand{\citeasnoun}[1]{\citeN{#1}}
\newcommand{\citemulti}[2]{(#1, \citeyearNP{#2})}
\newcommand{\citemultiN}[2]{#1 (\citeyearNP{#2})}
\newcommand{\Sum}{{\displaystyle \sum}}
%\newcommand{\sumint2}{\operatorname*{\sum \!\!\!\!\!\!\!\!\!\!\!\!
%\int}}
\newcommand{\msumint}{\operatorname*{\sum \!\!\!\!\!\!\!\! \int}}


%\nipsfinalcopy % Uncomment for camera-ready version
\newcommand{\B}[1]{\bm{#1}}

\newcommand{\Supp}{\textbf{Supplementary Information}}
\newcommand{\SuppFigure}[1]{\textcolor{purple}{Fig A#1}}
\newcommand{\SuppTable}[1]{\textcolor{purple}{Table A#1}}
\newcommand{\Var}[1]{\text{Var}\left(#1\right)}
\newcommand{\Cov}[2]{\text{Cov}\left(#1,#2\right)}
\newcommand{\bfpar}[1]{\noindent\textbf{#1}}
