PRISM · Machine Learning PlaygroundPRISM · 머신러닝 놀이터
Often you can compute a distribution's density up to a constant but can't integrate it — so you can't sample directly. Metropolis–Hastings builds a random walk that visits each region in proportion to its probability: propose a nearby move, then accept it with probability min(1, p(x′)/p(x)) — always step uphill, sometimes step down. Over time the walker's footprints are the distribution. Watch the samples fill it in.흔히 분포의 밀도를 상수배까지는 계산할 수 있지만 적분은 못 해 — 직접 표집할 수 없다. 메트로폴리스–헤이스팅스는 각 영역을 그 확률에 비례해 방문하는 무작위 걸음을 만든다: 가까운 이동을 제안하고, 확률 min(1, p(x′)/p(x))로 수락한다 — 언제나 오르막으로, 때로는 내리막으로. 시간이 지나면 걸음꾼의 발자국이 곧 분포다. 표본이 채워지는 것을 보라.
Target distribution목표 분포
The accept rule min(1, p(x′)/p(x)) is chosen so the chain satisfies detailed balance with the target as its stationary distribution. Only the ratio appears, so the unknown normalizing constant cancels — that's why you can sample without ever computing it.수락 규칙 min(1, p(x′)/p(x))은 체인이 목표를 정상분포로 하는 상세 균형을 만족하도록 선택된다. 비율만 나타나므로 미지의 정규화 상수가 소거된다 — 그래서 그것을 계산하지 않고도 표집할 수 있다.
Tiny steps are almost always accepted but explore slowly; huge steps are almost always rejected. The useful regime is in between — theory suggests an acceptance rate around 0.23 for high-dimensional targets. This is the exploration–exploitation tradeoff of sampling.작은 스텝은 거의 항상 수락되지만 탐색이 느리고, 큰 스텝은 거의 항상 기각된다. 유용한 영역은 그 사이다 — 이론은 고차원 목표에서 수락률 0.23 근처를 제안한다. 표집의 탐험–활용 절충이다.
MCMC is how Bayesian inference is done in practice — drawing from posteriors over model parameters when they have no closed form. In biomedicine it powers uncertainty-aware modeling of clinical data, pharmacokinetics, and phylogenetics, wherever you need the full posterior, not just a point estimate.MCMC는 실전에서 베이지안 추론을 수행하는 방법이다 — 닫힌 형태가 없는 모델 매개변수의 사후분포에서 표집한다. 생의학에서는 임상 데이터의 불확실성 인식 모델링, 약동학, 계통발생학 등 점 추정이 아니라 완전한 사후분포가 필요한 곳을 뒷받침한다.