>\[
Z \sim \textsf{multivariate normal}\left(
\begin{bmatrix}
0 \\
0
\end{bmatrix}, \
\begin{bmatrix}
1 &amp; \rho
\\
\rho &amp; 1
\end{bmatrix}
\right).
\]</span></p>
<p>The following Stan program implements this function,</p>
<div class="sourceCode" id="cb6"><pre class="sourceCode stan code-with-copy"><code class="sourceCode stan"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="dt">real</span> binormal_cdf(<span class="dt">real</span> z1, <span class="dt">real</span> z2