Try without "byte" in there. You'll have to scale and cast yourself, if that's what you really want, but beware the wraparound for negative values being cast to byte:
pdl> p grandom(3) [-1.0939726 1.0510039 -1.1494044] pdl> p grandom(3)->byte #different values, obviously [255 0 0] If you have GSL installed there are lots more distributions you can also use to generate deviates from. http://pdl.perl.org/?docs=GSL/RNG&title=PDL::GSL::RNG#ran_gaussian__ Derek On Nov 11, 2013, at 8:59 AM, mraptor wrote: > Is there are way to generate random values based on Normal distribution. > The same like rnorm() in R-language. > >> round( rnorm(3,mean=2^n/2,sd=sqrt(2^n)/2) ) > [1] 524758 524540 524647 > > I see there is grandom() funtion, but it requires some sort of lib (ndtri) ? > > pdl> p grandom(byte,1) > > ndtri domain error > [0] > > > thanks > > _______________________________________________ > Perldl mailing list > [email protected] > http://mailman.jach.hawaii.edu/mailman/listinfo/perldl > _______________________________________________ Perldl mailing list [email protected] http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
