Próbkowanie w R
Richie Cotton
Data Evangelist at DataCamp
{adjective} wykonany, zrobiony, zaistniały lub wybrany bez metody ani świadomej decyzji.
random.seed <- 1
calc_next_random(seed)
3
calc_next_random(3)
2
calc_next_random(2)
6
| function | distribution | function | distribution | function | distribution |
|---|---|---|---|---|---|
| rbeta | Beta | rgeom | Geometryczny | rsignrank | Wilcoxon signed rank |
| rbinom | Dwumianowy | rhyper | Hipergeometryczny | rt | t |
| rcauchy | Cauchy'ego | rlnorm | Logarytmiczno-norm | runif | Jednostajny |
| rchisq | Chi-kwadrat | rlogis | Logistyczny | rweibull | Weibulla |
| rexp | Wykładniczy | rnbinom | Ujemnie dwumianowy | rwilcox | Wilcoxon rank sum |
| rf | F | rnorm | Normalny | ||
| rgamma | Gamma | rpois | Poissona |
rbeta(5000, shape1 = 2, shape2 = 2)
[1] 0.2788 0.7495 0.6485 0.6665 0.6546 0.1575
...
[4996] 0.84719 0.35177 0.92796 0.67603 0.53960
randoms <- data.frame(
beta = rbeta(5000, shape1 = 2, shape2 = 2)
)
ggplot(randoms, aes(beta)) +
geom_histogram(binwidth = 0.1)

set.seed(20000229)
rnorm(5)
-1.6538 -0.4028 -0.1654 -0.0734 0.5171
rnorm(5)
1.908 0.379 -1.499 1.625 0.693
set.seed(20000229)
rnorm(5)
-1.6538 -0.4028 -0.1654 -0.0734 0.5171
rnorm(5)
1.908 0.379 -1.499 1.625 0.693
set.seed(20000229)
rnorm(5)
-1.6538 -0.4028 -0.1654 -0.0734 0.5171
rnorm(5)
1.908 0.379 -1.499 1.625 0.693
set.seed(20041004)
rnorm(5)
-0.6547 -0.7854 -0.0152 0.1514 0.5285
rnorm(5)
0.748 0.974 0.174 -0.781 -0.930
Próbkowanie w R