[SciPy-user] Re: random variates

Brian Gue bgue at hotmail.com
Mon Apr 5 12:42:33 EDT 2004


Thanks for the help; I downloaded the April 1 package and the docstrings are 
much better. Still having some problems, though. Triangular is 
straightforward:

>>>from scipy import stats
>>>triangRV = stats.triang(.7, loc=0, scale=2)
>>>triangRV.rvs(10)
array([ 0.6086996 ,  1.30631752,  0.60636975,  0.8502878 ,  1.2694698 ,  
0.79918653,
             1.51063519,  1.12854753,  1.35386416,  0.63519953])
>>>


But truncated normal is not:

>>>truncnormRV = stats.truncnorm(0, 0.7, loc=0, scale=2)
>>>truncnormRV.rvs(10)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "C:\Python23\Lib\site-packages\scipy\stats\distributions.py", line 
125, in rvs
    return self.dist.rvs(*self.args,**kwds)
  File "C:\Python23\Lib\site-packages\scipy\stats\distributions.py", line 
440, in rvs
    vals = reshape(self._rvs(*args),size)
TypeError: _rvs() takes exactly 1 argument (3 given)
>>>


Any idea where I'm going wrong?

Brian


--Travis E. Oliphant wrote:
>
>The help should be better now.
>
>ie.
>
>scipy.info(scipy.stats.triang)
>
>...

_________________________________________________________________
Free yourself from those irritating pop-up ads with MSn Premium. Get 2months 
FREE*  
http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines




More information about the SciPy-User mailing list