| 1234567891011121314151617 |
- import numpy as np
- from irae_risk.monotonic import forward_map
- def test_forward_map_is_invariant_under_parameter_sign_symmetries():
- theta = np.array([1.2, 0.7, -1.5, 2.3])
- expected = forward_map(theta)
- equivalent_theta = (
- theta * np.array([1, -1, 1, 1]),
- theta * np.array([1, 1, -1, -1]),
- theta * np.array([1, -1, -1, -1]),
- )
- for equivalent in equivalent_theta:
- np.testing.assert_allclose(forward_map(equivalent), expected)
|