로지스틱 분포

Python의 statsmodels로 배우는 중급 회귀

Maarten Van den Broeck

Content Developer at DataCamp

가우시안 확률밀도함수(PDF)

from scipy.stats import norm

x = np.arange(-4, 4.05, 0.05)

gauss_dist = pd.DataFrame({
  "x": x,
  "gauss_pdf": norm.pdf(x)}
)
sns.lineplot(x="x",
             y="gauss_pdf",
             data=gauss_dist)

정규 분포 확률밀도함수

Python의 statsmodels로 배우는 중급 회귀

가우시안 누적분포함수(CDF)

x = np.arange(-4, 4.05, 0.05)

gauss_dist = pd.DataFrame({
  "x": x,
   "gauss_pdf": norm.pdf(x),
   "gauss_cdf": norm.cdf(x)}
)
sns.lineplot(x="x",
             y="gauss_cdf",
             data=gauss_dist)

정규 분포 누적분포함수

Python의 statsmodels로 배우는 중급 회귀

가우시안 누적분포함수(CDF)

x = np.arange(-4, 4.05, 0.05)

gauss_dist = pd.DataFrame({
  "x": x,
   "gauss_pdf": norm.pdf(x),
   "gauss_cdf": norm.cdf(x)}
)
sns.lineplot(x="x",
             y="gauss_cdf",
             data=gauss_dist)

정규 분포 누적분포함수, x = 1에서 수직선 포함

Python의 statsmodels로 배우는 중급 회귀

가우시안 역 CDF

p = np.arange(0.001, 1, 0.001)

gauss_dist_inv = pd.DataFrame({
  "p": p,
  "gauss_inv_cdf": norm.ppf(p)}
)
sns.lineplot(x="p",
             y="gauss_inv_cdf",
             data=gauss_dist_inv)

정규 분포 역누적분포함수

Python의 statsmodels로 배우는 중급 회귀

로지스틱 PDF

from scipy.stats import logistic

x = np.arange(-4, 4.05, 0.05)

logistic_dist = pd.DataFrame({
  "x": x,
  "log_pdf": logistic.pdf(x)}
)
sns.lineplot(x="x",
             y="log_pdf",
             data=logistic_dist)

로지스틱 확률밀도함수

Python의 statsmodels로 배우는 중급 회귀

로지스틱 분포

  • 로지스틱 분포의 CDF는 ‘로지스틱 함수’라고도 합니다.
  • $\text{cdf}(x) = \frac{1}{(1 + exp(-x))}$

  • 로지스틱 분포의 역 CDF는 ‘로짓 함수’라고도 합니다.

  • $\text{inverse\_cdf}(p) = log(\frac{p}{(1 - p)})$
Python의 statsmodels로 배우는 중급 회귀

연습해 봅시다!

Python의 statsmodels로 배우는 중급 회귀

Preparing Video For Download...