uncorrelated_bernoulli

hyppo.tools.uncorrelated_bernoulli(n, p, noise=False, prob=0.5)

Uncorrelated Bernoulli simulation.

Uncorrelated Bernoulli \((X, Y) \in \mathbb{R}^p \times \mathbb{R}\): \(U \sim \mathcal{B}(0.5)\), \(\epsilon_1 \sim \mathcal{N}(0, I_p)\), \(\epsilon_2 \sim \mathcal{N}(0, 1)\),

\[\begin{split}X &= \mathcal{B}(0.5)^p + 0.5 \epsilon_1 \\ Y &= (2U - 1) w^T X + 0.5 \epsilon_2\end{split}\]
Parameters
  • n (int) -- The number of samples desired by the simulation (>= 5).

  • p (int) -- The number of dimensions desired by the simulation (>= 1).

  • noise (bool, default: False) -- Whether or not to include noise in the simulation.

  • prob (float, default: 0.5) -- The probability of the bernoulli distribution simulated from.

Returns

x,y (ndarray of float) -- Simulated data matrices. x` and ``y have shapes (n, p) and (n, 1) where n is the number of samples and p is the number of dimensions.