Statistics/Normal distribution: Difference between revisions
Content added Content deleted
(Added Julia language) |
|||
Line 1,207: | Line 1,207: | ||
0.8: ******* |
0.8: ******* |
||
0.9: **</pre> |
0.9: **</pre> |
||
=={{header|Julia}}== |
|||
Julia has the builtin package "Distributions" to generate random numbers from a standard distribution (Normal, Chisq etc.). |
|||
<lang julia>using Distributions, Gadfly |
|||
data = rand(Normal(0, 1), 1000) |
|||
@printf("N = %i\n", length(data)) |
|||
@printf("μ = %2.2f\tσ = %2.2f\n", mean(data), std(data)) |
|||
@printf("range = (%2.2f, %2.2f\n)", minimum(data), maximum(data)) |
|||
h = plot(x=data, Geom.histogram) |
|||
draw(PNG("norm_hist.png", 10cm, 10cm), h)</lang> |
|||
{{out}} |
|||
<pre>N = 1000 |
|||
μ = 0.02 σ = 0.97 |
|||
range = (-2.76, 3.42)</pre> |
|||
=={{header|Kotlin}}== |
=={{header|Kotlin}}== |