1
1
from __future__ import division
2
2
3
3
import itertools
4
- from .helpers import SeededTest , fxarray , select_by_precision
4
+ from .helpers import SeededTest , select_by_precision
5
5
from ..vartypes import continuous_types
6
6
from ..model import Model , Point , Potential
7
7
from ..blocking import DictToVarBijection , DictToArrayBijection , ArrayOrdering
@@ -31,13 +31,13 @@ def get_lkj_cases():
31
31
Log probabilities calculated using the formulas in:
32
32
http://www.sciencedirect.com/science/article/pii/S0047259X09000876
33
33
"""
34
- tri = fxarray ([0.7 , 0.0 , - 0.7 ])
34
+ tri = np . array ([0.7 , 0.0 , - 0.7 ])
35
35
return [
36
36
(tri , 1 , 3 , 1.5963125911388549 ),
37
37
(tri , 3 , 3 , - 7.7963493376312742 ),
38
38
(tri , 0 , 3 , - np .inf ),
39
- (fxarray ([1.1 , 0.0 , - 0.7 ]), 1 , 3 , - np .inf ),
40
- (fxarray ([0.7 , 0.0 , - 1.1 ]), 1 , 3 , - np .inf )
39
+ (np . array ([1.1 , 0.0 , - 0.7 ]), 1 , 3 , - np .inf ),
40
+ (np . array ([0.7 , 0.0 , - 1.1 ]), 1 , 3 , - np .inf )
41
41
]
42
42
43
43
@@ -587,7 +587,7 @@ def test_multinomial(self, n):
587
587
588
588
def test_multinomial_vec (self ):
589
589
vals = np .array ([[2 ,4 ,4 ], [3 ,3 ,4 ]])
590
- p = fxarray ([0.2 , 0.3 , 0.5 ])
590
+ p = np . array ([0.2 , 0.3 , 0.5 ])
591
591
n = 10
592
592
593
593
with Model () as model_single :
@@ -602,7 +602,7 @@ def test_multinomial_vec(self):
602
602
603
603
def test_multinomial_vec_1d_n (self ):
604
604
vals = np .array ([[2 ,4 ,4 ], [4 ,3 ,4 ]])
605
- p = fxarray ([0.2 , 0.3 , 0.5 ])
605
+ p = np . array ([0.2 , 0.3 , 0.5 ])
606
606
ns = np .array ([10 , 11 ])
607
607
608
608
with Model () as model :
@@ -614,7 +614,7 @@ def test_multinomial_vec_1d_n(self):
614
614
615
615
def test_multinomial_vec_1d_n_2d_p (self ):
616
616
vals = np .array ([[2 ,4 ,4 ], [4 ,3 ,4 ]])
617
- ps = fxarray ([[0.2 , 0.3 , 0.5 ],
617
+ ps = np . array ([[0.2 , 0.3 , 0.5 ],
618
618
[0.9 , 0.09 , 0.01 ]])
619
619
ns = np .array ([10 , 11 ])
620
620
@@ -627,7 +627,7 @@ def test_multinomial_vec_1d_n_2d_p(self):
627
627
628
628
def test_multinomial_vec_2d_p (self ):
629
629
vals = np .array ([[2 ,4 ,4 ], [3 ,3 ,4 ]])
630
- ps = fxarray ([[0.2 , 0.3 , 0.5 ],
630
+ ps = np . array ([[0.2 , 0.3 , 0.5 ],
631
631
[0.3 , 0.3 , 0.4 ]])
632
632
n = 10
633
633
@@ -640,7 +640,7 @@ def test_multinomial_vec_2d_p(self):
640
640
641
641
def test_categorical_bounds (self ):
642
642
with Model ():
643
- x = Categorical ('x' , p = fxarray ([0.2 , 0.3 , 0.5 ]))
643
+ x = Categorical ('x' , p = np . array ([0.2 , 0.3 , 0.5 ]))
644
644
assert np .isinf (x .logp ({'x' : - 1 }))
645
645
assert np .isinf (x .logp ({'x' : 3 }))
646
646
@@ -661,7 +661,7 @@ def test_addpotential(self):
661
661
self .check_dlogp (model , value , R , {})
662
662
663
663
def test_get_tau_sd (self ):
664
- sd = fxarray ([2 ])
664
+ sd = np . array ([2 ])
665
665
assert_almost_equal (continuous .get_tau_sd (sd = sd ), [1. / sd ** 2 , sd ])
666
666
667
667
@pytest .mark .parametrize ('value,mu,sigma,nu,logp' , [
0 commit comments