@@ -1112,7 +1112,7 @@ cdef class RandomState:
1112
1112
1113
1113
def randn (self , * args , method = __normal_method ):
1114
1114
"""
1115
- randn(d0, d1, ..., dn)
1115
+ randn(d0, d1, ..., dn, method='inv' )
1116
1116
1117
1117
Return a sample (or samples) from the "standard normal" distribution.
1118
1118
@@ -1132,6 +1132,9 @@ cdef class RandomState:
1132
1132
d0, d1, ..., dn : int, optional
1133
1133
The dimensions of the returned array, should be all positive.
1134
1134
If no argument is given a single Python float is returned.
1135
+ method : str, optional
1136
+ Either 'inv' or 'zig'. 'inv' uses the default FIXME method. 'zig' uses
1137
+ the much faster ziggurat method of FIXME.
1135
1138
1136
1139
Returns
1137
1140
-------
@@ -3674,9 +3677,9 @@ cdef class RandomState:
3674
3677
0.0 , '' , CONS_NONE )
3675
3678
3676
3679
# Multivariate distributions:
3677
- def multivariate_normal (self , mean , cov , size = None ):
3680
+ def multivariate_normal (self , mean , cov , size = None , method = __normal_method ):
3678
3681
"""
3679
- multivariate_normal(mean, cov[ , size] )
3682
+ multivariate_normal(mean, cov, size=None, method='inv' )
3680
3683
3681
3684
Draw random samples from a multivariate normal distribution.
3682
3685
@@ -3699,6 +3702,9 @@ cdef class RandomState:
3699
3702
generated, and packed in an `m`-by-`n`-by-`k` arrangement. Because
3700
3703
each sample is `N`-dimensional, the output shape is ``(m,n,k,N)``.
3701
3704
If no shape is specified, a single (`N`-D) sample is returned.
3705
+ method : str, optional
3706
+ Either 'inv' or 'zig'. 'inv' uses the default FIXME method. 'zig' uses
3707
+ the much faster ziggurat method of FIXME.
3702
3708
3703
3709
Returns
3704
3710
-------
@@ -3795,7 +3801,7 @@ cdef class RandomState:
3795
3801
# form a matrix of shape final_shape.
3796
3802
final_shape = tuple (shape [:])
3797
3803
final_shape += (mean .shape [0 ],)
3798
- x = self .standard_normal (final_shape ).reshape (- 1 , mean .shape [0 ])
3804
+ x = self .standard_normal (final_shape , method = method ).reshape (- 1 , mean .shape [0 ])
3799
3805
3800
3806
# Transform matrix of standard normals into matrix where each row
3801
3807
# contains multivariate normals with the desired covariance.
0 commit comments