def test_x_y_from_zeta_eta(): zeta = np.random.rand(20) * 40 eta = np.random.rand(20) x, y = x_y_from_zeta_eta(zeta, eta) theta = np.pi * eta / 4.0 x_ = zeta * np.sin(theta) y_ = zeta * np.cos(theta) assert np.allclose(x, x_) assert np.allclose(y, y_)
def test_extended_czjzek_polar(): S0 = {"zeta": 1, "eta": 0.1} x, y = ExtCzjzekDistribution(S0, eps=0.05, polar=True).rvs(size=COUNT) x1, y1 = x_y_from_zeta_eta(*x_y_to_zeta_eta(x, y)) np.testing.assert_almost_equal(x, x1) np.testing.assert_almost_equal(y, y1)
def test_czjzek_polar(): x, y = CzjzekDistribution(sigma=0.5, polar=True).rvs(size=COUNT) x1, y1 = x_y_from_zeta_eta(*x_y_to_zeta_eta(x, y)) np.testing.assert_almost_equal(x, x1) np.testing.assert_almost_equal(y, y1)