cubic

hyppo.tools.cubic(n, p, noise=False, low=- 1, high=1, cubs=[- 12, 48, 128], scale=0.3333333333333333)

Cubic simulation.

Cubic \((X, Y) \in \mathbb{R}^p \times \mathbb{R}\):

\[\begin{split}X &\sim \mathcal{U}(-1, 1)^p \\ Y &= 128 \left( w^T X - \frac{1}{3} \right)^3 + 48 \left( w^T X - \frac{1}{3} \right)^2 - 12 \left( w^T X - \frac{1}{3} \right) + 80 \kappa \epsilon\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.

  • cubs (list of ints, default: [-12, 48, 128]) -- Coefficients of the cubic function where each value corresponds to the order of the cubic polynomial.

  • scale (float, default: 1/3) -- Scaling center of the cubic.

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.

Examples using hyppo.tools.cubic