---
# System prepended metadata

title: Untitled

---

Zero-mean element-wise normal CDF:
$$
\Phi(\mathbf{x}, \mathbf{\sigma}) =  ~\frac{1}{2}[1 + \mathit{erf}~(\frac{\sigma^{-1}~\mathbf{x}}{\sqrt{2}})],  ~\sigma ~\text{is a diagonal matrix}
$$


Given unnormalized covariance matrix $\Sigma$ and Gaussian noise $\epsilon$

Standard method for sampling from Gaussian copula:

$$
\begin{equation}
\begin{split}
\Sigma &= L L^T \\
\mathcal{D} &= diag(\Sigma)^{-1/2}  \\
\mathcal{R} &= \mathcal{D}\Sigma \mathcal{D} = (DL)(L^TD) \\
z &= DL \epsilon \\
U &= \Phi(\mathbf{z},\mathbf{I}), 
\end{split}
\end{equation}
$$

Our approach:
$$
\begin{equation}
\begin{split}
\Sigma &= L L^T \\
z &= L \epsilon \\
U &= \Phi(\mathbf{z},diag(\Sigma)^{1/2}), 
\end{split}
\end{equation}
$$


-------------
## Density of copula relaxed bernoulli

Given 
$$
C(u_1, u_2, ...u_t) = \Phi_\Sigma(\Phi^{-1}(u_1), \Phi^{-1}(u_2), ... \Phi^{-1}(u_t))
$$

$$
\text{Let}\ RB_{\alpha,\lambda}(u) = Sigmoid(\frac{\log(\alpha) + \log(u) - \log(1 - u)}{\lambda}) 
$$

The joint density $p(x_1,\dots,x_n) \in (0,1)^{n}$ can be written as :

$$
p(x_1, \dots, x_n) = C(RB_{\alpha_1,\lambda}^{-1}(x_1),\dots,RB_{\alpha_n,\lambda}^{-1}(x_n)) * \prod_{i=1}^{n}\frac{d}{dx_i} RB_{\alpha_i,\lambda}^{-1}(x_i)
$$