Home

Logistic Regression

Prerequisites To understand the content of this post, it is recommended that you have knowledge of the following: Gradient Descent Linear Regression (Optimization Perspective) From Regression to Classification… The data used in the Linear Regression (Optimization Perspective) post had continuous label values (i.e., the number of car ac...

Read more

로지스틱 회귀

Prerequisites 본 포스팅의 내용에 대해 이해하기 위해선 아래의 내용에 대해 알고 오시는 것이 좋습니다. 경사하강법 선형회귀 (최적화 관점) 회귀에서 분류로… 선형회귀 (최적화 관점) 편에서 확인한 데이터들은 라벨 값(즉, 아래의 그림 1에서 사고 발생 건수)이 연속적인 것이었다. 그림 1. 선형회귀 모델 구축 시 이용한 연속적 라벨을 가지는 데이터 하지만 어떤 경우에는 다음과 같이 라벨이 범주형일 수도 있다. 라벨이 범주형이라는 것은 가령 “남자, 여자” 혹은 “강아지, 고양이” 등의 연속적인 숫자로 나타내기 어려운 데이터들을 얘기하고 보통 0 혹은 1로 숫자로 치...

Read more

Deriving Euler's Formula with Differential Equation

Let’s consider an arbitrary complex number $x+iy$. Here, let’s assume that $x$ and $y$ are real numbers. This value can also be expressed using polar coordinates as follows: If the distance from the origin to $x,y$ is $r$ and the angle between the $x$-axis and the point is $\theta$, then \[x+iy = r\cos(\theta) + i r\sin(\theta)\] F...

Read more

미분방정식을 이용한 오일러 공식 유도

임의의 복소수 $x+iy$를 생각해보자. 여기서 $x$와 $y$는 실수라고 하자. 이 값은 극좌표계를 이용해 표현하면 다음과 같이 표현할 수도 있다. 원점에서 $x, y$까지의 거리가 $r$이고 $x$축과 이루는 각도가 $\theta$라고 했을 때, \[x+iy = r\cos(\theta) + i r\sin(\theta)\] 이다. 그림 1. 복소평면 상의 점 하나는 복소수 하나를 표현한다. 여기서 $r=1$인 경우를 상정해 이 값을 $z$라고 하도록 하자. \[z = \cos(\theta) + i \sin(\theta)\] 이 $z$라는 값은 반지름이 1인 단위 원 상의 점이 된...

Read more

Markov Chain Monte Carlo

Interactive MCMC JS Applet by Chi-Feng, Source Code Prerequisites To understand this post well, it is recommended to know the following: Rejection Sampling The Meaning of Likelihood Definition of MCMC According to Wikipedia, Markov Chain Monte Carlo (MCMC) is “an algorithm for sampling from a probability distribution based on constru...

Read more

Markov Chain Monte Carlo

Interactive MCMC JS Applet by Chi-Feng, 소스코드 prerequisites 이 포스팅에 대해 잘 이해하기 위해선 다음의 내용에 대해 알고 오시는 것이 좋습니다. Rejection Sampling likelihood의 의미 MCMC의 정의 위키피디아에 따르면 마르코프 연쇄 몬테카를로 방법(Markov Chain Monte Carlo, MCMC)은 “마르코프 연쇄의 구성에 기반한 확률 분포로부터 원하는 분포의 정적 분포를 갖는 표본을 추출하는 알고리즘의 한 분류이다.”라고 나와있다. 복잡해보이지만 우선 MCMC는 샘플링 방법 중 하나인 것이라는 것만 알고있도록 하...

Read more

Rejection Sampling

Sampling from Probability Distributions Samples from a uniform or normal distribution can be easily generated with just one line of code using a computer. For instance, in MATLAB, one can use the following code: uniform_sample = rand(1,1) normal_sample = randn(1,1) However, how can we extract random samples from a probability density functi...

Read more

Rejection Sampling

확률 분포로부터 샘플 추출 uniform distribution이나 정규분포의 샘플은 컴퓨터를 이용하면 코드 한 줄이면 추출할 수 있다. MATLAB의 경우는 아래와 같은 코드를 이용할 수 있다. uniform_sample = rand(1,1) normal_sample = randn(1,1) 그런데, 임의의 수식을 가진 확률밀도함수로부터 랜덤한 샘플을 추출하려면 어떻게 해야할까? Rejection Sampling 대략적인 수식을 알고 있는 어떤 확률밀도함수가 있다고 하자. 가령 아래와 같은 함수 $f(x)$를 생각해볼 수 있다. \[f(x) = 0.3\exp\left(-0.2x^2\right) +...

Read more