circle

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

Circle simulation.

Circle \((X, Y) \in \mathbb{R}^p \times \mathbb{R}^p\): \(U \sim \mathcal{U}(-1, 1)^p\), \(\epsilon \sim \mathcal{N}(0, I_p)\), \(r = 1\),

\[\begin{split}X_{|d|} &= r \left( \sin(\pi U_{|d+1|}) \prod_{j=1}^d \cos(\pi U_{|j|}) + 0.4 \epsilon_{|d|} \right)\ \mathrm{for}\ d = 1, ..., p-1 \\ X_{|p|} &= r \left( \prod_{j=1}^p \cos(\pi U_{|j|}) + 0.4 \epsilon_{|p|} \right) \\ Y_{|d|} &= \sin(\pi U_{|1|})\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.