Skip to content

Commit 4e3711e

Browse files
committed
correct vignette
1 parent 10a77e9 commit 4e3711e

2 files changed

Lines changed: 135 additions & 57 deletions

File tree

vignettes/vignette_start.Rmd

Lines changed: 48 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -903,12 +903,12 @@ Fspecies60$quantiles[, , c('5.5%', '94.5%')]
903903
904904

905905

906-
## Updates in island-wise conditional frequencies: a surprising result
906+
## Updates in island-wise conditional frequencies
907907

908908
We can quickly repeat the analysis above for the *conditional* frequencies on the `Biscoe` and `Dream` islands, that is, the frequencies for the two subpopulations of penguins living on those two islands. Let's directly plot the probability distributions for the two subpopulation frequencies, together with those from the previous inference.
909909

910-
\
911-
For `Dream` island:
910+
911+
### For `Dream` island
912912

913913

914914
``` r
@@ -934,8 +934,7 @@ hist(onlyDream10, legend = 'topright', xlim = c(0, 1),
934934
The new frequency estimates for `Adelies` (solid red line) and `Chinstrap` (dashed blue line) are now less than 10% apart, whereas the previous estimates had them 20% apart. But this change is not unexpected: these new estimates are well within the previous credibility intervals; we were correctly warned about their possible change.
935935

936936

937-
\
938-
For `Biscoe` island:
937+
### For `Biscoe` island: a surprising result {#surprise}
939938

940939

941940
``` r
@@ -1204,7 +1203,8 @@ Fanalysis <- Pr(Y = Y, X = X, learnt = learntall, parallel = 4)
12041203
#
12051204
# Closing connections to cores.
12061205
```
1207-
Here are the probability distributions for the three frequencies:
1206+
Here are the probability distributions and the credibility intervals for the three frequencies:
1207+
12081208

12091209
``` r
12101210
hist(Fanalysis, xlim = c(0, 1), col = 2:4, ## same colours as before!
@@ -1213,6 +1213,25 @@ hist(Fanalysis, xlim = c(0, 1), col = 2:4, ## same colours as before!
12131213

12141214
<img src="figure/unnamed-chunk-8-1.png" width="100%" />
12151215

1216+
``` r
1217+
1218+
Fanalysis$values
1219+
# X
1220+
# Y Biscoe
1221+
# Adelie 0.2601481
1222+
# Chinstrap 0.0362443
1223+
# Gentoo 0.7036076
1224+
1225+
Fanalysis$quantiles[, , c('5.5%', '94.5%')]
1226+
#
1227+
# Y 5.5% 94.5%
1228+
# Adelie 0.2078777 0.3144158
1229+
# Chinstrap 0.0162262 0.0606095
1230+
# Gentoo 0.6453513 0.7577983
1231+
```
1232+
1233+
Conclusion:
1234+
12161235
> From a sample of 344 penguins, the relative frequencies of the three species **on Biscoe island** are estimated as follows:
12171236
>
12181237
> Adélie
@@ -1227,7 +1246,7 @@ hist(Fanalysis, xlim = c(0, 1), col = 2:4, ## same colours as before!
12271246
> : estimate 0.70
12281247
> <br>true rel. frequency between 0.65 and 0.76 with 89% probability
12291248
1230-
Note how our previous estimates from 60 samples were already quite on the spot.
1249+
Note how our [previous estimates from 60 samples](#surprise) were already quite on the spot.
12311250

12321251

12331252
### **Q2b**: Adélie on three islands
@@ -1248,13 +1267,14 @@ Xvls <- 'Adelie' ## subpopulation value
12481267
X <- data.frame(Xvls)
12491268
colnames(X) <- Xvrt
12501269

1270+
## NB: rewriting the previous 'Fanalysis' object
12511271
Fanalysis <- Pr(Y = Y, X = X, learnt = learntall, parallel = 4)
12521272
#
12531273
# Registered doParallelSNOW with 4 workers
12541274
#
12551275
# Closing connections to cores.
12561276
```
1257-
Here are the probability distributions for the three frequencies:
1277+
Here are the probability distributions and confidence intervals for the three frequencies:
12581278

12591279
``` r
12601280
hist(Fanalysis, xlim = c(0, 1), col = 5:7,
@@ -1263,6 +1283,25 @@ hist(Fanalysis, xlim = c(0, 1), col = 5:7,
12631283

12641284
<img src="figure/unnamed-chunk-9-1.png" width="100%" />
12651285

1286+
``` r
1287+
1288+
Fanalysis$values
1289+
# X
1290+
# Y Adelie
1291+
# Biscoe 0.289930
1292+
# Dream 0.388796
1293+
# Torgersen 0.321274
1294+
1295+
Fanalysis$quantiles[, , c('5.5%', '94.5%')]
1296+
#
1297+
# Y 5.5% 94.5%
1298+
# Biscoe 0.232984 0.347477
1299+
# Dream 0.324777 0.452447
1300+
# Torgersen 0.264392 0.382129
1301+
```
1302+
1303+
Conclusions:
1304+
12661305
> From a sample of 344 penguins, the distribution of the **Adélies** species on the three islands is estimated as follows:
12671306
>
12681307
> Biscoe
@@ -1300,6 +1339,7 @@ Xvls <- sort(unique(penguin[, Xvrt])) ## subpopulation values
13001339
X <- data.frame(Xvls)
13011340
colnames(X) <- Xvrt
13021341

1342+
## NB: rewriting the previous 'Fanalysis' object
13031343
Fanalysis <- Pr(Y = Y, X = X, learnt = learntall, parallel = 4)
13041344
#
13051345
# Registered doParallelSNOW with 4 workers

vignettes/vignette_start.htm

Lines changed: 87 additions & 49 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)