Skip to content

Commit

Permalink
docs:Evaluation after fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
antononcube committed Aug 26, 2024
1 parent 00e3c1c commit 171e214
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ use Statistics::Distributions;
say random-real();
```
```
# 0.4199527954793181
# 0.7592622521457041
```

Here is a random real between 0 and 20:
Expand All @@ -46,7 +46,7 @@ Here is a random real between 0 and 20:
say random-real(20);
```
```
# 9.86785457558584
# 13.75622740821709
```

Here are six random reals between -2 and 12:
Expand All @@ -55,7 +55,7 @@ Here are six random reals between -2 and 12:
say random-real([-2,12], 6);
```
```
# (4.64238262578993 7.5597573673489435 -0.6657498470161849 0.6622196436310439 -1.49472457527887 -0.08573095506348327)
# (3.0033123181565013 7.113524502384845 7.819889667003045 4.667762071569815 2.2293977432836787 4.62552640792827)
```

Here is a 4-by-3 array of random reals between -3 and 3:
Expand All @@ -64,10 +64,10 @@ Here is a 4-by-3 array of random reals between -3 and 3:
say random-real([-3,3], [4,3]);
```
```
# [[0.4067735187519572 2.1234670572727 -1.998094450503193]
# [2.9132811969808827 -2.9279360830602705 -2.994626599483799]
# [1.7404082895355382 -0.44550938724623457 -2.9778020582412763]
# [-2.444232062158215 1.8007289848458408 1.508621954689069]]
# [[0.8962887169094373 0.8475392360917491 1.0010550608069124]
# [-1.9147288691032502 -0.0015343761906390085 -2.9979319508996576]
# [-1.671356089026771 2.6005681211674636 -2.6841480871096164]
# [-2.8547683653645812 -0.19887668521620405 -0.3428770060549846]]
```


Expand All @@ -88,30 +88,28 @@ Here are examples:
say random-variate(BernoulliDistribution.new(:p(0.3)), 1000).BagHash.Hash;
```
```
# {0 => 703, 1 => 297}
# {0 => 682, 1 => 318}
```

```perl6
say random-variate(BinomialDistribution.new(:n(10), :p(0.2)), 10);
```
```
#ERROR: No such method 'continuos' for invocant of type
#ERROR: 'Statistics::Distributions::Defined::Binomial'
# Nil
# (1 3 1 0 4 4 2 2 1 2)
```

```perl6
say random-variate(NormalDistribution.new( µ => 10, σ => 20), 5);
```
```
# (27.160386092505465 11.45339184256685 44.7822108310777 19.589622764239174 24.42576153388579)
# (12.902823669355172 -13.257944841859484 -1.4868291672787866 0.2038154783934356 24.267632487527415)
```

```perl6
say random-variate(UniformDistribution.new(:min(2), :max(60)), 5);
```
```
# (42.80507386881271 45.52570370216639 30.46189687553613 41.52131923470594 20.938161538422506)
# (24.785346324895734 49.08911592317513 23.839282487269333 11.76219519981244 29.1045406261129)
```

**Remark:** Only Normal distribution and Uniform distribution are implemented at this point.
Expand All @@ -125,9 +123,9 @@ Here is an example of 2D array generation:
say random-variate(NormalDistribution.new, [3,4]);
```
```
# [[-1.8163317385732753 1.09570050911966 -0.10450107441456423 -1.030299173260216]
# [1.4326799143559485 1.411448281298804 0.4167889419032486 -0.38779920694800313]
# [-0.07959194817170769 -1.2112044997169233 0.03319807558698593 -0.5066769343464822]]
# [[0.9640921640530472 -1.6220259520074567 -2.232915785778588 0.7428103187276472]
# [-0.12436431748435604 2.272534039830153 -0.4204602985182264 -0.1257869441808453]
# [-1.8250762803050216 1.9181693324456424 -0.8693291565656599 0.8154730584189308]]
```

**Remark:** The Markdown document
Expand Down

0 comments on commit 171e214

Please sign in to comment.