Re: [sage-support] Normal Distribution

2012-02-17 Thread Santanu Sarkar
Thanks for the help.

On 17 February 2012 16:00, Vegard Lima  wrote:
> On Fri, Feb 17, 2012 at 10:52 AM, Santanu Sarkar
>  wrote:
>> How to generate 1000 random integers which follow normal
>> distribution with mean 0 and variance 0.1?
>
> You can do this with numpy:
>
> sage: import numpy as np
> sage: mu, sigma = 0, sqrt(0.1) # mean and standard deviation
> sage: s = np.random.normal(mu, sigma, 1000)
>
> Note that it takes std.deviation as input not variance.
>
>
> Cheers,
> --
> Vegard
>
> --
> To post to this group, send email to sage-support@googlegroups.com
> To unsubscribe from this group, send email to 
> sage-support+unsubscr...@googlegroups.com
> For more options, visit this group at 
> http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Normal Distribution

2012-02-17 Thread Vegard Lima
On Fri, Feb 17, 2012 at 10:52 AM, Santanu Sarkar
 wrote:
> How to generate 1000 random integers which follow normal
> distribution with mean 0 and variance 0.1?

You can do this with numpy:

sage: import numpy as np
sage: mu, sigma = 0, sqrt(0.1) # mean and standard deviation
sage: s = np.random.normal(mu, sigma, 1000)

Note that it takes std.deviation as input not variance.


Cheers,
-- 
Vegard

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Normal Distribution

2012-02-17 Thread Santanu Sarkar
How to generate 1000 random integers which follow normal
distribution with mean 0 and variance 0.1?

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org