-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
72c07ed
commit 9ed3c96
Showing
4 changed files
with
145 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import numpy as np | ||
from numpy.testing import assert_equal | ||
import unittest | ||
from dc_integration.distribution import ( | ||
ComplexAngularCentralGaussian, | ||
ComplexWatsonTrainer, | ||
) | ||
|
||
|
||
class TestComplexWatson(unittest.TestCase): | ||
def test_complex_watson_shapes(self): | ||
covariance = np.array( | ||
[[10, 1 + 1j, 1 + 1j], [1 - 1j, 5, 1], [1 - 1j, 1, 2]] | ||
) | ||
covariance /= np.trace(covariance) | ||
model = ComplexAngularCentralGaussian(covariance=covariance) | ||
x = model.sample(size=(10000,)) | ||
model = ComplexWatsonTrainer().fit(x) | ||
assert_equal(model.mode.shape, (3,)) | ||
assert_equal(model.concentration.shape, ()) |