+ - 0:00:00
Notes for current slide
Notes for next slide

기초통계


통계에 대한 다양한 기본지식을 학습합니다.

이광춘

2022년 12월 27일

1 / 6

강의 개요


4차 산업혁명은 디지털 전환(Digital Transformation) 이라는 용어로 대체되고 있으며 전세계가 디지털 전환을 통해 새로운 도약을 준비하고 있다.

이를 위해서 디지털 전환을 떠받치고 있는 데이터 과학을 심도 깊이 다루기 전에 그 기반기술을 차례차례 살펴보자.

데이터 과학을 구성하는 통계학과 기계학습이 큰 축으로 볼 수 있다.

1. 통계학

     1.1. 중심극한정리

2. 마무리

2 / 6

중심극한정리

직관적 설명

동일한 확률분포를 가진 독립 확률 변수로부터 추출한 n개 평균 분포는 n이 적당히 크다면 정규분포에 가까워진다는 정리이다. 특히 동일한 확률분포가 정규분포가 아니더라도 관계없이 평균의 분포는 정규분포를 따른다.

수식

린데베르그–레비 중심극한정리(Lindeberg–Lévy central limit theorem)에 따르면, 같은 분포를 가지는 독립 확률 변수에 대해 다룬다. 이 정리는 다음과 같다. 만약 확률 변수 X1,X2,X1,X2,들이

  • 서로 독립적이고,
  • 같은 확률 분포를 가지고,
  • 그 확률 분포의 기댓값 μμσσ가 유한하다면,

평균 Sn=(X1++Xn)nSn=(X1++Xn)n의 분포는 기댓값 μμ와 표준편차 σnσnN(μ,σ2n)N(μ,σ2n)에 분포수렴한다. 즉, 다음이 성립한다.

n(ni=1Xinμ) d N(0,σ2)n(ni=1Xinμ) d N(0,σ2)

함의

모집단에서 추출한 표본으로부터 모집단의 평균 μμ추정(estimation)하는데 유용하고, 이를 통해서 추정값이 모평균과 얼마나 차이가 날지 대략적인 정보도 얻을 수 있다.

3 / 6

구현

library(tidyverse)
# options(gganimate.nframes = 400, scipen = 10)
## 설정 --------------
n <- 70 # number of ball bearnings
stop_level <- 10 # number of perturbation levels
# make it an even number
levels <- 44 # greater than stop_levels
## 데이터셋 -----------
set.seed(2019)
ball_bearings <- crossing(unit_id = 1:n,
level = 1:levels - 1) %>%
mutate(perturbation = # moves
sample(c(-1,1), # left or right
n(), # each ball at each level
replace = T)) %>%
group_by(unit_id) %>% # operations on each ball
mutate(perturbation =
ifelse(row_number() == 1,
yes = 0, # start centered
no = perturbation)) %>%
# each ball should release one at a time
mutate(time = # displacing them in time w/
row_number() +
# using unit id
unit_id * 3 - 1) %>%
filter(time > 0) %>%
mutate(x_position = # we get the x position
# by summing the cumulative distributions
cumsum(perturbation)) %>%
# if ball is beyond the perturbation levels
mutate(x_position = # we overwrite the x position
ifelse(level <= stop_level,
yes = x_position,
no = NA)) %>%
# then fill in with the last x position
fill(x_position) %>%
ungroup()
## 최종 관측점----------
ball_bearings %>%
filter(level == (levels - 1) ) %>%
rename(final_time = time) %>%
crossing(time = as.numeric(1:max(ball_bearings$time))) %>%
group_by(time, x_position) %>%
summarise(x_position_count = sum(time > final_time)) ->
ball_bearings_collect
## 갤톤 상자
pegs <- crossing(unit_id = -stop_level:stop_level,
level = 1:stop_level) %>%
mutate(transparent =
(unit_id + level) %% 2)
# Lets make walls
walls <- crossing(unit_id =
-(stop_level + 1):(stop_level + 1),
level = stop_level:levels) %>%
mutate(transparent =
unit_id %% 2)
ball_bearings_size <- 2
peg_size <- 3
## 정적 그래프
galton_static <- ggplot(ball_bearings) +
aes(y = level) +
aes(x = x_position) +
scale_y_reverse() +
aes(group = unit_id) +
geom_point(data = walls,
aes(x = unit_id, alpha = transparent),
col = "grey30", size = peg_size) +
geom_point(data = pegs,
aes(x = unit_id, alpha = transparent),
col = "grey30", size = peg_size) +
geom_segment(x = -sqrt(n), xend = -1.5,
y = 0, yend = 0) +
geom_segment(x = sqrt(n), xend = 1.5,
y = 0, yend = 0) +
geom_abline(intercept = 1.5,
slope = -1) +
geom_abline(intercept = 1.5,
slope = 1) +
annotate(geom = "tile",
height = 2, width = 2,
x = 0 , y = -1.5) +
annotate(geom = "tile",
height = 2, width = 1.75,
x = 0 , y = -1.5, fill = "white") +
geom_rect(data = ball_bearings_collect,
mapping = aes(xmin = x_position - .35,
xmax = x_position + .35,
ymax = max(ball_bearings$level) + 1 - x_position_count*1.5,
ymin = max(ball_bearings$level) + 1,
group = x_position,
y = NULL, x = NULL),
fill = "darkgrey") +
geom_point(size = ball_bearings_size,
col = "steelblue") +
coord_equal() +
geom_hline(yintercept = stop_level,
linetype = "dotted") +
scale_alpha_continuous(range = c(0, 1), guide = F) +
theme_void()
# galton_static
## 애니메이션
# galton_static +
# gganimate::transition_time(time = time) +
# gganimate::shadow_wake(wake_length = .05) +
# gganimate::ease_aes("bounce-in-out") #BREAK

]

5 / 6

경청해 주셔서
감사합니다.


6 / 6

강의 개요


4차 산업혁명은 디지털 전환(Digital Transformation) 이라는 용어로 대체되고 있으며 전세계가 디지털 전환을 통해 새로운 도약을 준비하고 있다.

이를 위해서 디지털 전환을 떠받치고 있는 데이터 과학을 심도 깊이 다루기 전에 그 기반기술을 차례차례 살펴보자.

데이터 과학을 구성하는 통계학과 기계학습이 큰 축으로 볼 수 있다.

1. 통계학

     1.1. 중심극한정리

2. 마무리

2 / 6
Paused

Help

Keyboard shortcuts

, , Pg Up, k Go to previous slide
, , Pg Dn, Space, j Go to next slide
Home Go to first slide
End Go to last slide
Number + Return Go to specific slide
b / m / f Toggle blackout / mirrored / fullscreen mode
c Clone slideshow
p Toggle presenter mode
t Restart the presentation timer
?, h Toggle this help
Esc Back to slideshow