Skip to content

Commit 1d9739a

Browse files
mschauerdevmotion
andauthored
Add sentence about distribution objects (#1565)
* Add sentence about distribution objects * Apply suggestions from code review Co-authored-by: David Widmann <devmotion@users.noreply.github.com> Co-authored-by: David Widmann <devmotion@users.noreply.github.com>
1 parent f889f9e commit 1d9739a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

docs/src/starting.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,18 @@ Then, we create a standard-normal distribution `d` and obtain samples using `ran
2222
```julia
2323
julia> d = Normal()
2424
Normal=0.0, σ=1.0)
25+
```
26+
27+
The object `d` represents a probability distribution, in our case the standard-normal distribution.
28+
One can query its properties such as the mean:
29+
30+
```julia
31+
julia> mean(d)
32+
0.0
33+
```
2534

35+
We can also draw samples from `d` with `rand`.
36+
```julia
2637
julia> x = rand(d, 100)
2738
100-element Array{Float64,1}:
2839
0.376264

0 commit comments

Comments
 (0)