class: center, middle, inverse, title-slide .title[ # 중심극한정리 ] .subtitle[ ## 각종 분포 → 정규분포 ] .author[ ### 이광춘 ] --- <style type="text/css"> .remark-code{line-height: 1.5; font-size: 30%} </style> --- class: middle, center # 정규분포에서 추출한 표본의 평균 ## 정규분포(평균 0, 표준편차 1) → ### 관측점 50번씩 추출을 100회 반복 --- count: false ### N(0,1) ~ 관측점 50 개 추출 .panel1-rnorm-10[ ```r tibble(var = rnorm(50, mean = 0, sd = 1)) %>% ggplot() + aes(x = var) + geom_rug() + geom_histogram(alpha = .15) + clt_theme + geom_rug(data = . %>% summarise(mean_var = mean(var)), mapping = aes(x = mean_var), color = "goldenrod", size = 2) + scale_y_continuous(limits = c(0,12)) + scale_x_continuous(limits = c(-3.5,3.5)) + labs(x = "변수", y = "빈도수", title = "정규분포에서 표본 50개 추출", subtitle = "정규분포 ~ 평균: 0, 표준편차 = 1") ``` ] .panel2-rnorm-10[ ![](distribution_clt_files/figure-html/rnorm_10_01_output-1.png)<!-- --> ] --- count: false ### N(0,1) ~ 관측점 50 개 추출 .panel1-rnorm-10[ ```r tibble(var = rnorm(50, mean = 0, sd = 1)) %>% ggplot() + aes(x = var) + geom_rug() + geom_histogram(alpha = .15) + clt_theme + geom_rug(data = . %>% summarise(mean_var = mean(var)), mapping = aes(x = mean_var), color = "goldenrod", size = 2) + scale_y_continuous(limits = c(0,12)) + scale_x_continuous(limits = c(-3.5,3.5)) + labs(x = "변수", y = "빈도수", title = "정규분포에서 표본 50개 추출", subtitle = "정규분포 ~ 평균: 0, 표준편차 = 1") ``` ] .panel2-rnorm-10[ ![](distribution_clt_files/figure-html/rnorm_10_02_output-1.png)<!-- --> ] --- count: false ### N(0,1) ~ 관측점 50 개 추출 .panel1-rnorm-10[ ```r tibble(var = rnorm(50, mean = 0, sd = 1)) %>% ggplot() + aes(x = var) + geom_rug() + geom_histogram(alpha = .15) + clt_theme + geom_rug(data = . %>% summarise(mean_var = mean(var)), mapping = aes(x = mean_var), color = "goldenrod", size = 2) + scale_y_continuous(limits = c(0,12)) + scale_x_continuous(limits = c(-3.5,3.5)) + labs(x = "변수", y = "빈도수", title = "정규분포에서 표본 50개 추출", subtitle = "정규분포 ~ 평균: 0, 표준편차 = 1") ``` ] .panel2-rnorm-10[ ![](distribution_clt_files/figure-html/rnorm_10_03_output-1.png)<!-- --> ] --- count: false ### N(0,1) ~ 관측점 50 개 추출 .panel1-rnorm-10[ ```r tibble(var = rnorm(50, mean = 0, sd = 1)) %>% ggplot() + aes(x = var) + geom_rug() + geom_histogram(alpha = .15) + clt_theme + geom_rug(data = . %>% summarise(mean_var = mean(var)), mapping = aes(x = mean_var), color = "goldenrod", size = 2) + scale_y_continuous(limits = c(0,12)) + scale_x_continuous(limits = c(-3.5,3.5)) + labs(x = "변수", y = "빈도수", title = "정규분포에서 표본 50개 추출", subtitle = "정규분포 ~ 평균: 0, 표준편차 = 1") ``` ] .panel2-rnorm-10[ ![](distribution_clt_files/figure-html/rnorm_10_04_output-1.png)<!-- --> ] --- count: false ### N(0,1) ~ 관측점 50 개 추출 .panel1-rnorm-10[ ```r tibble(var = rnorm(50, mean = 0, sd = 1)) %>% ggplot() + aes(x = var) + geom_rug() + geom_histogram(alpha = .15) + clt_theme + geom_rug(data = . %>% summarise(mean_var = mean(var)), mapping = aes(x = mean_var), color = "goldenrod", size = 2) + scale_y_continuous(limits = c(0,12)) + scale_x_continuous(limits = c(-3.5,3.5)) + labs(x = "변수", y = "빈도수", title = "정규분포에서 표본 50개 추출", subtitle = "정규분포 ~ 평균: 0, 표준편차 = 1") ``` ] .panel2-rnorm-10[ ![](distribution_clt_files/figure-html/rnorm_10_05_output-1.png)<!-- --> ] --- count: false ### N(0,1) ~ 관측점 50 개 추출 .panel1-rnorm-10[ ```r tibble(var = rnorm(50, mean = 0, sd = 1)) %>% ggplot() + aes(x = var) + geom_rug() + geom_histogram(alpha = .15) + clt_theme + geom_rug(data = . %>% summarise(mean_var = mean(var)), mapping = aes(x = mean_var), color = "goldenrod", size = 2) + scale_y_continuous(limits = c(0,12)) + scale_x_continuous(limits = c(-3.5,3.5)) + labs(x = "변수", y = "빈도수", title = "정규분포에서 표본 50개 추출", subtitle = "정규분포 ~ 평균: 0, 표준편차 = 1") ``` ] .panel2-rnorm-10[ ![](distribution_clt_files/figure-html/rnorm_10_06_output-1.png)<!-- --> ] --- count: false ### N(0,1) ~ 관측점 50 개 추출 .panel1-rnorm-10[ ```r tibble(var = rnorm(50, mean = 0, sd = 1)) %>% ggplot() + aes(x = var) + geom_rug() + geom_histogram(alpha = .15) + clt_theme + geom_rug(data = . %>% summarise(mean_var = mean(var)), mapping = aes(x = mean_var), color = "goldenrod", size = 2) + scale_y_continuous(limits = c(0,12)) + scale_x_continuous(limits = c(-3.5,3.5)) + labs(x = "변수", y = "빈도수", title = "정규분포에서 표본 50개 추출", subtitle = "정규분포 ~ 평균: 0, 표준편차 = 1") ``` ] .panel2-rnorm-10[ ![](distribution_clt_files/figure-html/rnorm_10_07_output-1.png)<!-- --> ] --- count: false ### N(0,1) ~ 관측점 50 개 추출 .panel1-rnorm-10[ ```r tibble(var = rnorm(50, mean = 0, sd = 1)) %>% ggplot() + aes(x = var) + geom_rug() + geom_histogram(alpha = .15) + clt_theme + geom_rug(data = . %>% summarise(mean_var = mean(var)), mapping = aes(x = mean_var), color = "goldenrod", size = 2) + scale_y_continuous(limits = c(0,12)) + scale_x_continuous(limits = c(-3.5,3.5)) + labs(x = "변수", y = "빈도수", title = "정규분포에서 표본 50개 추출", subtitle = "정규분포 ~ 평균: 0, 표준편차 = 1") ``` ] .panel2-rnorm-10[ ![](distribution_clt_files/figure-html/rnorm_10_08_output-1.png)<!-- --> ] --- count: false ### N(0,1) ~ 관측점 50 개 추출 .panel1-rnorm-10[ ```r tibble(var = rnorm(50, mean = 0, sd = 1)) %>% ggplot() + aes(x = var) + geom_rug() + geom_histogram(alpha = .15) + clt_theme + geom_rug(data = . %>% summarise(mean_var = mean(var)), mapping = aes(x = mean_var), color = "goldenrod", size = 2) + scale_y_continuous(limits = c(0,12)) + scale_x_continuous(limits = c(-3.5,3.5)) + labs(x = "변수", y = "빈도수", title = "정규분포에서 표본 50개 추출", subtitle = "정규분포 ~ 평균: 0, 표준편차 = 1") ``` ] .panel2-rnorm-10[ ![](distribution_clt_files/figure-html/rnorm_10_09_output-1.png)<!-- --> ] --- count: false ### N(0,1) ~ 관측점 50 개 추출 .panel1-rnorm-10[ ```r tibble(var = rnorm(50, mean = 0, sd = 1)) %>% ggplot() + aes(x = var) + geom_rug() + geom_histogram(alpha = .15) + clt_theme + geom_rug(data = . %>% summarise(mean_var = mean(var)), mapping = aes(x = mean_var), color = "goldenrod", size = 2) + scale_y_continuous(limits = c(0,12)) + scale_x_continuous(limits = c(-3.5,3.5)) + labs(x = "변수", y = "빈도수", title = "정규분포에서 표본 50개 추출", subtitle = "정규분포 ~ 평균: 0, 표준편차 = 1") ``` ] .panel2-rnorm-10[ ![](distribution_clt_files/figure-html/rnorm_10_10_output-1.png)<!-- --> ] <style> .panel1-rnorm-10 { color: black; width: 49%; hight: 32%; float: left; padding-left: 1%; font-size: 80% } .panel2-rnorm-10 { color: black; width: 49%; hight: 32%; float: left; padding-left: 1%; font-size: 80% } .panel3-rnorm-10 { color: black; width: NA%; hight: 33%; float: left; padding-left: 1%; font-size: 80% } </style> --- count: false ### 표본평균의 분포 ~ 정규분포 .panel1-rnorm_sample-1[ ```r tibble(trial = 1:100) %>% crossing(unit_id = 1:50) %>% group_by(trial) %>% mutate(var = rnorm(1:50, mean = 0, sd = 1)) %>% summarise(sample_mean = mean(var)) %>% ggplot() + aes(x = sample_mean) + geom_rug(color = "goldenrod", alpha = .2) + geom_histogram(alpha = .6, fill = "goldenrod", aes(y = ..density..) ) + geom_density(color = "grey") + clt_theme + scale_x_continuous(limits = c(-3.5, 3.5)) + labs(x = "표본 평균", y = "밀도(density)", title = "표본평균의 분포") ``` ] .panel2-rnorm_sample-1[ ![](distribution_clt_files/figure-html/rnorm_sample_1_01_output-1.png)<!-- --> ] <style> .panel1-rnorm_sample-1 { color: black; width: 49%; hight: 32%; float: left; padding-left: 1%; font-size: 80% } .panel2-rnorm_sample-1 { color: black; width: 49%; hight: 32%; float: left; padding-left: 1%; font-size: 80% } .panel3-rnorm_sample-1 { color: black; width: NA%; hight: 33%; float: left; padding-left: 1%; font-size: 80% } </style> --- class: middle, center # 균등분포에서 추출한 표본의 평균 ## 균등분포(최소 0, 최대 1) → ### 관측점 50번씩 추출을 100회 반복 --- count: false ### U(0,1) ~ 관측점 50 개 추출 .panel1-runif-10[ ```r tibble(var = runif(50, min = 0, max = 1)) %>% ggplot() + aes(x = var) + geom_rug() + geom_histogram(alpha = .15) + clt_theme + geom_rug(data = . %>% summarise(mean_var = mean(var)), mapping = aes(x = mean_var), color = "goldenrod", size = 2) + scale_y_continuous(limits = c(0,12)) + scale_x_continuous(limits = c(-0.1, 1.1)) + labs(x = "변수", y = "빈도수", title = "균등분포에서 표본 50개 추출", subtitle = "균등분포 ~ 최소: 0, 최대 = 1") ``` ] .panel2-runif-10[ ![](distribution_clt_files/figure-html/runif_10_01_output-1.png)<!-- --> ] --- count: false ### U(0,1) ~ 관측점 50 개 추출 .panel1-runif-10[ ```r tibble(var = runif(50, min = 0, max = 1)) %>% ggplot() + aes(x = var) + geom_rug() + geom_histogram(alpha = .15) + clt_theme + geom_rug(data = . %>% summarise(mean_var = mean(var)), mapping = aes(x = mean_var), color = "goldenrod", size = 2) + scale_y_continuous(limits = c(0,12)) + scale_x_continuous(limits = c(-0.1, 1.1)) + labs(x = "변수", y = "빈도수", title = "균등분포에서 표본 50개 추출", subtitle = "균등분포 ~ 최소: 0, 최대 = 1") ``` ] .panel2-runif-10[ ![](distribution_clt_files/figure-html/runif_10_02_output-1.png)<!-- --> ] --- count: false ### U(0,1) ~ 관측점 50 개 추출 .panel1-runif-10[ ```r tibble(var = runif(50, min = 0, max = 1)) %>% ggplot() + aes(x = var) + geom_rug() + geom_histogram(alpha = .15) + clt_theme + geom_rug(data = . %>% summarise(mean_var = mean(var)), mapping = aes(x = mean_var), color = "goldenrod", size = 2) + scale_y_continuous(limits = c(0,12)) + scale_x_continuous(limits = c(-0.1, 1.1)) + labs(x = "변수", y = "빈도수", title = "균등분포에서 표본 50개 추출", subtitle = "균등분포 ~ 최소: 0, 최대 = 1") ``` ] .panel2-runif-10[ ![](distribution_clt_files/figure-html/runif_10_03_output-1.png)<!-- --> ] --- count: false ### U(0,1) ~ 관측점 50 개 추출 .panel1-runif-10[ ```r tibble(var = runif(50, min = 0, max = 1)) %>% ggplot() + aes(x = var) + geom_rug() + geom_histogram(alpha = .15) + clt_theme + geom_rug(data = . %>% summarise(mean_var = mean(var)), mapping = aes(x = mean_var), color = "goldenrod", size = 2) + scale_y_continuous(limits = c(0,12)) + scale_x_continuous(limits = c(-0.1, 1.1)) + labs(x = "변수", y = "빈도수", title = "균등분포에서 표본 50개 추출", subtitle = "균등분포 ~ 최소: 0, 최대 = 1") ``` ] .panel2-runif-10[ ![](distribution_clt_files/figure-html/runif_10_04_output-1.png)<!-- --> ] --- count: false ### U(0,1) ~ 관측점 50 개 추출 .panel1-runif-10[ ```r tibble(var = runif(50, min = 0, max = 1)) %>% ggplot() + aes(x = var) + geom_rug() + geom_histogram(alpha = .15) + clt_theme + geom_rug(data = . %>% summarise(mean_var = mean(var)), mapping = aes(x = mean_var), color = "goldenrod", size = 2) + scale_y_continuous(limits = c(0,12)) + scale_x_continuous(limits = c(-0.1, 1.1)) + labs(x = "변수", y = "빈도수", title = "균등분포에서 표본 50개 추출", subtitle = "균등분포 ~ 최소: 0, 최대 = 1") ``` ] .panel2-runif-10[ ![](distribution_clt_files/figure-html/runif_10_05_output-1.png)<!-- --> ] --- count: false ### U(0,1) ~ 관측점 50 개 추출 .panel1-runif-10[ ```r tibble(var = runif(50, min = 0, max = 1)) %>% ggplot() + aes(x = var) + geom_rug() + geom_histogram(alpha = .15) + clt_theme + geom_rug(data = . %>% summarise(mean_var = mean(var)), mapping = aes(x = mean_var), color = "goldenrod", size = 2) + scale_y_continuous(limits = c(0,12)) + scale_x_continuous(limits = c(-0.1, 1.1)) + labs(x = "변수", y = "빈도수", title = "균등분포에서 표본 50개 추출", subtitle = "균등분포 ~ 최소: 0, 최대 = 1") ``` ] .panel2-runif-10[ ![](distribution_clt_files/figure-html/runif_10_06_output-1.png)<!-- --> ] --- count: false ### U(0,1) ~ 관측점 50 개 추출 .panel1-runif-10[ ```r tibble(var = runif(50, min = 0, max = 1)) %>% ggplot() + aes(x = var) + geom_rug() + geom_histogram(alpha = .15) + clt_theme + geom_rug(data = . %>% summarise(mean_var = mean(var)), mapping = aes(x = mean_var), color = "goldenrod", size = 2) + scale_y_continuous(limits = c(0,12)) + scale_x_continuous(limits = c(-0.1, 1.1)) + labs(x = "변수", y = "빈도수", title = "균등분포에서 표본 50개 추출", subtitle = "균등분포 ~ 최소: 0, 최대 = 1") ``` ] .panel2-runif-10[ ![](distribution_clt_files/figure-html/runif_10_07_output-1.png)<!-- --> ] --- count: false ### U(0,1) ~ 관측점 50 개 추출 .panel1-runif-10[ ```r tibble(var = runif(50, min = 0, max = 1)) %>% ggplot() + aes(x = var) + geom_rug() + geom_histogram(alpha = .15) + clt_theme + geom_rug(data = . %>% summarise(mean_var = mean(var)), mapping = aes(x = mean_var), color = "goldenrod", size = 2) + scale_y_continuous(limits = c(0,12)) + scale_x_continuous(limits = c(-0.1, 1.1)) + labs(x = "변수", y = "빈도수", title = "균등분포에서 표본 50개 추출", subtitle = "균등분포 ~ 최소: 0, 최대 = 1") ``` ] .panel2-runif-10[ ![](distribution_clt_files/figure-html/runif_10_08_output-1.png)<!-- --> ] --- count: false ### U(0,1) ~ 관측점 50 개 추출 .panel1-runif-10[ ```r tibble(var = runif(50, min = 0, max = 1)) %>% ggplot() + aes(x = var) + geom_rug() + geom_histogram(alpha = .15) + clt_theme + geom_rug(data = . %>% summarise(mean_var = mean(var)), mapping = aes(x = mean_var), color = "goldenrod", size = 2) + scale_y_continuous(limits = c(0,12)) + scale_x_continuous(limits = c(-0.1, 1.1)) + labs(x = "변수", y = "빈도수", title = "균등분포에서 표본 50개 추출", subtitle = "균등분포 ~ 최소: 0, 최대 = 1") ``` ] .panel2-runif-10[ ![](distribution_clt_files/figure-html/runif_10_09_output-1.png)<!-- --> ] --- count: false ### U(0,1) ~ 관측점 50 개 추출 .panel1-runif-10[ ```r tibble(var = runif(50, min = 0, max = 1)) %>% ggplot() + aes(x = var) + geom_rug() + geom_histogram(alpha = .15) + clt_theme + geom_rug(data = . %>% summarise(mean_var = mean(var)), mapping = aes(x = mean_var), color = "goldenrod", size = 2) + scale_y_continuous(limits = c(0,12)) + scale_x_continuous(limits = c(-0.1, 1.1)) + labs(x = "변수", y = "빈도수", title = "균등분포에서 표본 50개 추출", subtitle = "균등분포 ~ 최소: 0, 최대 = 1") ``` ] .panel2-runif-10[ ![](distribution_clt_files/figure-html/runif_10_10_output-1.png)<!-- --> ] <style> .panel1-runif-10 { color: black; width: 49%; hight: 32%; float: left; padding-left: 1%; font-size: 80% } .panel2-runif-10 { color: black; width: 49%; hight: 32%; float: left; padding-left: 1%; font-size: 80% } .panel3-runif-10 { color: black; width: NA%; hight: 33%; float: left; padding-left: 1%; font-size: 80% } </style> --- count: false ### 표본평균의 분포 ~ 균등분포 .panel1-runif_sample-1[ ```r tibble(trial = 1:100) %>% crossing(unit_id = 1:50) %>% group_by(trial) %>% mutate(var = runif(1:50, min = 0, max = 1)) %>% summarise(sample_mean = mean(var)) %>% ggplot() + aes(x = sample_mean) + geom_rug(color = "goldenrod", alpha = .2) + geom_histogram(alpha = .6, fill = "goldenrod", aes(y = ..density..) ) + geom_density(color = "grey") + clt_theme + scale_x_continuous(limits = c(-.05,1.05)) + labs(x = "표본 평균", y = "밀도(density)", title = "표본평균의 분포") ``` ] .panel2-runif_sample-1[ ![](distribution_clt_files/figure-html/runif_sample_1_01_output-1.png)<!-- --> ] <style> .panel1-runif_sample-1 { color: black; width: 49%; hight: 32%; float: left; padding-left: 1%; font-size: 80% } .panel2-runif_sample-1 { color: black; width: 49%; hight: 32%; float: left; padding-left: 1%; font-size: 80% } .panel3-runif_sample-1 { color: black; width: NA%; hight: 33%; float: left; padding-left: 1%; font-size: 80% } </style> --- class: middle, center # 지수분포에서 추출한 표본의 평균 ## 지수분포 (λ=1) → ### 관측점 50번씩 추출을 100회 반복 --- ### 지수분포 .pull-left[ ```r lambda <- seq(from = 1, to = 12, by = 1) lambda_g <- tibble(lambda = lambda) %>% mutate(samples = map(lambda, rexp, n = 50)) %>% unnest(cols = samples) %>% mutate(lamdba = glue::glue("λ = {lambda}")) %>% ggplot(aes(x = samples)) + geom_rug(color = "goldenrod", alpha = .2) + geom_histogram(alpha = .6, fill = "goldenrod", aes(y = ..density..) ) + geom_density(color = "grey") + clt_theme + facet_wrap( ~ lambda) + scale_x_continuous(limits = c(0, 3)) ``` ] .pull-right[ ```r lambda_g ``` ![](distribution_clt_files/figure-html/unnamed-chunk-3-1.png)<!-- --> ] --- count: false ### Exp(12) ~ 관측점 50 개 추출 .panel1-rexp-10[ ```r tibble(var = rexp(50, rate = 12)) %>% ggplot() + aes(x = var) + geom_rug() + geom_histogram(alpha = .15) + clt_theme + geom_rug(data = . %>% summarise(mean_var = mean(var)), mapping = aes(x = mean_var), color = "goldenrod", size = 2) + scale_y_continuous(limits = c(0,12)) + scale_x_continuous(limits = c(0, 1)) + labs(x = "변수", y = "빈도수", title = "지수분포에서 표본 50개 추출", subtitle = "지수분포 ~ λ = 12") ``` ] .panel2-rexp-10[ ![](distribution_clt_files/figure-html/rexp_10_01_output-1.png)<!-- --> ] --- count: false ### Exp(12) ~ 관측점 50 개 추출 .panel1-rexp-10[ ```r tibble(var = rexp(50, rate = 12)) %>% ggplot() + aes(x = var) + geom_rug() + geom_histogram(alpha = .15) + clt_theme + geom_rug(data = . %>% summarise(mean_var = mean(var)), mapping = aes(x = mean_var), color = "goldenrod", size = 2) + scale_y_continuous(limits = c(0,12)) + scale_x_continuous(limits = c(0, 1)) + labs(x = "변수", y = "빈도수", title = "지수분포에서 표본 50개 추출", subtitle = "지수분포 ~ λ = 12") ``` ] .panel2-rexp-10[ ![](distribution_clt_files/figure-html/rexp_10_02_output-1.png)<!-- --> ] --- count: false ### Exp(12) ~ 관측점 50 개 추출 .panel1-rexp-10[ ```r tibble(var = rexp(50, rate = 12)) %>% ggplot() + aes(x = var) + geom_rug() + geom_histogram(alpha = .15) + clt_theme + geom_rug(data = . %>% summarise(mean_var = mean(var)), mapping = aes(x = mean_var), color = "goldenrod", size = 2) + scale_y_continuous(limits = c(0,12)) + scale_x_continuous(limits = c(0, 1)) + labs(x = "변수", y = "빈도수", title = "지수분포에서 표본 50개 추출", subtitle = "지수분포 ~ λ = 12") ``` ] .panel2-rexp-10[ ![](distribution_clt_files/figure-html/rexp_10_03_output-1.png)<!-- --> ] --- count: false ### Exp(12) ~ 관측점 50 개 추출 .panel1-rexp-10[ ```r tibble(var = rexp(50, rate = 12)) %>% ggplot() + aes(x = var) + geom_rug() + geom_histogram(alpha = .15) + clt_theme + geom_rug(data = . %>% summarise(mean_var = mean(var)), mapping = aes(x = mean_var), color = "goldenrod", size = 2) + scale_y_continuous(limits = c(0,12)) + scale_x_continuous(limits = c(0, 1)) + labs(x = "변수", y = "빈도수", title = "지수분포에서 표본 50개 추출", subtitle = "지수분포 ~ λ = 12") ``` ] .panel2-rexp-10[ ![](distribution_clt_files/figure-html/rexp_10_04_output-1.png)<!-- --> ] --- count: false ### Exp(12) ~ 관측점 50 개 추출 .panel1-rexp-10[ ```r tibble(var = rexp(50, rate = 12)) %>% ggplot() + aes(x = var) + geom_rug() + geom_histogram(alpha = .15) + clt_theme + geom_rug(data = . %>% summarise(mean_var = mean(var)), mapping = aes(x = mean_var), color = "goldenrod", size = 2) + scale_y_continuous(limits = c(0,12)) + scale_x_continuous(limits = c(0, 1)) + labs(x = "변수", y = "빈도수", title = "지수분포에서 표본 50개 추출", subtitle = "지수분포 ~ λ = 12") ``` ] .panel2-rexp-10[ ![](distribution_clt_files/figure-html/rexp_10_05_output-1.png)<!-- --> ] --- count: false ### Exp(12) ~ 관측점 50 개 추출 .panel1-rexp-10[ ```r tibble(var = rexp(50, rate = 12)) %>% ggplot() + aes(x = var) + geom_rug() + geom_histogram(alpha = .15) + clt_theme + geom_rug(data = . %>% summarise(mean_var = mean(var)), mapping = aes(x = mean_var), color = "goldenrod", size = 2) + scale_y_continuous(limits = c(0,12)) + scale_x_continuous(limits = c(0, 1)) + labs(x = "변수", y = "빈도수", title = "지수분포에서 표본 50개 추출", subtitle = "지수분포 ~ λ = 12") ``` ] .panel2-rexp-10[ ![](distribution_clt_files/figure-html/rexp_10_06_output-1.png)<!-- --> ] --- count: false ### Exp(12) ~ 관측점 50 개 추출 .panel1-rexp-10[ ```r tibble(var = rexp(50, rate = 12)) %>% ggplot() + aes(x = var) + geom_rug() + geom_histogram(alpha = .15) + clt_theme + geom_rug(data = . %>% summarise(mean_var = mean(var)), mapping = aes(x = mean_var), color = "goldenrod", size = 2) + scale_y_continuous(limits = c(0,12)) + scale_x_continuous(limits = c(0, 1)) + labs(x = "변수", y = "빈도수", title = "지수분포에서 표본 50개 추출", subtitle = "지수분포 ~ λ = 12") ``` ] .panel2-rexp-10[ ![](distribution_clt_files/figure-html/rexp_10_07_output-1.png)<!-- --> ] --- count: false ### Exp(12) ~ 관측점 50 개 추출 .panel1-rexp-10[ ```r tibble(var = rexp(50, rate = 12)) %>% ggplot() + aes(x = var) + geom_rug() + geom_histogram(alpha = .15) + clt_theme + geom_rug(data = . %>% summarise(mean_var = mean(var)), mapping = aes(x = mean_var), color = "goldenrod", size = 2) + scale_y_continuous(limits = c(0,12)) + scale_x_continuous(limits = c(0, 1)) + labs(x = "변수", y = "빈도수", title = "지수분포에서 표본 50개 추출", subtitle = "지수분포 ~ λ = 12") ``` ] .panel2-rexp-10[ ![](distribution_clt_files/figure-html/rexp_10_08_output-1.png)<!-- --> ] --- count: false ### Exp(12) ~ 관측점 50 개 추출 .panel1-rexp-10[ ```r tibble(var = rexp(50, rate = 12)) %>% ggplot() + aes(x = var) + geom_rug() + geom_histogram(alpha = .15) + clt_theme + geom_rug(data = . %>% summarise(mean_var = mean(var)), mapping = aes(x = mean_var), color = "goldenrod", size = 2) + scale_y_continuous(limits = c(0,12)) + scale_x_continuous(limits = c(0, 1)) + labs(x = "변수", y = "빈도수", title = "지수분포에서 표본 50개 추출", subtitle = "지수분포 ~ λ = 12") ``` ] .panel2-rexp-10[ ![](distribution_clt_files/figure-html/rexp_10_09_output-1.png)<!-- --> ] --- count: false ### Exp(12) ~ 관측점 50 개 추출 .panel1-rexp-10[ ```r tibble(var = rexp(50, rate = 12)) %>% ggplot() + aes(x = var) + geom_rug() + geom_histogram(alpha = .15) + clt_theme + geom_rug(data = . %>% summarise(mean_var = mean(var)), mapping = aes(x = mean_var), color = "goldenrod", size = 2) + scale_y_continuous(limits = c(0,12)) + scale_x_continuous(limits = c(0, 1)) + labs(x = "변수", y = "빈도수", title = "지수분포에서 표본 50개 추출", subtitle = "지수분포 ~ λ = 12") ``` ] .panel2-rexp-10[ ![](distribution_clt_files/figure-html/rexp_10_10_output-1.png)<!-- --> ] <style> .panel1-rexp-10 { color: black; width: 49%; hight: 32%; float: left; padding-left: 1%; font-size: 80% } .panel2-rexp-10 { color: black; width: 49%; hight: 32%; float: left; padding-left: 1%; font-size: 80% } .panel3-rexp-10 { color: black; width: NA%; hight: 33%; float: left; padding-left: 1%; font-size: 80% } </style> --- count: false ### 표본평균의 분포 ~ 지수분포 .panel1-rexp_sample-1[ ```r tibble(trial = 1:100) %>% crossing(unit_id = 1:50) %>% group_by(trial) %>% mutate(var = rexp(1:50, rate = 12)) %>% summarise(sample_mean = mean(var)) %>% ggplot() + aes(x = sample_mean) + geom_rug(color = "goldenrod", alpha = .2) + geom_histogram(alpha = .6, fill = "goldenrod", aes(y = ..density..) ) + geom_density(color = "grey") + clt_theme + scale_x_continuous(limits = c(0, 0.3)) + labs(x = "표본 평균", y = "밀도(density)", title = "표본평균의 분포") ``` ] .panel2-rexp_sample-1[ ![](distribution_clt_files/figure-html/rexp_sample_1_01_output-1.png)<!-- --> ] <style> .panel1-rexp_sample-1 { color: black; width: 49%; hight: 32%; float: left; padding-left: 1%; font-size: 80% } .panel2-rexp_sample-1 { color: black; width: 49%; hight: 32%; float: left; padding-left: 1%; font-size: 80% } .panel3-rexp_sample-1 { color: black; width: NA%; hight: 33%; float: left; padding-left: 1%; font-size: 80% } </style>