square

hyppo.tools.square(n, p, noise=False, low=- 1, high=1)

Square simulation.

Square \((X, Y) \in \mathbb{R}^p \times \mathbb{R}^p\): \(U \sim \mathcal{U}(-1, 1)\), \(V \sim \mathcal{N}(0, 1)^p\), \(\theta = -\frac{\pi}{8}\),

\[\begin{split}X_{|d|} &= U \cos(\theta) + V \sin(\theta) + 0.05 p \epsilon_{|d|} \ \mathrm{for}\ d = 1, ..., p \\ Y_{|d|} &= -U \sin(\theta) + V \cos(\theta)\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.

  • low (float, default: -1) -- The lower limit of the uniform distribution simulated from.

  • high (float, default: 1) -- The upper limit of the uniform distribution simulated from.

Returns

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