우도·최대우도·베이지안 추론Likelihood, maximum likelihood and Bayesian inference
고정 자료의 모수 비교에서 사전·사후·미래 예측까지 차근차근 연결하기From parameter comparisons at fixed observations to priors, posteriors and future prediction
실습 6종 · 풀이 포함 연습문제 60개6 labs · 60 exercises with solutions
기초Foundations
1. 자료를 고정한 뒤 어느 설명이 더 잘 맞는지 묻는다1. Hold observations fixed and compare their parameter explanations
어떤 장치에서 1이 나올 비율 p를 모른다고 합시다. 네 번 관측해 (1, 0, 0, 0)을 얻었습니다. p=1/4인 장치와 p=3/4인 장치 중 어느 쪽이 이 기록을 더 잘 설명할까요? 여기서는 기록을 바꾸지 않고 설명 모수 p를 바꿉니다.
우도는 이 비교를 수식으로 만든 것입니다. 우도가 큰 모수가 실제로 그만큼의 확률로 참이라는 뜻은 아닙니다. 사후확률을 말하려면 후보 모수에 어떤 사전 확률을 두었는지도 필요합니다. 그다음 미래 관측을 예측할 때는 모수의 사후 불확실성도 평균해야 합니다.
A device has an unknown probability p of producing one. Four observations give (1, 0, 0, 0). Which parameter, p=1/4 or p=3/4, better explains this fixed record? We vary the parameter rather than the observations.
Likelihood formalizes that comparison. A larger likelihood is not the probability that its parameter is true. Posterior probabilities additionally require a prior; future prediction also averages remaining parameter uncertainty.
기초Foundations
2. 표집분포와 우도는 같은 식을 다른 방향으로 읽는다2. Sampling distributions and likelihood read a formula in different directions
모수 θ를 정해 두고 자료 x가 어떻게 나오는지 보면 확률질량 또는 밀도 fθ(x)입니다. 관측 x를 고정하고 θ를 움직이면 우도 L(θ;x)=fθ(x)입니다. 원자료의 의존을 포함한 결합법칙을 먼저 정해야 하며, 독립인 경우에만 개별 항의 곱으로 바로 쓸 수 있습니다.
x varies,θ fixed:θ varies,x fixed:fθ(x),L(θ;x).
자료 공간에서 합이나 적분이 1인 법칙이라도, 모수 공간의 우도 합이나 적분이 1일 필요는 없습니다. 우도 곡선의 높이를 모수의 확률 막대로 읽지 않습니다.
Fix θ and vary x to obtain its sampling mass or density fθ(x). Fix observed x and vary θ to obtain L(θ; x). Specify a joint observation model first; factoring into individual contributions requires the appropriate independence assumptions.
x varies,θ fixed:θ varies,x fixed:fθ(x),L(θ;x).
Normalization over possible observations does not imply normalization over parameter values. Likelihood heights are not parameter probability bars.
기초Foundations
3. 질량·밀도·우도·사후는 서로 다른 양이다3. Mass, density, likelihood and posterior are different quantities
이산 자료에서는 한 고정 기록의 우도가 그 기록의 확률일 수 있습니다. 연속 자료에서는 보통 밀도값이므로 정확한 한 점의 확률과 다릅니다. 밀도는 1보다 클 수 있고 단위를 바꾸면 높이도 바뀝니다.
예를 들어 N(μ, 0.01)에서 μ와 같은 값의 밀도는 약 3.9894입니다. 그 점 자체의 확률은 0입니다. 어떤 구간의 확률은 밀도를 적분해 구합니다. 이 구별을 모수의 연속 사후밀도에도 그대로 유지합니다.
사후는 자료를 본 뒤 정한 모수의 조건부 분포입니다. 빈도주의 모수의 고정 역할과 베이지안 모형 안 모수의 확률 역할을 구별하되, 둘이 같은 용어를 쓴다고 계산 대상을 섞지 않습니다.
For discrete data, a fixed-record likelihood can be that record’s probability. For continuous data it is typically a density, not the probability of an exact point. Density can exceed one and changes height with units.
A N(μ, .01) density at μ is about 3.9894, yet the point has probability zero. Interval probability requires integration. Keep this distinction for continuous posterior densities as well.
A posterior is a conditional parameter distribution after data. Distinguish fixed-parameter sampling roles from parameter uncertainty inside a Bayesian model.
기초Foundations
4. 독립 Bernoulli 기록의 우도를 곱으로 만든다4. Build an ordered Bernoulli likelihood from independent observations
조건부로 각 Xᵢ가 같은 p의 독립 Bernoulli라고 가정합니다. 관측은 0 또는 1이고, 1의 수가 k입니다. 각 1은 p를, 각 0은 1−p를 곱합니다.
L_o denotes the ordered binary-data likelihood; f_p is the probability mass function of one binary observation.
Record (1, 0, 0, 0) gives p(1−p)³. Another ordering has the same likelihood but is a different observed event. For n=0, the empty product is one: all parameters fit equally and no unique value is identified.
기초Foundations
5. 성공 수만 기록하면 조합계수가 붙는다5. Recording only the success count adds a combinatorial factor
정확한 순서 기록 대신 성공 수 k만 관측했다면, 그 수를 만드는 C(n, k)개 순서열의 확률을 더합니다. 고정 n, k에서 조합계수는 p에 의존하지 않습니다.
When the denominator is positive, the maximum and relative likelihood agree. The same constant cancels in posterior normalization within this fixed model. Do not assume cancellation across different observation spaces or model comparisons.
기초Foundations
6. 세 후보를 손으로 비교하되 사후라고 부르지 않는다6. Compare three hypotheses by hand without calling likelihood a posterior
고정 기록 (1, 0, 0, 0)에 후보 p=1/4, 1/2, 3/4를 넣으면 우도는 각각 27/256, 16/256, 3/256입니다. 첫 후보가 둘째보다 27/16배 잘 맞는 상대우도를 가집니다.
이 세 우도의 합은 46/256이라 1이 아닙니다. 나중에 세 후보에 같은 사전 질량을 명시하면 정규화한 (27/46, 16/46, 3/46)이 사후가 됩니다. 사전 없이 우도만 정규화하는 행위에는 ‘이 세 후보의 균등 사전’이라는 가정을 덧붙인 셈입니다.
For fixed (1, 0, 0, 0), candidate p values 1/4, 1/2, 3/4 give likelihoods 27/256, 16/256, 3/256. The first has relative likelihood 27/16 against the second.
Their sum is not one. A declared equal-mass prior on these three candidates yields posterior (27/46, 16/46, 3/46). Normalizing only these likelihoods implicitly adds that finite uniform-prior assumption.
기초Foundations
7. 로그는 곱을 합으로 바꾸고 작은 우도를 보존한다7. Logs turn products into sums and preserve small likelihoods
우도가 양수인 곳에서 자연로그는 증가함수라 최대점을 바꾸지 않습니다. 작은 확률을 수천 번 곱하면 일반 화면 표시가 0으로 내려갈 수 있지만 로그는 유한할 수 있습니다.
ℓ(p)=logL(p)=klogp+(n−k)log(1−p).
경계 p=0, 1에서 실제 불가능한 기록은 우도가 정확히 0이고 로그는 −∞로 확장해 읽습니다. 양의 우도가 표시 한계로 0인 경우와 다릅니다. 관측된 적 없는 종류의 항은 곱에 없으므로, 경계의 0·log0 표기를 기계적으로 계산하지 말고 원곱의 극한·빈 항 관례를 확인합니다.
On positive likelihoods, the natural log is increasing and preserves maximizers. Thousands of probability factors may underflow on screen while log likelihood remains finite.
ℓ(p)=logL(p)=klogp+(n−k)log(1−p).
An actually impossible endpoint observation has exact likelihood zero and extended log −∞. That differs from a positive likelihood displaying zero. An unobserved outcome type contributes no factor; handle endpoint absent terms through the original product rather than blindly computing 0·log0.
기초Foundations
8. 최대우도 추정은 선언한 모수공간에서의 최대다8. Maximum likelihood maximizes over the declared parameter space
MLE는 관측 우도를 가장 크게 만드는 허용 모수를 고릅니다. 존재하는지, 유일한지, 경계에 놓이는지를 따로 확인합니다. 최대값이 없이 상한에만 접근하는 경우도 있습니다.
θML∈θ∈ΘargmaxL(θ;x).
후보가 세 개뿐인 이산 공간과 p∈[0, 1]의 연속 공간은 다른 최적화입니다. 한 모형의 최고 우도라는 사실은 그 모형이 현실의 참 모형이라는 증명이 아닙니다. 불편성·일치성·효율도 각각 별도 성질입니다.
MLE chooses permitted parameters maximizing the observed likelihood. Existence, uniqueness and boundary location are separate questions; some likelihoods approach a supremum without attaining it.
θML∈θ∈ΘargmaxL(θ;x).
A three-hypothesis candidate space differs from a continuous [0, 1] space. The best fit within a model does not establish that model’s truth. Unbiasedness, consistency and efficiency are also separate properties.
학부 연결 · 선택Undergraduate bridge · optional
9. 안쪽 최대는 미분과 오목성으로 확인한다9. Use derivatives and concavity for an interior Bernoulli maximum
n≥1이고 0<k<n이라고 합시다. 0<p<1에서 로그우도를 미분합니다. 첫 미분을 0으로 놓으면 p=k/n이고 둘째 미분은 음수입니다.
Endpoint likelihoods are zero and interior ones positive, so this is the unique global maximum. We checked curvature and boundaries rather than relying only on a stationary point. Sampling accuracy is another question.
기초Foundations
10. 모두 0·모두 1·빈 표본은 따로 읽는다10. Handle all zeros, all ones and empty data separately
n>0, k=0이면 L(p)=(1−p)ⁿ으로 감소합니다. 닫힌 공간 [0, 1]에서는 p=0이 최대입니다. 열린 공간 (0, 1)에서는 p를 0으로 보내 우도가 1에 접근하지만, 그 최대를 얻는 허용 p는 없습니다. k=n이면 p=1 쪽에서 같은 구별이 생깁니다.
n=0에서는 모든 허용 모수에서 우도가 1입니다. 최대점이 없는 것이 아니라 모든 모수가 최대여서 유일하지 않습니다. ‘빈 자료의 추정값은 0’ 같은 임의 숫자를 내놓지 않습니다. 이 세 경계는 뒤의 사전 갱신과 예측에서도 그대로 남습니다.
For n>0, k=0, the likelihood (1−p)ⁿ decreases. Closed [0, 1] attains its maximum at zero; open (0, 1) only approaches supremum one as p→0. All ones give the corresponding issue at one.
Empty data have likelihood one at every permitted parameter. A maximum exists everywhere but is not unique. Do not invent a zero estimate for no data. These distinctions persist through Bayesian updating and prediction.
기초Foundations
11. 실습 A · 순서·개수·상대우도와 경계를 비교한다11. Lab A · Compare ordered, count and relative likelihoods with boundaries
n, k와 고정 후보 p를 입력하고 닫힌 공간·열린 공간을 선택합니다. 순서 우도, 개수 우도, 최대 우도로 나눈 상대우도를 구분하세요. 그래프는 로그식으로 그린 근사 상대우도이고 선택 p의 표는 정확 분수 계산입니다.
최고 높이가 1인 그래프는 모수 확률이 1이라는 뜻도, 곡선 아래 면적이 1이라는 뜻도 아닙니다. n=0, k=0, k=n을 바꾸어 최대점 상태를 읽고, 열린 공간 밖인 p=0, 1의 입력 오류를 수학적 불가능 관측이나 표시 underflow와 구별합니다.
Choose n, k, probe p and a closed or open parameter space. Separate ordered, count and maximum-relative likelihoods. The curve uses approximate log arithmetic; the selected-probe table uses exact fractions.
A curve peaking at one is neither a parameter probability of one nor a normalized area. Explore empty/all-zero/all-one cases. An endpoint probe outside the chosen open space is an input-range error, not an impossible observation or display underflow.
학부 연결 · 선택Undergraduate bridge · optional
12. 같은 관측법칙이면 모수 이름을 구별할 수 없다12. Parameters producing the same observation law are not identified
Bernoulli 성공 확률을 p=θ², θ∈[−1, 1]로 표현하면 θ와 −θ는 같은 관측법칙을 줍니다. 0<k<n의 자료에서 θ의 최대점은 ±√(k/n) 두 개입니다. 큰 n이나 좋은 최적화 도구가 부호 정보를 새로 만들지는 않습니다.
한편 p 자체는 Bernoulli 법칙에서 식별됩니다. 모수화와 허용 공간이 중요합니다. 일대일 재표현 η=g(θ)에서는 존재하는 MLE를 g로 옮길 수 있지만, 사후밀도의 MAP를 바꿀 때는 야코비안이 들어간다는 다른 문제를 뒤에서 다룹니다.
Parameterizing Bernoulli success as p=θ² for θ∈[−1, 1] makes θ and −θ observationally identical. For 0< k< n, the θ maximizers are ±√(k/n). More data or a better optimizer cannot create sign information.
The parameter p itself is identified in a Bernoulli model. Parameterization and restrictions matter. An existing MLE transfers through a bijective reparameterization; posterior-density MAP transformation additionally involves a Jacobian, as discussed later.
기초Foundations
13. 정규 우도는 관측값의 밀도를 곱한다13. A Gaussian likelihood multiplies observation densities
가용 관측 x₁, …, xₙ이 iid N(μ, v), v>0를 따른다고 가정합니다. v는 분산 σ²이며 표준편차가 아닙니다. 밀도를 곱하고 로그를 취하면 다음 식입니다.
ℓ(μ,v)=−2nlog(2π)−2nlogv−2v1i∑(xi−μ)2.
이는 실제값이 정규·독립이라는 검증이 아니라 선택한 작업 모형입니다. 로그임금처럼 가용 조건에 따라 남은 자료라면 그 분석 대상을 먼저 밝혀야 합니다. 우도가 크다고 미관측 집단의 분포까지 알게 된 것은 아닙니다.
Assume available x₁, …, xₙ are iid N(μ, v), v>0. Here v is variance, not standard deviation. Multiplying densities and taking logs gives the displayed expression.
ℓ(μ,v)=−2nlog(2π)−2nlogv−2v1i∑(xi−μ)2.
This specifies a working model rather than verifying actual normality or independence. State the available-record target before analyzing selected log wages. A high likelihood does not identify unobserved groups.
기초Foundations
14. 평균을 움직이는 일은 제곱손실과 연결된다14. Moving the Gaussian mean connects to squared loss
가상 (1, 2, 4)는 x̄=7/3이고 중심 제곱합은 14/3입니다. μ=2에서는 S=5입니다. μ를 평균으로 옮기면 제곱합이 1/3 줄고, v=1이면 로그우도는 그 절반 1/6 늘어납니다. 수리기초의 완전제곱과 STAT15 최소제곱이 같은 대수 구조를 공유합니다.
For n≥1, expand around the sample mean. The cross term vanishes, so maximizing likelihood over μ at fixed variance minimizes squared error.
S(μ)S(μ)=i∑(xi−μ)2,=i∑(xi−x)2+n(μ−x)2.
For hypothetical (1, 2, 4), the mean is 7/3, centered SSE is 14/3, and S(2)=5. At v=1, moving to the mean raises log likelihood by 1/6. Completing the square links this to the earlier least-squares chapters.
학부 연결 · 선택Undergraduate bridge · optional
15. 정규 평균의 최대는 표본평균에 놓인다15. The Gaussian mean maximum occurs at the sample mean
n≥1과 고정 v>0에서 S(μ)는 μ=x̄에서 유일한 최소입니다. 따라서 μ의 우도 최대도 x̄입니다. 미분으로는 score가 n(x̄−μ)/v이고 둘째 미분이 −n/v입니다.
∂μ∂ℓ∂μ2∂2ℓ=vn(x−μ),=−n/v<0.
자료가 모두 같은 값이어도 v가 알려져 고정돼 있다면 평균 최대는 여전히 그 값입니다. 문제가 생기는 것은 다음 절에서 분산까지 자유롭게 줄이는 공동 최대입니다. 어떤 모수를 고정했고 어떤 모수를 최적화했는지 명시하세요.
For n≥1 and fixed positive v, the unique mean maximizer is x̄. The score is n(x̄−μ)/v and curvature −n/v.
∂μ∂ℓ∂μ2∂2ℓ=n(x−μ)/v,=−n/v<0.
Constant observations still have a mean maximum when variance is fixed. The next section’s boundary problem arises when variance is optimized jointly. State which parameters are fixed or free.
학부 연결 · 선택Undergraduate bridge · optional
16. 분산 MLE의 n 분모를 유도한다16. Derive the n denominator in Gaussian variance MLE
중심 제곱합 S₀=Σ(xᵢ−x̄)²>0라고 합시다. 평균을 x̄로 정한 프로파일 로그우도를 v>0에서 미분합니다.
The derivative changes from positive to negative and log likelihood falls to −∞ at both boundaries. This is a global maximum, distinct from S²=S₀/(n−1). Under iid finite variance, E[S₀/n]=(n−1) v/n; maximum likelihood need not be unbiased.
기초Foundations
17. 모든 값이 같으면 양의 분산 모형의 공동 최대가 없다17. Constant observations have no joint maximum in the positive-variance model
n≥1이고 모든 xᵢ=c이면 μ=c에서 S₀=0입니다. 로그우도는 C−(n/2)logv로 v↓0일 때 무한히 커집니다. v>0 모형 안에서 유한 최대는 없습니다.
산술적으로 S₀/n=0을 계산할 수 있다는 사실과 v=0이 허용된 정규밀도 모형의 MLE라는 주장은 다릅니다. 분산 0의 점질량을 추가하면 관측 모형과 기준 측도에 관한 별도 처리가 필요합니다. 빈 표본 n=0은 모든 (μ, v>0)의 우도가 1인 다른 경계입니다.
For n≥1 and every xᵢ=c, set μ=c. Centered SSE is zero and log likelihood C−(n/2) logv grows without bound as v↓0. No finite joint maximum exists within v>0.
Computing S₀/n=0 is not the same as an allowed zero-variance MLE in a positive-variance density model. Adding degenerate point masses changes the observation-model treatment. Empty n=0 is different: every permitted pair has likelihood one.
기초Foundations
18. 실습 B · 평균·두 분산·최대 존재를 구별한다18. Lab B · Distinguish means, two variance formulas and maximum existence
가상 수치와 null 결측을 입력하고 후보 μ와 양의 분산 v를 바꿉니다. 가용 수 n, 중심 제곱합, S₀/n, S₀/(n−1), 선택 후보의 밀도 우도를 읽습니다. 가용값 하나·모두 같은 값·빈 배열을 비교하세요.
정규 밀도 우도는 확률이 아니므로 1보다 클 수 있습니다. 유한 로그가 화면 범위를 넘는 경우, 우도 자체의 표시 underflow, 상수 자료의 수학적 비유계 최대 문제를 구별합니다. 실제 가용 로그임금 사례에서도 같은 수식이 적용되지만 모형 타당성이 자동 검증되지는 않습니다.
Enter hypothetical values with null missingness and vary μ and strictly positive variance v. Read n, centered SSE, the n and n−1 divisions, and the selected density likelihood. Compare one value, constant data and an empty array.
A Gaussian density likelihood can exceed one. Separate display underflow, finite log values outside display range, and mathematical unboundedness for constant data. The same formulas on actual available logs do not verify their field assumptions.
기초Foundations
19. 사전분포는 모수에 놓은 추가 가정이다19. A prior distribution is an additional assumption on parameters
이제 모수의 불확실성을 확률분포로 표현합니다. 이산 후보 θⱼ에 사전 질량 wⱼ≥0, Σwⱼ=1을 놓고, 그 θ가 주어졌을 때 자료가 어떻게 생성되는지 우도 모형을 정합니다. 현재 이진자료처럼 x가 이산이면 사전과 우도의 곱은 다음 결합질량입니다.
P(Θ=θj,X=x)=wjL(θj;x).
이산 우도에서는 위 식이 결합질량이고, 연속 자료이면 x에 대한 밀도 표현입니다. 사전은 추가로 관측한 표본이 아닙니다. 과거 지식·설계·모형 선택에 근거를 두고, 실제 새 자료와 구별해 공개합니다.
Represent parameter uncertainty using a distribution. For discrete candidates assign nonnegative prior masses wⱼ summing to one, then specify the conditional observation law. For discrete x, such as our binary records, the product below is joint mass.
P(Θ=θj,X=x)=wjL(θj;x).
This is joint mass for discrete data; with continuous observations use a density in x instead. A prior is not another observed sample. Disclose its basis and distinguish it from newly collected evidence.
기초Foundations
20. 세 후보의 우도에 사전 질량을 곱한다20. Multiply three candidate likelihoods by prior masses
고정 (1, 0, 0, 0)과 후보 (1/4, 1/2, 3/4)를 다시 봅니다. 사전이 각각 1/3이면 우도×사전은 (27, 16, 3)/768입니다. 합은 46/768이고 각 항을 이 합으로 나눕니다.
Changing only the prior to (1/2, 1/3, 1/6) gives products (81, 32, 3)/1536 and posterior (81, 32, 3)/116. The same evidence can give different posteriors under different assumptions. That change is not additional observed data.
기초Foundations
21. 사후에는 양의 유한 정규화 상수가 필요하다21. A posterior requires a positive finite normalizer
이산 후보의 사후는 각 사전×우도를 그 합 Z(x)로 나눕니다. 이 이진 기록 모형에서 Z는 사전예측 자료 확률입니다. 연속 자료의 Z는 밀도일 수 있어 1보다 클 수 있습니다.
Z=0이면 양의 사전 질량을 둔 모든 후보에서 그 증거가 불가능하므로, 모든 사후를 0으로 채우지 않습니다. 그 조건부 갱신은 미정의입니다. 사전 가중치 총합 0도 확률 사전을 만들지 못하는 다른 입력 문제입니다.
Divide each prior-times-likelihood term by its sum Z(x). In our discrete binary-record model, Z is prior-predictive evidence probability. For continuous data it can instead be a density exceeding one.
Zero evidence makes this posterior undefined, not zero for every hypothesis. Zero total prior weight is another failure: it does not define a probability prior.
기초Foundations
22. 실습 C · 비정규화 열에서 사후 막대까지 따라간다22. Lab C · Follow unnormalized products into posterior masses
후보 p와 비음수 사전 가중치를 입력합니다. 가중치를 합 1로 정규화한 사전, 각 순서 우도, 곱, 정규화 합, 사후를 한 행씩 읽으세요. 후보 집합은 명시한 유한 모형이며, 별도로 선언하지 않은 연속 사전을 수치 적분한 것으로 해석하지 않습니다.
사전이 0인 후보, 불가능한 관측, 빈 자료를 비교합니다. 빈 자료에서는 우도 1이라 적절히 정규화된 사전이 그대로 사후입니다. 사후평균과 다음 한 번 예측 확률은 연결되지만, 다음 두 번 예측은 평균을 제곱하는 것과 달라질 수 있습니다.
Enter candidate probabilities and nonnegative prior weights. Follow normalized prior, ordered likelihood, product, evidence and posterior row by row. A finite candidate prior is not quadrature for an unstated continuous distribution.
Compare zero-prior candidates, impossible evidence and empty data. With no data, the proper normalized prior remains unchanged. The posterior mean gives next-one success probability; next-two prediction need not equal its square.
기초Foundations
23. 순차 갱신은 같은 증거를 두 번 쓰는 것이 아니다23. Sequential updating is not using the same evidence twice
θ가 주어졌을 때 자료 묶음 A와 B가 조건부 독립이면 결합 우도는 LA(θ)LB(θ)입니다. A로 갱신한 사후에 새로운 B의 우도를 곱하면, 두 묶음을 한 번에 갱신한 것과 같습니다. 두 묶음의 순서를 바꾸어도 같은 결합모형에서는 결과가 같습니다.
같은 A를 복사해 다시 입력하면 LA²을 쓴 다른 모형이 됩니다. 일반적으로 사후가 지나치게 뾰족해질 수 있습니다. 모수를 주었을 때의 독립과 모수 불확실성을 적분한 뒤의 주변 독립도 다르므로, 자료의 조건부 구조를 먼저 밝힙니다.
If data blocks A and B are conditionally independent given θ, their joint likelihood is LA(θ) LB(θ). Updating with A and then genuinely new B equals a joint update. The order does not matter under that same joint model.
Copying A and updating again uses LA², a different evidence model that can overconcentrate the posterior. Conditional independence given a parameter also differs from independence after integrating uncertainty.
기초Foundations
24. 사전 0·우도 0·표시 0은 서로 다르다24. Prior zero, likelihood zero and display zero are distinct
유한 후보의 사전 질량이 정확히 0이고 우도가 유한하면 그 후보는 보통의 갱신으로 살아나지 않습니다. 반대로 사전이 양수여도 관측이 불가능해 우도가 0이면 그 후보의 사후는 0입니다. 단, 정규화 합이 양수일 때의 말입니다.
계산 화면의 0은 아주 작은 양수일 수도 있습니다. 정확 분수·로그를 보존하면 0 확률 사건과 작은 증거를 구별할 수 있습니다. 연속 사전은 한 점의 질량이 0이어도 주변 구간에 양의 질량을 가질 수 있으므로, 이를 유한 후보에서 제외한 사건과 똑같이 읽지 않습니다.
A finite candidate with exact zero prior mass and finite likelihood is not revived by ordinary updating. A positive-prior candidate with impossible evidence receives zero posterior when the normalizer is positive.
A display zero can instead represent a tiny positive number. Preserve fractions and logs. Continuous priors can assign zero mass to every point while giving positive mass to neighborhoods; that differs from excluding a discrete hypothesis.
기초Foundations
25. 연속 사후는 밀도 곱을 적분해 정규화한다25. Normalize a continuous posterior by integrating density products
모수 p∈(0, 1)에 적절한 사전밀도 π(p)를 둡니다. 우도와 곱한 뒤 p 전체에서 적분한 값을 나눕니다. 관측 x에서 그 적분이 양의 유한 값이라는 조건이 필요합니다.
사후밀도 곡선의 한 점 높이는 p가 정확히 그 값일 확률이 아닙니다. 구간 확률은 면적입니다. 그래프의 격자점 수나 화면 픽셀 수를 후보 모수의 수처럼 세지 않습니다.
Place a proper prior density π on (0, 1), multiply it by likelihood, and divide by the integral. At the observed x, the normalizer must be positive and finite.
A density height is not the probability of that exact parameter. Interval probability is area. Plot grid points or pixels are not a discrete candidate-model space.
기초Foundations
26. Beta 밀도의 정규화와 끝점을 확인한다26. Check the Beta density normalizer and endpoint behavior
a, b>0인 Beta(a, b)는 성공확률 p에 놓기 편한 연속분포입니다. 정규화 상수 B(a, b)는 다음 양의 유한 적분입니다.
Uniform density occurs at a=b=1. A shape below one can produce an unbounded endpoint density while remaining integrable. This is not positive endpoint point mass. We start with proper Beta laws having positive finite shapes.
같은 분포족 안에 남는다는 뜻으로 켤레 사전이라고 부릅니다. 계산이 쉽다는 성질이지 현실에서 그 사전이 유일하게 맞다는 뜻은 아닙니다. 빈 자료이면 두 모수가 그대로입니다. 유한 n과 a, b>0에서 모두 0이어도 사후평균 a/(a+b+n)은 수학상 항상 엄격히 양수이며 표시 underflow와 구별합니다.
Combine a Beta(a, b) prior with conditionally iid Bernoulli data sharing p. With k successes among n observations, the exponents add.
Remaining in the same family is conjugacy, a computational convenience rather than validation of a unique prior. Empty data preserve the prior. For finite n and a, b>0, all-zero observations still give strictly positive posterior mean a/(a+b+n), separate from display underflow.
학부 연결 · 선택Undergraduate bridge · optional
28. 사후평균·분산을 적분 비율로 유도한다28. Derive posterior moments as ratios of Beta integrals
A=a+k, B=b+n−k, S=A+B라고 둡니다. 한 번 p를 곱한 적분은 B(A+1, B), 두 번 곱한 것은 B(A+2, B)입니다. 정규화 상수 비율로 모멘트를 구합니다.
비율의 유도도 확인합니다. A, B>0이면 tᴬ(1−t)ᴮ가 양 끝에서 0이므로 그 도함수의 적분이 0입니다. 또 t+(1−t)=1을 적분에 넣으면 다음 두 관계를 얻습니다.
u=B(A+1,B)v=B(A,B+1)Av=Buu+v=B(A,B)
여기서 u와 v는 두 Beta 적분을 짧게 쓴 기호입니다. B(·,·)는 Beta 함수이며 A와 B는 원래의 양의 모수입니다.
두 식을 풀면 B(A+1, B)/B(A, B)=A/(A+B)입니다. 이를 한 번 더 반복하면 두 번째 모멘트도 나옵니다.
사전 Beta(1, 1), n=4, k=1이면 사후 Beta(2, 4), 평균 1/3, 분산 2/63입니다. MLE 1/4와 다른 평균입니다. n>0이면 사후평균은 자료 비율 k/n과 사전평균 a/(a+b)의 가중평균으로 쓸 수 있지만, a, b가 실제로 관측한 추가 인원은 아닙니다.
Write A=a+k, B=b+n−k, S=A+B. Multiplying by p or p² changes the Beta integral’s first shape. Ratios of normalizers give moments.
Here is the ratio derivation. For A, B>0, the function tᴬ(1−t)ᴮ vanishes at both endpoints, so its derivative integrates to zero. Inserting t+(1−t)=1 gives a second identity:
u=B(A+1,B)v=B(A,B+1)Av=Buu+v=B(A,B)
Here u and v abbreviate the two Beta integrals. B(·,·) is the Beta function, while A and B retain their positive shape-parameter meanings.
Solving yields B(A+1, B)/B(A, B)=A/(A+B). Repeat the ratio once more for the second moment.
Prior Beta(1, 1) with n=4, k=1 gives Beta(2, 4), mean 1/3 and variance 2/63, distinct from MLE 1/4. For n>0, the posterior mean is a weighted average of k/n and a/(a+b), but prior shapes are not actual extra participants.
기초Foundations
29. 실습 D · 밀도 높이·CDF·사후 구간을 따로 읽는다29. Lab D · Read density height, CDF and posterior intervals separately
양의 사전 모수 a, b와 관측 n, k를 입력합니다. 사후 모수·정확 평균과 분산, 후보 p에서의 밀도와 누적확률, 등꼬리 사후구간을 비교하세요. 그래프의 높은 점은 그 모수의 점확률이 아닙니다.
선택한 양의 모수가 일반 숫자 범위보다 작아도 적절한 Beta 법칙은 존재할 수 있습니다. 그때 수치 CDF·분위수 지원 불가는 분포 부재와 다릅니다. 끝점에 가까운 분위수는 표시 0·1과 그 로그를 함께 보며, 정확한 모멘트와 근사 구간 끝점을 구별합니다.
Enter positive prior shapes and observed n, k. Compare posterior shapes, exact mean/variance, density and CDF at a probe, and equal-tail credible endpoints. A high point on the curve is not point probability.
A proper law can exist even when a positive shape is outside the numerical approximation scope. Unavailable CDF/quantile output does not mean no distribution. Read endpoint logs with rounded zero/one, and distinguish exact moments from approximate quantiles.
기초Foundations
30. 등꼬리 구간은 선택한 사후분포의 면적을 말한다30. An equal-tail interval describes area under the chosen posterior
적절한 양의 모수 Beta는 연속인 증가 CDF를 가지므로, α/2와 1−α/2 분위수를 양 끝으로 고를 수 있습니다. 0<α<1이면 그 사이 사후질량은 1−α입니다.
This conditions on data, model and prior. It does not automatically provide that repeated-sampling coverage for every true p. The lab extends α=0 to [0, 1] and α=1 to a repeated median endpoint with zero point mass.
학부 연결 · 선택Undergraduate bridge · optional
31. 사후 95%와 반복 포함률 95%는 다른 문장이다31. Ninety-five percent posterior mass differs from repeated 95% coverage
사후구간은 관측 x에 조건을 건 모수 확률입니다. 신뢰구간의 포함률은 참 p를 고정하고 X를 반복해서 뽑았을 때의 확률입니다. 두 문장은 움직이는 대상과 조건이 다릅니다.
posterior: coverage: P(p∈I(x)∣x),Pp{p∈I(X)}.
경계를 포함한 Bernoulli p∈[0, 1] 모형에서 참 p=0이면 모든 유한 표본이 0입니다. 양의 모수 Beta 사전의 등꼬리 구간은 0<α<1에서 아래끝이 0보다 커서 참 경계를 포함하지 않습니다. 그 점에서 반복 포함률은 0이지만 선택한 연속 사후 안 면적은 1−α입니다.
모형·사전 아래의 확률 문장과 모든 고정 모수에서의 빈도주의 보장을 혼동하지 않게 하는 반례입니다. 어떤 방법이 적절한지는 표적·의사결정·가정을 함께 보고 판단합니다.
A credible interval conditions on observed x and treats the parameter through its posterior. Frequentist coverage fixes the true p and repeats X. Different objects vary.
posterior: coverage: P(p∈I(x)∣x),Pp{p∈I(X)}.
For a Bernoulli family including p=0, the true boundary generates all-zero finite samples. A positive-shape Beta equal-tail interval at 0<α<1 has a strictly positive lower endpoint. Thus coverage at that boundary is zero even though its posterior mass is 1−α.
This separates model/prior-conditional probability from a guarantee at every fixed parameter. Assess the target, decision and assumptions rather than treating the two statements as interchangeable.
기초Foundations
32. 사후평균은 제곱손실이라는 질문에 답한다32. The posterior mean answers a squared-loss question
사후분포에서 한 숫자 d로 p를 요약해야 한다고 합시다. 제곱오차를 손실로 정하면 조건부 위험은 완전제곱으로 나뉩니다. p∈[0, 1]이므로 필요한 모멘트는 유한합니다.
E[(p−d)2∣x]=Var(p∣x)+{E[p∣x]−d}2.
따라서 제곱손실의 최적 d는 사후평균입니다. 절대손실이면 사후중앙값이 답이 될 수 있고, 밀도 봉우리를 고르는 MAP는 또 다른 요약입니다. 손실을 정하지 않고 하나의 추정값이 모든 문제에서 최고라고 말하지 않습니다.
Suppose one number d must summarize p. With squared error, conditional risk decomposes by completing the square. Bounded p has finite moments.
E[(p−d)2∣x]=Var(p∣x)+{E[p∣x]−d}2.
The posterior mean minimizes this loss. Absolute loss instead leads to a posterior median; MAP selects a density peak. No single summary is optimal for every unstated decision problem.
학부 연결 · 선택Undergraduate bridge · optional
33. MAP 공식에는 모수 조건과 밀도 표현이 필요하다33. MAP formulas need shape conditions and a density convention
사후 Beta(A, B)에서 A>1, B>1이면 로그밀도가 안쪽에서 엄격히 오목하고 밀도 최대는 (A−1)/(A+B−2)입니다. 사후평균 A/(A+B)와 일반적으로 다릅니다.
Uniform A=B=1 has every interior point as a mode. A shape below one can give an unbounded endpoint limit. Beta(1, 1/2) diverges near one; using the interior formula to return zero is wrong.
These describe canonical density and endpoint limits, not positive point masses. Densities agreeing almost everywhere can represent the same probability law.
선택 심화Optional extension
34. MLE의 재표현과 MAP의 밀도 변환은 다르다34. MLE reparameterization differs from transforming posterior density
η=g(p)가 모수공간의 일대일 대응이면 우도는 L(g⁻¹(η);x)로 읽습니다. 자료의 확률식을 같은 후보로 다시 이름 붙인 것이므로 존재하는 MLE도 g로 옮깁니다. 모수의 밀도를 새로 정규화하는 단계는 없습니다.
반대로 사후밀도를 η 좌표로 바꿀 때, 이 절의 야코비안 공식은 매끄러운 가역변환과 적절히 미분 가능한 역함수를 전제로 합니다. 확률 면적을 보존하려고 |dp/dη|를 곱하며, 이 인자가 봉우리 위치를 바꿀 수 있습니다. 아래 logit 변환은 이 조건을 충족합니다.
p가 사후 Uniform(0, 1)이면 p 밀도는 모든 안쪽 점에서 같은 높이지만, logit η 밀도 p(1−p)는 η=0에서 유일한 최대입니다. 같은 사후확률을 표현해도 MAP 밀도 위치가 단순히 옮겨지지는 않는 예입니다.
A bijective parameter relabeling gives likelihood L(g⁻¹(η); x). An existing MLE transfers through g because the candidate observation laws are unchanged.
The density Jacobian formula here assumes a smooth invertible transformation with an appropriately differentiable inverse. The factor preserves probability areas and can move its density peak. The logit transformation below satisfies these conditions.
A uniform posterior on p has a flat density, but its logit density p(1−p) has a unique maximum at η=0. Probability transforms consistently while density MAP locations need not.
선택 심화Optional extension
35. 정규화되지 않는 사전은 별도 적절성을 확인한다35. Improper priors require a separate propriety check
π(p)∝1/[p(1−p)]는 양 끝 적분이 발산해 확률 사전이 아닙니다. 이를 형식적으로 Beta(0, 0)처럼 부르더라도 양의 모수의 적절한 Beta와 같지 않습니다.
성공과 실패가 모두 있으면 형식 갱신이 적절한 Beta(k, n−k)로 정규화됩니다. 모두 0 또는 모두 1이면 이 적분이 발산해 사후확률을 만들지 못합니다. 빈 자료에서도 부적절 사전이 저절로 적절한 분포가 되지 않습니다. 기본 실습은 이런 문제를 피한다고 가정을 숨기지 않고 a, b>0를 명시합니다.
A formal prior proportional to 1/[p(1−p)] has divergent endpoint integrals and is not a probability distribution. Calling it Beta(0, 0) does not make it a proper positive-shape Beta.
h is the unnormalized posterior kernel; J is its integral.
Both outcomes present give a proper formal Beta(k, n−k) update; all-zero/all-one data do not. Empty data do not repair an improper prior. The basic labs explicitly require a, b>0 rather than hiding a posterior-propriety assumption.
기초Foundations
36. 사전 민감도는 가정을 바꾼 결과를 드러낸다36. Prior sensitivity makes assumption changes visible
같은 성공 수에서 Beta(1, 1), Beta(2, 2), Beta(1, 9)를 비교하면 사전 중심과 강도가 다릅니다. 작은 표본에서는 사후가 크게 달라질 수 있습니다. 많은 자료에서 사전 영향이 줄어드는 결론도 같은 p의 iid 모형과 고정된 적절한 사전 같은 조건 아래의 이야기입니다.
좋은 결과가 나온 사전만 남기는 것은 민감도 공개와 다릅니다. 사전 선택 기준·검토한 범위·자료 선택을 함께 보고합니다. 어떤 사전을 쓰든 누락된 집단의 결과나 정책의 인과효과가 자동 식별되는 것은 아닙니다.
Beta(1, 1), Beta(2, 2) and Beta(1, 9) have different centers and concentration. They can produce different posteriors from a small common sample. Diminishing prior influence with large n also relies on a shared-p iid model and a fixed appropriate prior.
Keeping only favorable priors is not transparent sensitivity analysis. Report selection rationale and alternatives. Changing a prior does not automatically identify excluded outcomes or causal effects.
기초Foundations
37. 미래 자료의 분포는 사후에 대해 다시 평균한다37. Average the future observation model over the posterior
자료 x를 본 뒤 미래 Y*를 예측하려면, 후보 p별 미래 법칙을 사후로 평균합니다. 미래 관측들은 같은 p를 주었을 때 iid Bernoulli(p)이고, 미래 관측 전체와 기존 자료도 p를 주었을 때 독립이라고 가정합니다.
다음 한 번은 사후평균을 대입한 Bernoulli와 같지만, 다음 두 번의 공동법칙은 보통 다릅니다. E[p²]=E[p]²+Var(p)이므로 공유 p의 불확실성이 두 관측을 주변적으로 연결합니다. 조건부 독립을 적분한 뒤의 독립으로 옮기지 않습니다.
Predict future Y* by averaging its conditional model over the posterior. Assume future observations are iid Bernoulli(p) conditional on the shared p, and that the entire future sequence is conditionally independent of the past given p.
One future observation matches a plug-in Bernoulli at the posterior mean, but two jointly generally do not. Their shared uncertainty adds Var(p). Conditional independence does not survive integration automatically.
기초Foundations
38. 미래 성공 수는 Beta-binomial 법칙을 따른다38. The future success count follows a Beta-binomial law
사후 Beta(A, B)와 미래 m회의 조건부 iid Bernoulli를 가정합니다. K*가 미래 성공 수이면 이항질량을 사후밀도로 적분합니다.
Summing inside the integral gives one, so these masses normalize. A uniform posterior with m=2 gives equal thirds, unlike plug-in p=1/2 probabilities (1/4, 1/2, 1/4).
학부 연결 · 선택Undergraduate bridge · optional
39. 예측 분산에는 공유 모수의 불확실성이 들어간다39. Predictive variance includes uncertainty in the shared parameter
μp=E[p|x], vp=Var(p|x)라고 둡니다. 총기대·총분산을 적용하면 다음과 같습니다. 이는 STAT07의 같은 분해를 새 모형에 적용한 것입니다.
V is the conditional variance of the future success count; w is the posterior mean of the conditional Bernoulli variance.
For Beta(2, 4), m=2, the mean is 2/3 and variance 32/63, above plug-in variance 4/9. One future outcome has no extra cross term. Zero future trials give a point mass at count zero.
기초Foundations
40. 실습 E · 사후예측과 plug-in의 공동법칙을 비교한다40. Lab E · Compare joint posterior prediction with plug-in prediction
같은 사전·자료에 미래 횟수 m을 바꾸어 두 성공 수 법칙을 비교합니다. Beta-binomial과 사후평균 고정 이항의 질량·CDF·분산을 따로 읽고, 다음 두 번 모두 성공 확률과 공유 공분산을 확인합니다.
새 미래 관측을 실제로 얻었다는 뜻이 아니라 선언한 모형의 예측입니다. 자료가 큰 실제 고객 사례에서도 같은 구별이 유지됩니다. m=0의 퇴화 성공 수와, 별도 ‘다음 두 번’ 보조 계산을 혼동하지 않습니다.
Vary future count m while holding prior and observations fixed. Compare Beta-binomial and posterior-mean plug-in masses, CDFs and variances. Read the auxiliary next-two success probability and shared covariance.
These are predictions under a declared model, not newly observed outcomes. The distinction persists in large actual-customer examples. A zero-trial count law is separate from the auxiliary hypothetical next-two calculation.
선택 심화Optional extension
41. 고정 Beta 사전의 집중을 한 모형에서 직접 보인다41. Show concentration directly in one fixed-Beta model
참 p₀∈[0, 1]에서 iid Bernoulli 자료가 생기고 a, b>0는 n과 무관하게 고정됐다고 합시다. 큰수의 법칙으로 k/n→p₀입니다. 사후평균 μₙ과 분산 vₙ은 다음 성질을 가집니다.
따라서 각 고정 ε>0에 대해 사후에서 |p−p₀|≥ε인 질량은 위 마지막 식/ε² 이하라 원 표집에 관한 확률수렴으로 0에 갑니다. 이는 이 특정 모형의 사후 집중 증명입니다. 유한표본 포함률이나 경계의 정규근사를 증명한 것은 아니며, 임의 사전·잘못된 모형으로 자동 확장하지 않습니다.
Assume iid Bernoulli data at true p₀∈[0, 1] and fixed positive prior shapes. The law of large numbers sends k/n to p₀.
For each fixed ε>0, posterior mass outside distance ε is at most that conditional second moment divided by ε², and vanishes in original-sampling probability. This proves concentration for this model, not finite-sample coverage or a boundary normal approximation. It is not automatic for arbitrary priors or misspecified models.
Bernoulli 안쪽 최대와 양의 중심 제곱합의 정규 최대는 이 장에서 전역 구조를 직접 확인했습니다. 일반 모형에서는 score=0인 점이 여러 개이거나 최대가 없을 수 있어, 수치 알고리즘의 종료 메시지만으로 해결되지 않습니다.
식별은 서로 다른 모수가 다른 관측법칙을 주는지의 문제이고, 일치성은 원 표집 크기 n의 극한 문제이며, 계산 수렴은 알고리즘 반복의 문제입니다. 표본 크기와 계산 반복 수를 바꾸어 쓰지 않습니다.
격자 그림이나 짧은 모의 연쇄가 사후 적분을 정확히 했다는 인증도 아닙니다. 이 장의 닫힌 식·정확 유한 질량·근사 CDF를 구분하고, MCMC의 불변분포·수렴 정당화는 STAT22에서 따로 다룹니다.
We directly checked the global structure of interior Bernoulli and nonconstant Gaussian maxima. General models can have multiple stationary points or no maximum; an optimizer’s stopping message is insufficient.
Identification asks whether distinct parameters give distinct observation laws. Consistency concerns increasing original n; computational convergence concerns algorithm iterations. Do not exchange those limits.
A grid or short simulated chain is not proof of exact posterior integration. Keep closed forms, exact finite masses and approximate CDFs distinct. Invariant distributions and convergence for MCMC are deferred to STAT22.
기초Foundations
43. 실제 16국의 알려진 비율과 가정 우도를 나누어 읽는다43. Separate a known sixteen-country fraction from an assumed likelihood
World Bank 2024년 자료의 고정 16국에서 기간 기대수명이 80년 이상인지 이진 지표를 만들면 8개가 1입니다. 이 목록의 비율 8/16=1/2은 이미 알려진 기술량입니다. 세계의 국가를 독립 무작위 추출했다는 증거는 없으므로, 아래 iid Bernoulli 우도는 별도로 선언한 작업 모형입니다.
작업 모형에서 n=16, k=8의 순서 우도를 비교합니다. p=1/2의 우도는 1/65536이고 p=1/4와 3/4의 우도는 각각 6561/4294967296입니다. 세 후보의 사전 확률이 같으면 사후는 다음과 같습니다.
사전을 (1/2, 1/3, 1/6)으로 바꾸면 양끝 우도가 같아도 사후 양끝 비율은 3:1이 됩니다. 가운데 사전과 양끝 사전 합은 같아 가운데 사후는 그대로입니다. 자료가 사전의 역할을 지웠다는 뜻이 아닙니다. 이 확률은 선언한 모형·후보·사전 안의 해석이며, 세계 비율의 인증된 불확실성 구간이 아닙니다.
Among sixteen fixed countries in the World Bank 2024 table, eight have period life expectancy at least eighty years. Their recorded fraction 8/16 is already known. The list is not established as an independent random sample of the world; an iid Bernoulli likelihood is a separately declared working model.
For n=16, k=8, the ordered likelihood at p=1/2 is 1/65536. At both p=1/4 and p=3/4 it is 6561/4294967296. Equal candidate priors give:
Changing the prior to (1/2, 1/3, 1/6) makes the tail posterior odds 3:1 despite equal tail likelihoods. The middle posterior is unchanged because its prior and the combined tail prior are unchanged. These are model-and-prior probabilities, not certified uncertainty about the world-country proportion.
기초Foundations
44. 실제 로그임금의 정규 적합에서 단위와 결측을 유지한다44. Retain units and missingness when fitting actual log wages
Card 원자료 3613행 중 기록된 로그임금은 3010개이고 603개는 가용하지 않습니다. 이 장에서는 가용 로그값에 대한 정규 작업 모형을 적합합니다. 기록된 값의 평균과 중심 제곱합은 다음과 같고, 표시 숫자는 반올림했습니다.
평균은 원자료가 처리해 둔 1976년 시간당 센트 임금의 로그 눈금이고, 분산은 그 로그 눈금의 제곱입니다. 6.26을 달러 임금으로 읽거나 exp(평균 로그)를 원임금의 산술평균으로 읽지 않습니다. 두 분산은 같은 제곱합에서 분모가 달라진 것입니다.
이 계산만으로 정규성·독립성·대표성을 확인하지 않았으며, 빠진 603명의 로그임금이나 교육의 인과효과도 알아내지 못합니다. 관측된 자료의 적합과 더 넓은 표적에 대한 주장을 분리합니다.
The Card source has 3613 rows, 3010 available recorded log wages and 603 unavailable values. Fit a Gaussian working model to the available logs. Displayed summaries are rounded:
The mean uses the source-processed logarithmic scale of 1976 hourly wages in cents; variance has squared log-scale units. A log value near 6.26 is not a dollar wage, and exponentiating a log mean does not give the arithmetic mean of wages. The two variance summaries divide the same sum of squares by different counts.
These computations establish neither normality, independence nor representativeness. They do not recover the 603 unavailable log wages or identify a causal education effect. Keep the observed-data fit separate from broader target claims.
기초Foundations
45. 실제 이탈 495건에서 사후와 미래 예측을 구별한다45. Distinguish posterior uncertainty and prediction for 495 actual churn records
UCI Iranian Churn 자료의 고객 3150기록 중 이탈 지표가 1인 기록은 495개입니다. 이 고정 목록의 비율은 11/70입니다. 공유 이탈확률과 조건부 iid Bernoulli를 작업 모형으로 선언하고 Beta(1, 1) 사전을 선택하면 사후는 Beta(496, 2656)입니다.
마지막 두 값의 차이는 사후분산 약 0.0000420546입니다. 숫자는 작지만 공동 예측의 정의는 다릅니다. 선택 모형의 95% 등꼬리 사후구간은 약 [0.14485815, 0.17027448]입니다. 이는 사전·우도 아래의 사후질량 0.95라는 뜻이지, 검증된 미래 고객집단 포함률이라는 뜻은 아닙니다.
Beta(2, 2), Beta(1, 9) 사전을 비교하고 파일 앞 0·10·50·100·500·3150행의 갱신을 볼 수 있습니다. 원파일 순서가 실제 시간순이라고 확인되지 않았으므로 이 경로를 월별 사업 변화로 부르지 않습니다. 사전 선택·원자료·공유 iid 가정을 함께 기록합니다.
The UCI Iranian Churn table contains 495 positive indicators among 3150 customer records, a fixed-list fraction of 11/70. Under a separately declared shared-p conditionally iid Bernoulli model and a Beta(1, 1) prior, the posterior is Beta(496, 2656).
b₂ is the joint posterior-predictive probability of two future successes.
The last two quantities differ by posterior variance, about 0.0000420546. The definitions differ even when the numerical difference is small. The chosen model’s 95% equal-tail posterior interval is approximately [0.14485815, 0.17027448]; its posterior mass does not certify future customer-population coverage.
Compare Beta(2, 2) and Beta(1, 9) priors and updates after the first 0, 10, 50,100,500 and 3150 file rows. Source order is not verified chronology, so this path is not a monthly business trend. Report prior choice, source records and the shared-iid assumption together.
기초Foundations
46. 실습 F · 같은 실제 기록에 모형·사전·질문을 나누어 적용한다46. Lab F · Apply distinct models, priors and questions to the same actual records
국가에서는 세 후보의 사전과 선택 p를 바꾸고, 로그임금에서는 정규 모수의 탐색값과 최대를 비교합니다. 고객에서는 선택한 파일 접두부·Beta 사전·미래 횟수를 바꿉니다. 관측된 원기록을 이 입력으로 덮어쓰지 않습니다.
표의 우도·사후·예측을 서로 다른 칸으로 읽습니다. 순서 우도와 이항 성공 수 우도는 공통 계수만큼 다르지만 같은 자료 모형 안에서 최대·사후 모수 비교는 같습니다. 양수 값이 표시 범위 아래로 내려가면 로그와 양수 상태를 읽고, 정확한 0이나 모형 부재와 구별합니다.
For countries, change candidate priors and a parameter probe. For log wages, compare Gaussian probes with their maximum. For customers, choose a file prefix, Beta prior and future count. These inputs do not overwrite source records.
Read likelihood, posterior and prediction in separate columns. Ordered-data and count likelihoods differ by a parameter-independent coefficient while giving identical parameter comparisons in this model. When a positive value is below display range, read its logarithm and positive status rather than treating it as exact zero or an absent law.
기초Foundations
47. 국가·개인·기업 사례를 원자료와 함께 읽는다47. Read country, person and company cases alongside their sources
국가 사례 · 우도가 크다는 말은 그 모수가 참일 확률이 크다는 말일까?
World Bank의 실제 2024년 16국가 기간 기대수명에서 80년 이상을 1, 미만을 0으로 표시하면 1이 8개, 0이 8개입니다. 기간 기대수명은 그 시점 사망률 패턴을 적용한 집단 지표이지 개인 수명의 예측이 아닙니다. 이 16개 나라를 모두 보았으므로 이 고정 프레임의 비율 1/2은 이미 알려져 있습니다. 나라 선택이 세계의 무작위 표본이라는 뜻도 아닙니다.
실제 기간 기대수명과 따로 정의한 이진화
국가
2024 기간 기대수명 · 년
80년 이상 표시
Australia
83.051
1
Brazil
76.023
0
Canada
82.108
1
China
78.017
0
Germany
80.793
1
France
82.980
1
United Kingdom
81.387
1
Indonesia
71.288
0
India
72.235
0
Japan
84.036
1
Korea, Rep.
83.629
1
Mexico
75.264
0
Singapore
83.346
1
United States
78.890
0
Viet Nam
74.736
0
South Africa
66.312
0
이제 이 관측된 표시들에 독립·동일 Bernoulli(p)라는 작업모형을 별도로 붙입니다. 이것은 실제 국가 사이 독립성을 발견한 사실이 아닙니다. 고정한 관측 순서의 우도 L(p)=p^s(1−p)^(n−s)를 p의 함수로 비교합니다. 성공 수만 관측하는 이항 자료로 바꾸면 이항계수 C(n,s)가 붙지만 p와 무관하므로 이 모형의 최대점과 같은 모형 안의 우도비는 같습니다. 서로 다른 자료 공간·모형의 수치를 아무 설명 없이 직접 비교하지는 않습니다.
L(p)=ps(1−p)n−sℓ(p)=slogp+(n−s)log(1−p)p=s/n
그림은 L(p)를 최대 우도로 나눈 상대우도입니다. 높이 1은 최대점이라는 뜻이며, 곡선 아래 면적이 사후확률 1로 정규화되었다는 뜻이 아닙니다. s와 n−s가 모두 양수이므로 이 예의 최대점은 내부에 있습니다. 모든 표시가 0 또는 1인 다른 자료라면 [0,1]에서의 MLE는 경계 0 또는 1이며 내부 미분식만으로 모든 경우를 해결할 수 없습니다.
사후확률을 계산하려면 가설 공간과 사전확률을 더 정해야 합니다. 여기서는 p를 1/4·1/2·3/4라는 세 가설에만 한정하고, 균등 사전과 낮은 p에 더 큰 질량을 준 설명용 사전을 비교합니다. 이 제한된 세 가설의 최댓값은 연속 p 전체에서의 MLE와 같을 필요가 없습니다. 사전은 실제 국가의 추가 관측이 아닙니다.
동일 실제 표시의 우도 · 두 가정 사전
가정 사전
p 가설
사전 질량
관측 순서 우도
사후 질량
균등 사전
1/4
1/3
1.527602e-06
0.0834117
균등 사전
1/2
1/3
1.525879e-05
0.8331765
균등 사전
3/4
1/3
1.527602e-06
0.0834117
낮은 p에 더 큰 질량
1/4
1/2
1.527602e-06
0.1251176
낮은 p에 더 큰 질량
1/2
1/3
1.525879e-05
0.8331765
낮은 p에 더 큰 질량
3/4
1/6
1.527602e-06
0.0417059
먼저 생각한 뒤 풀이 보기: 우도 세 개를 더해 1이 아니면 계산이 틀린가요?
아닙니다. 각 값은 다른 p 아래 같은 관측 자료의 확률입니다. 모수를 바꾸며 얻은 우도 자체는 모수 위의 확률질량함수가 아닙니다. 이 세 가설에 사전 질량을 곱하고 그 합으로 나누면 그때 정한 모형 아래의 사후 질량 합이 1이 됩니다.
사람 사례 · 실제 임금 자료에 정규 우도를 붙이면 왜 분산 분모가 n일까?
Card 원자료 3,613명의 lwage76은 1976년 시간당 임금(센트)의 로그를 극단값 정리한 변수이며 3,010개가 가용하고 603개가 결측입니다. 가용 로그 평균은 약 6.261831918입니다. 이 값들을 독립·동일 N(μ,v), v>0에서 온 것처럼 다루는 작업우도를 선택합니다. 실제 조사 표집·응답·절단 구조가 iid 정규임을 입증한 것은 아니므로 아래 최적화 결과를 전체 남성의 확정된 모집단 모수나 인과효과로 확대하지 않습니다.
μ를 고정하면 v의 최댓값은 SSE(μ)/n입니다. 이를 다시 넣으면 profile 우도가 되고, SSE(μ)=SSE(평균)+n(μ−평균)²이므로 μ=평균에서 가장 큽니다. v는 양수이고 실제 SSE가 양수인 이 자료에서 얻은 결론입니다. MLE는 주어진 우도를 최대로 만드는 규칙이며 비편향성이라는 다른 목표를 자동으로 만족시키는 규칙이 아닙니다.
같은 실제 SSE, 다른 목적의 두 분산 규칙
수량
정확한 분모·관계
표시 소수 · 반올림
관측 평균
3,010
6.2618319177
평균 주위 SSE
Σ(x−평균)²
592.6416731450
정규 작업모형 MLE 분산
SSE/3010
0.1968909213
표본분산 규칙
SSE/3009
0.1969563553
두 분산의 비
3010/3009
1.0003323363
먼저 생각한 뒤 풀이 보기: 연속 자료에서 정확히 이 숫자가 나올 확률이 0이면 우도도 모두 0인가요?
연속 모형의 우도는 관측점에서의 결합 밀도를 모수의 함수로 본 것입니다. 한 점의 확률과 밀도 높이는 다릅니다. 밀도는 1보다 클 수도 있으며 측정 단위를 바꾸면 높이도 바뀝니다. 모수와 무관한 야코비안이 생기는 일대일 자료 변환은 우도비와 대응하는 MLE를 보존하지만, 높이 자체를 확률로 읽지는 않습니다.
먼저 생각한 뒤 풀이 보기: 분모 n−1이 “맞는 분산”이라면 n은 계산 오류인가요?
아닙니다. iid·유한 분산 가정 아래 모분산의 비편향 추정을 목표로 하면 n−1 보정이 등장하고, 이 정규 우도를 최대화하면 n이 나옵니다. 우도 최적화·편향·MSE·강건성은 서로 다른 평가 기준입니다. 가용 3010개로 계산한 분산 어느 쪽도 결측 603개를 복원하지 않습니다.
고객 실무 사례 · 실제 이탈 기록과 가정한 Beta 사후·예측을 구별하기
UCI Iranian Churn의 실제 공개 고객 기록 3,150개에는 이탈 495개, 비이탈 2,655개가 있습니다. 원 설명은 처음 9개월의 특성과 12개월 시점 이탈 표시, 그 사이의 간격을 구분하지만 수집 연도를 제공하지 않습니다. 데이터 공개 연도 2020을 수집 연도라고 쓰지 않습니다. 익명 row_id는 공개 파일 위치로 부여한 번호이며 실제 고객의 영구 추적 코드가 아닙니다. 원 회사명·미래 고객 모집단과 실제 독립성도 이 표만으로 알 수 없습니다.
모든 고객이 같은 미지 확률 p를 가지며 p를 조건으로 독립 Bernoulli라는 작업모형을 가정하면 MLE는 495/3150=11/70입니다. 불만 여부·계약 기간 등으로 위험이 달라질 가능성을 무시한 풀링 모형입니다. 이제 별도로 p~Beta(a,b)라는 사전을 정합니다. a,b는 실제 고객 관측 수가 아니라 선택한 사전의 모수입니다. 커널에 지수를 더하면 사후는 Beta(a+495,b+2655)가 됩니다. 정규화 상수와 사전의 역할을 생략한 채 L(p)를 사후라고 부르지 않습니다.
A=a+s,B=b+n−sπ(p∣y)∝pA−1(1−p)B−1E[p∣y]=A+BA
동일 실제 3150개 기록, 서로 다른 가정 사전
선택 사전
사후 Beta(A,B)
사후 평균=다음 1건 예측
95% 동일꼬리 사후구간
Beta(1,1)
Beta(496,2656)
0.157360406
[0.1448581, 0.1702745]
Beta(2,2)
Beta(497,2657)
0.157577679
[0.1450721, 0.1704946]
Beta(1,9)
Beta(496,2664)
0.156962025
[0.1444887, 0.1698466]
이 사후구간은 지정한 likelihood와 prior 아래 p의 사후 질량 95%를 사이에 두도록 계산한 동일꼬리 구간입니다. 빈도주의 95% 신뢰구간의 반복 포함률을 증명한 것이 아니며, 실제 미래 고객에서의 예측 보정이 확인된 것도 아닙니다. 표의 소수와 그래프 밀도는 수치 근사이며 CSV에는 양의 이항 꼬리합으로 재계산한 정밀 수치를 남깁니다. 그래프에서 모수 p 한 점의 사후확률은 0이고 면적이 확률입니다.
공개 파일 순서의 처음 10·50·100·500개를 차례로 읽는 계산도 제공합니다. 이 순서를 실제 시간 도착 순서나 무작위 표본 순서라고 부르지 않습니다. 예를 들어 처음 10개 실제 표시에는 이탈이 0개이므로, Beta(1,1) 사전을 택한 그 prefix의 다음 1건 예측은 1/12입니다. 관측 빈도와 사후 평균은 질문과 가정이 다르며, 0개의 이탈을 보았다고 이후 이탈 가능성이 현실에서 0으로 증명된 것은 아닙니다.
Z₁과 Z₂는 기존 표기의 Y_new,1과 Y_new,2, 즉 다음 두 이진 관측입니다. b₂는 두 성공의 공동확률이고 μ_p는 p의 사후평균입니다.
먼저 생각한 뒤 풀이 보기: 조건부로 독립이라면 다음 두 고객 이탈 확률은 사후 평균의 제곱 아닌가요?
p를 하나의 값으로 고정하면 두 이탈 확률은 p²입니다. p의 사후 불확실성까지 평균하면 E[p²|자료]이므로 E[p|자료]²과 다릅니다. 차이는 사후 분산입니다. 같은 미지 p를 공유하는 모형에서 조건부 독립과 p를 적분한 뒤의 주변 독립은 다릅니다. 이 작업모형의 식이 실제 고객 사이 의존 구조를 입증하는 것은 아닙니다.
먼저 생각한 뒤 풀이 보기: 원자료를 두 번 읽어 사후를 다시 갱신하면 정보가 늘어난 것인가요?
같은 기록을 새로운 관측처럼 우도에 두 번 곱하면 정보를 이중 계산합니다. 여러 배치를 실제로 서로 겹치지 않게 나눠 갱신하면 이 조건부 iid 모형에서는 전체를 한 번에 처리한 것과 같은 결과가 나오지만, 파일을 복제한 것은 새 고객 관측이 아닙니다. 전체 자료로 prior를 정한 다음 같은 자료를 새 증거처럼 쓰는 선택도 별도 분석 절차로 검토해야 합니다.
Country case · Does a larger likelihood mean a more probable parameter?
Code the actual 2024 period life expectancy in sixteen World Bank countries as one if at least 80 years, zero otherwise. There are 8 ones and 8 zeros. Period life expectancy is a population indicator under that period’s mortality pattern, not an individual lifespan prediction. The fixed frame’s proportion 1/2 is already known because all sixteen are observed; their selection is not a random sample of the world.
Actual period life expectancy and an explicitly derived binary label
Country
2024 period life expectancy · years
Label: at least 80 years
Australia
83.051
1
Brazil
76.023
0
Canada
82.108
1
China
78.017
0
Germany
80.793
1
France
82.980
1
United Kingdom
81.387
1
Indonesia
71.288
0
India
72.235
0
Japan
84.036
1
Korea, Rep.
83.629
1
Mexico
75.264
0
Singapore
83.346
1
United States
78.890
0
Viet Nam
74.736
0
South Africa
66.312
0
Now separately posit an iid Bernoulli(p) working model for these observed labels. This does not establish independence among real countries. Compare L(p)=p^s(1−p)^(n−s) for the fixed ordered labels as a function of p. If only the success count is recorded, the binomial likelihood adds C(n,s); it is independent of p, so the maximum and within-model likelihood ratios agree. Do not compare values from different data spaces or models without accounting for that distinction.
L(p)=ps(1−p)n−sℓ(p)=slogp+(n−s)log(1−p)p=s/n
The plot divides L(p) by its maximum. Height one marks the maximum; it does not mean that area under the curve is a normalized posterior probability. This example has both zeros and ones, so its maximum is interior. If another dataset contains only zeros or only ones, the MLE on [0,1] is the boundary zero or one; interior differentiation does not cover every case.
A posterior requires an additional hypothesis space and prior. Restrict p to three hypotheses, 1/4,1/2,3/4, and compare an equal prior with an illustrative prior giving lower p more mass. The maximizer over these three candidates need not equal the continuous-parameter MLE. A chosen prior is not additional observed country data.
Same observed labels, two assumed priors
Assumed prior
p hypothesis
Prior mass
Ordered-label likelihood
Posterior mass
Equal prior
1/4
1/3
1.527602e-06
0.0834117
Equal prior
1/2
1/3
1.525879e-05
0.8331765
Equal prior
3/4
1/3
1.527602e-06
0.0834117
More prior mass at lower p
1/4
1/2
1.527602e-06
0.1251176
More prior mass at lower p
1/2
1/3
1.525879e-05
0.8331765
More prior mass at lower p
3/4
1/6
1.527602e-06
0.0417059
Think first, then reveal: Are the three likelihoods wrong if they do not sum to one?
No. Each concerns the same observed data under a different p. Likelihood as a function of a parameter is not itself a parameter probability mass function. Multiplying by chosen prior masses and normalizing gives posterior masses summing to one in that specified model.
Person case · Why does the normal-likelihood variance divide by n?
Card’s lwage76 is the source-trimmed log of 1976 hourly wages measured in cents/hour. Of 3,613 source records,3,010 are available and 603 unavailable. The available-log mean is approximately 6.261831918. Choose a working likelihood treating available values as iid N(μ,v), v>0. This does not prove that survey selection, response and trimming follow an iid normal process; the optimization does not establish population parameters for all men or causal effects.
For fixed μ, maximize over v at SSE(μ)/n. Substitute this to obtain the profile likelihood. Because SSE(μ)=SSE(mean)+n(μ−mean)², the maximum occurs at μ=mean. This conclusion uses v>0 and this dataset’s positive SSE. Maximum likelihood optimizes the chosen likelihood; it does not automatically optimize the different criterion of unbiasedness.
Same observed SSE, two variance rules with different objectives
Quantity
Exact denominator/relation
Rounded decimal
Observed mean
3,010
6.2618319177
Observed SSE
Σ(x−mean)²
592.6416731450
Normal-working-model MLE variance
SSE/3010
0.1968909213
Sample-variance rule
SSE/3009
0.1969563553
Ratio of variance rules
3010/3009
1.0003323363
Think first, then reveal: If an exact continuous observation has probability zero, is every likelihood zero?
A continuous likelihood evaluates the joint density at the observation as a function of parameters. A point probability and a density height differ. Densities may exceed one and change with measurement units. One-to-one data transformations with parameter-independent Jacobians preserve likelihood ratios and corresponding MLEs; density height is still not a probability.
Think first, then reveal: If n−1 gives an unbiased variance rule, is division by n an error?
No. Unbiased estimation of a population variance under iid finite-variance assumptions leads to n−1, while maximizing this normal likelihood leads to n. Likelihood optimization, bias, MSE and robustness are different criteria. Neither rule recovers the 603 unavailable values.
Customer-practice case · Actual churn records versus an assumed Beta posterior and prediction
The UCI Iranian Churn source has 3,150 actual public customer records: 495 churn and 2,655 non-churn. Metadata distinguishes first-nine-month attributes, a month 12 churn label and an intervening gap, but does not provide the collection year. The 2020 release year is not the collection year. Assigned row_id tracks public-file position, not a permanent real-world customer identity. Company identity, a future deployment population and independence are not established by this table.
Under a working model with one shared unknown p and conditionally independent Bernoulli outcomes, the MLE is 495/3150=11/70. This pooled model ignores possible risk differences by complaints, tenure and other attributes. Separately choose p~Beta(a,b). The prior parameters are selected assumptions, not additional observed customers. Adding exponents gives Beta(a+495,b+2655). Likelihood alone is not a posterior: both the prior and normalization matter.
A=a+s,B=b+n−sπ(p∣y)∝pA−1(1−p)B−1E[p∣y]=A+BA
Same actual 3150 records under different chosen priors
Chosen prior
Posterior Beta(A,B)
Posterior mean=next-one predictive
95% equal-tail posterior interval
Beta(1,1)
Beta(496,2656)
0.157360406
[0.1448581, 0.1702745]
Beta(2,2)
Beta(497,2657)
0.157577679
[0.1450721, 0.1704946]
Beta(1,9)
Beta(496,2664)
0.156962025
[0.1444887, 0.1698466]
The equal-tail interval places 95% posterior mass between its bounds under the specified likelihood and prior. It does not prove 95% frequentist repeated coverage or calibration on actual future customers. Displayed decimals and density plots are numerical approximations; CSVs retain high-precision values recomputed using positive binomial tails. For a continuous posterior, a single p has probability zero; area gives probability.
The downloads also update after the first 10,50,100 and 500 rows in public-file order. That is not established as chronological arrival or random-sample order. The first 10 actual labels contain 0 churn events, so a Beta(1,1) prior gives that prefix a next-one predictive probability 1/12. An observed frequency and a posterior mean answer different questions. Zero observed churn does not prove that future real-world churn is impossible.
Z₁ and Z₂ abbreviate the original Y_new,1 and Y_new,2, the next two binary observations. b₂ is their joint success probability and μ_p is the posterior mean of p.
Think first, then reveal: Does conditional independence make the next-two probability the squared posterior mean?
For a fixed p, the probability is p². Integrating parameter uncertainty gives E[p²|data], not E[p|data]²; the gap is posterior variance. Conditional independence given a shared p differs from marginal independence after integrating p. This model identity does not establish the dependence structure of actual customers.
Think first, then reveal: Does rereading the same data to update again add information?
Multiplying the same records into the likelihood again as if newly observed double-counts evidence. Updating genuinely disjoint batches gives the same result as one joint update in this conditional-iid model, but copying a file does not create new customers. Choosing a prior after seeing the full data and then treating those data as fresh evidence also needs explicit methodological justification.
기초Foundations
48. 검증한 범위를 읽고 자신의 모형을 문장으로 적는다48. Read focused references and state your own model in words
For implementation, consult the density, moments, CDF and algorithm descriptions in the official R Beta documentation. Our proper Beta shapes are strictly positive. Software conventions for zero/infinite limiting shapes and displayed endpoint densities are not automatically prior point masses.
Finish by writing the observation unit, available count, joint sampling model, parameter space, prior, normalizability, attainment of a maximum, future prediction unit and exact-versus-approximate computation. Then ask how another reasonable prior or dependence model would change the conclusion.
자료 묶음을 풀고 코드와 실제데이터 폴더를 함께 두세요. 터미널에서 코드 파일이 있는 폴더로 이동해 아래 명령을 실행합니다. 코딩이 처음이라면 손계산과 웹 실습을 먼저 하고, 데이터 사이언스 입문에서 코드를 배운 뒤 돌아와도 됩니다.Extract the bundle, keeping the scripts beside the data folder. In a terminal, enter the script folder and run the commands below. Beginners can complete hand calculations and browser labs first, returning to code after studying introductory data science.
결과 파일은 각 코드에 지정된 결과 폴더에 저장됩니다. CSV 원자료는 덮어쓰지 않습니다.Result files are saved in the result directory specified by each script; the input CSVs are not overwritten.
영상·학자·함께 읽기Videos, thinkers and guided reading
본문의 질문을 넓히는 선택 학습입니다. 영상을 보기 전 질문을 먼저 읽고, 자신의 답을 쓴 뒤 해설과 비교하세요. 자료의 언어·선수 지식은 각 항목에 표시했습니다.Optional extensions to the chapter. Read the question first, write your answer, then compare with the explanation. Language and prerequisites are indicated below.
StatQuest · 확률과 우도의 다른 방향StatQuest · Probability is not likelihood
Josh Starmer / StatQuest
자료를 고정하고 모수를 바꾸는 시점을 따라갑니다. 국가의 세 p 가설에서 각각 무엇이 고정되고 무엇이 달라지는지 적고 사후를 만들기 위해 추가한 prior와 정규화 합을 찾아보세요.Follow the shift from varying data to fixing observations and varying parameters. Identify what is fixed for the three country hypotheses, then locate the prior and normalization needed for a posterior.
교재 안의 YouTube 플레이어에서 재생합니다. 원영상에서 제공하는 자막은 플레이어의 CC·설정에서 선택할 수 있습니다.Playback stays in this chapter’s YouTube player. Available captions can be selected through CC/settings.
보고 읽은 뒤 답하기Respond after watching/reading관측 자료가 같으면 우도와 사후도 같은 함수인가요?Does fixed observed data make likelihood and posterior identical?
생각을 점검하는 해설Check your reasoning
아닙니다. 모형·사전·가설 공간과 정규화가 필요합니다. 연속 사후에서는 밀도와 점확률도 구별합니다.No. A posterior requires a model, prior, parameter space and normalization. Continuous density and point probability also differ.
로널드 피셔 · 모형 설정과 우도 추정Ronald Fisher · Model specification and likelihood estimation
University of St Andrews · MacTutor
대학 소개에서 우도·추정·분포를 연결한 부분을 읽습니다. 역사적 인물의 수리적 기여와 그가 지지한 우생학의 차별적 입장은 구별하며, 방법의 타당성은 이름이 아니라 가정·도출·검증으로 평가합니다.Read the university account connecting likelihood, estimation and distributions. Distinguish mathematical contributions from Fisher’s discriminatory eugenic commitments; evaluate methods through assumptions, derivations and verification rather than authority.
보고 읽은 뒤 답하기Respond after watching/reading이름이 유명한 방법이면 실제 자료의 모형 가정을 생략해도 되나요?May a famous method’s name substitute for checking its model?
생각을 점검하는 해설Check your reasoning
아닙니다. 실제 단위·관측 과정·우도와 목표를 확인해야 합니다.No. Check actual units, observation processes, likelihood and target.
MIT · 이항·정규 우도와 MLE의 식MIT · Binomial and normal likelihood/MLE formulas
MIT18.05 · Orloff and Bloom, Class10 §5 selected formulas
§5의 이항 우도와 정규 모형 결합 밀도·로그우도 및 마지막 MLE 식만 읽습니다. 정규 예의 도함수 왼쪽 f 표시는 log f의 도함수로 바로잡아 읽고, 연속 관측의 한 점 확률과 밀도를 혼동하지 않습니다.Read §5’s binomial likelihood and normal joint density/log-likelihood and final MLE formulas. The normal example’s derivative labels should refer to log f, not f. Distinguish continuous density from a point probability.
보고 읽은 뒤 답하기Respond after watching/reading정규 MLE 분산은 왜 n−1이 아닌가요?Why does normal MLE variance not divide by n−1?
생각을 점검하는 해설Check your reasoning
이 우도를 최대화한 미분식에서 n이 나옵니다. n−1은 다른 목표인 iid 모분산의 비편향 추정과 연결됩니다.Maximizing this likelihood yields n; n−1 belongs to the different objective of unbiased population-variance estimation under iid assumptions.
MIT · 연속 사후 정규화와 예측 적분MIT · Normalized continuous posteriors and predictive integration
MIT18.05 · Orloff and Bloom, Class13 §§10/12 formulas
§10의 연속 Bayes 정규화 식과 §12의 사후 예측 적분 식을 읽습니다. 동전 예의 숫자는 실제 고객 자료에 옮기지 말고, 본문의 Beta 커널 지수를 직접 더해 사후를 유도하세요.Read §10’s normalized continuous Bayes formula and §12’s posterior predictive integral. Do not transfer coin-example numbers to real customers; derive this chapter’s posterior by adding exponents in the Beta kernel.
보고 읽은 뒤 답하기Respond after watching/reading다음 두 이탈을 예측할 때 왜 E[p²|자료]를 쓰나요?Why use E[p²|data] for the next two churn outcomes?
생각을 점검하는 해설Check your reasoning
공유 p를 조건으로 한 두 성공 확률 p²를 사후분포에 대해 적분하기 때문입니다.Integrate the conditional two-success probability p² over the posterior of the shared parameter.
연습문제 · 계산에서 설명과 증명까지Exercises: calculation, explanation and proof
먼저 혼자 풀고 풀이를 여세요. 숫자와 함께 단위·포함 기준·계산 이유를 확인하세요.Attempt each problem before opening its solution. Check units, inclusion rules and the reason for the calculation.
1. 어느 양을 고정했는가Which quantity was held fixed?
Bernoulli 모형 fₚ(x)=pˣ(1−p)¹⁻ˣ에서 p를 고정하고 x를 바꾸는 읽기와, x=1을 고정하고 p를 바꾸는 읽기를 구별하세요. 두 번째 식을 p의 확률밀도라고 바로 부를 수 있나요?
For fₚ(x)=pˣ(1−p)¹⁻ˣ, distinguish fixing p and varying x from fixing x=1 and varying p. Is the second expression automatically a probability density for p?
풀이와 확인할 이유Solution and explanation
첫 번째는 관측 x의 표집질량이고 x=0, 1에 대해 합이 1입니다. 두 번째는 L(p;1)=p라는 우도입니다. p∈[0, 1]에서 적분하면 1/2이므로 정규화된 p 밀도가 아닙니다. 사전이 있어야 사후확률을 정의하며, Uniform 사전을 추가하면 정규화한 사후밀도는 2p가 됩니다.
The first is a sampling mass summing to one over x=0, 1. The second is likelihood L(p;1)=p, whose integral over [0, 1] is 1/2. A posterior requires a prior. Adding a uniform prior and normalizing gives posterior density 2p.
2. 고정 네 기록의 우도비Likelihood ratio for four fixed records
조건부 iid Bernoulli(p) 기록 (1, 0, 0, 0)에서 p=1/4와 3/4의 순서 우도와 우도비를 계산하세요. 비가 곧 두 모수의 사후비인가요?
For conditionally iid Bernoulli(p) records (1, 0, 0, 0), calculate ordered likelihoods at p=1/4 and 3/4 and their ratio. Is it automatically the posterior odds?
풀이와 확인할 이유Solution and explanation
우도는 p(1−p)³입니다. 두 값은 27/256과 3/256이고 첫 번째 대 두 번째 비는 9입니다. 사후비는 이 우도비에 사전비를 곱합니다. 같은 사전확률을 주었을 때에만 사후비도 9입니다.
The likelihood p(1−p)³ takes values 27/256 and 3/256, so its ratio is nine. Posterior odds multiply likelihood ratio by prior odds. They equal nine only when these two prior probabilities are equal.
3. 순서 기록과 성공 수An ordered record versus a success count
iid Bernoulli 네 번에서 성공 수 K=1을 관측했습니다. p=1/4에서 P(K=1)과 특정 순서 (1, 0, 0, 0)의 확률을 비교하고, 어느 쪽을 사용하든 MLE가 같은 이유를 설명하세요.
Four iid Bernoulli trials give K=1. At p=1/4, compare P(K=1) with the probability of the particular record (1, 0, 0, 0). Why do both likelihoods give the same MLE?
풀이와 확인할 이유Solution and explanation
순서 기록의 확률은 27/256이고 성공 수 질량은 C(4, 1)배인 27/64입니다. 네 가지 순서를 합친 것입니다. 공통 계수 4가 p와 무관하므로 최대의 위치와 같은 사전 아래의 사후 모수비는 변하지 않습니다. 자료 모형에 따라 올바른 질량을 보고하되 두 사건을 같다고 부르지 않습니다.
The ordered probability is 27/256; the count mass is four times larger, 27/64. The coefficient counts possible orders and is independent of p, so maximizers and posterior parameter ratios under a common prior are unchanged. The two observation events still differ.
4. 안쪽 Bernoulli 최대An interior Bernoulli maximum
iid Bernoulli 자료에서 n=4, k=1이며 모수공간은 [0, 1]입니다. 로그우도의 도함수 부호를 사용해 전역 MLE를 구하세요.
For iid Bernoulli data n=4, k=1 with parameter space [0, 1], use the log-likelihood derivative signs to find the global MLE.
풀이와 확인할 이유Solution and explanation
안쪽에서 ℓ′(p)=1/p−3/(1−p)=(1−4p)/[p(1−p)]입니다. 1/4보다 작으면 양수, 크면 음수여서 그 지점이 유일한 안쪽 최대입니다. 양 끝에서는 우도가 0이고 안쪽 최대는 양수이므로 전역 MLE도 1/4입니다.
Inside the interval, ℓ′(p)=(1−4p)/[p(1−p)], positive below 1/4 and negative above it. Thus 1/4 is the unique interior maximum. Both endpoint likelihoods are zero, so it is also the unique global MLE.
For Bernoulli n=4, k=1, calculate the score and second log-likelihood derivative at p=1/2. Does a negative score mean a negative success probability?
풀이와 확인할 이유Solution and explanation
score는 1/p−3/(1−p)이므로 −4입니다. 이차도함수는 −1/p²−3/(1−p)²이므로 −16입니다. 음수 score는 이 탐색점에서 p를 조금 늘릴 때 로그우도가 감소한다는 국소 변화율입니다. 모수 자체나 확률의 부호가 아닙니다.
The score 1/p−3/(1−p) is −4, and the second derivative −1/p²−3/(1−p)² is −16. The score describes the local change of log likelihood when p increases. It is not the parameter or its probability sign.
6. 열린 모수공간의 경계A boundary in an open parameter space
iid Bernoulli 기록이 0 네 개입니다. 모수공간이 [0, 1]일 때와 (0, 1)일 때 최대우도 추정의 차이를 설명하세요.
Four iid Bernoulli records are all zero. Compare maximum likelihood on [0, 1] and on (0, 1).
풀이와 확인할 이유Solution and explanation
L(p)=(1−p)⁴입니다. 닫힌 공간에서는 p=0에서 최대 1을 달성합니다. 열린 공간에서는 어느 양수 p보다 더 작은 양수 p가 더 큰 우도를 주므로 최대가 없습니다. 상한 1은 p↓0에서 접근할 뿐입니다. 미분방정식의 안쪽 해가 없는 것이 데이터 오류라는 뜻은 아닙니다.
L(p)=(1−p)⁴ attains one at p=0 on the closed space. In the open space every admissible p can be decreased to improve likelihood, so there is no maximum. The supremum one is approached as p decreases to zero.
7. 빈 자료와 식별되지 않는 최대Empty data and a nonidentified maximum
Bernoulli 관측이 n=0, k=0입니다. 공집합 곱을 1로 두었을 때 우도·MLE 집합·proper 사전의 사후를 설명하세요.
There are n=0, k=0 Bernoulli observations. Using the empty-product value one, describe likelihood, the MLE set and the posterior from a proper prior.
풀이와 확인할 이유Solution and explanation
우도는 모든 허용 p에서 1입니다. 모든 모수가 최대이므로 유일한 추정값을 고를 근거가 없습니다. 사전×1을 정규화하면 원래 proper 사전 그대로입니다. 0/0인 k/n을 계산해 p=0으로 채우지 않습니다.
Likelihood equals one at every admissible p. Every parameter maximizes it, with no unique estimate. A proper prior remains unchanged. The undefined ratio k/n should not be filled with zero.
8. 서로 다른 이름이 같은 관측법칙을 줄 때Different labels for the same observation law
θ∈[−1, 1]이고 X|θ는 Bernoulli(θ²)입니다. n=4, k=1의 iid 기록에서 θ의 최대 집합을 구하고 식별 문제를 설명하세요.
Let θ∈[−1, 1] and X|θ be Bernoulli(θ²). For n=4, k=1 iid records, find the MLE set and explain identification.
풀이와 확인할 이유Solution and explanation
관측법칙의 성공확률 p=θ²는 1/4에서 최대입니다. 따라서 θ=−1/2와 1/2가 모두 최대입니다. 부호가 반대인 θ가 같은 모든 관측법칙을 주므로 모형은 θ의 부호를 식별하지 못합니다. 더 많은 같은 종류의 자료도 이 대칭을 없애지 않습니다.
The success probability is maximized at p=θ²=1/4, so both θ=−1/2 and 1/2 maximize likelihood. Opposite signs give identical observation laws. More data of this same type cannot identify the sign.
9. 밀도 높이가 1을 넘을 때A density height above one
X가 N(0, 0.1²)일 때 x=0의 밀도와 P(X=0)을 구하세요. 그 밀도를 관측 x=0의 평균 모수에 대한 우도로 읽을 때에도 1 이하이어야 하나요?
For X∼N(0, 0.1²), find the density at zero and P(X=0). Must that density, read as a likelihood for an unknown mean at observation zero, be at most one?
풀이와 확인할 이유Solution and explanation
밀도는 1/[0.1√(2π)]≈3.989423이고 점확률은 0입니다. 밀도의 단위는 입력 단위의 역수이며, 작은 구간의 면적이 확률입니다. 연속 자료 우도는 밀도값이므로 1을 넘을 수 있습니다. 이를 모수가 참일 확률로 해석하지 않습니다.
The density is approximately 3.989423, but the point probability is zero. Density has inverse input units; areas give probabilities. A continuous-data likelihood is a density value and can exceed one. It is not the probability that a parameter is true.
10. 관측 단위를 바꾼 우도Likelihood under an observation-unit change
연속 iid 자료 x₁, …, xₙ을 yᵢ=1000xᵢ로 단위 변환합니다. 대응하는 모수 재표현을 사용하면 밀도 우도와 MLE는 어떻게 바뀌나요?
Transform continuous iid observations by yᵢ=1000xᵢ. Under the corresponding parameter relabeling, what happens to density likelihood and the MLE?
풀이와 확인할 이유Solution and explanation
각 y 밀도는 x 밀도의 1/1000이므로 결합 우도는 1000⁻ⁿ배입니다. 이는 모수와 무관한 양의 계수여서 같은 관측법칙을 대응시킨 최대 위치는 유지됩니다. 평균·표준편차 모수는 1000배, 분산은 10⁶배로 재표현됩니다. 우도 높이의 수치 자체는 단위에 의존합니다.
Each density gains factor 1/1000, so the joint likelihood gains parameter-independent factor 1000⁻ⁿ. Corresponding maximizers therefore agree. Means and standard deviations scale by 1000, and variances by 10⁶. Numerical likelihood heights depend on observation units.
11. 세 점의 정규 중심 제곱합The centered Gaussian sum of squares for three points
정규 작업 모형에 입력할 자료가 (1, 2, 4)입니다. 평균, 중심 제곱합 S₀와 μ=2일 때 S(2)를 손으로 계산하세요.
For observations (1, 2, 4), calculate their mean, centered sum S₀ and the sum S(2) around μ=2.
The mean is 7/3 and deviations are −4/3, −1/3, 5/3. Their squared sum is 14/3. Around two, the squared deviations are 1, 0, 4, so S(2)=5. The decomposition 14/3+3(2−7/3)² gives the same result.
12. 정규 평균 탐색점의 로그우도 차이A Gaussian log-likelihood difference
독립 N(μ, v) 관측 (1, 2, 4)에서 v=1을 고정합니다. μ=7/3과 μ=2의 로그우도 차이와 우도비를 구하세요.
For independent N(μ, v) observations (1, 2, 4), fix v=1. Find the log-likelihood difference and likelihood ratio comparing μ=7/3 with μ=2.
풀이와 확인할 이유Solution and explanation
μ와 무관한 항이 소거되어 차이는 [S(2)−S(7/3)]/2=(5−14/3)/2=1/6입니다. 따라서 첫 모수 대 두 번째 우도비는 exp(1/6)입니다. 로그 차이를 곧 확률 차이라고 부르지 않습니다.
The common terms cancel. The log difference is (5−14/3)/2=1/6, and the likelihood ratio is exp(1/6). A log-likelihood difference is not a probability difference.
13. 분산의 두 분모Two variance denominators
자료 (1, 2, 4)는 iid 정규 모형에서 왔고 평균과 양의 분산이 모두 미지입니다. ML 분산과 n−1 분모 표본분산을 계산하고 비교하세요.
For iid Gaussian observations (1, 2, 4) with unknown mean and positive variance, calculate ML variance and the n−1 sample variance.
풀이와 확인할 이유Solution and explanation
n=3, S₀=14/3이므로 ML 분산은 14/9입니다. 표본분산은 (14/3)/2=7/3입니다. 첫 번째는 로그우도 최대에서 나오고 두 번째의 불편성은 iid 유한분산 반복표집에서 나옵니다. 서로 다른 기준을 사용한 값이며 ML 계산이 불편성을 자동 보장하지 않습니다.
With n=3 and S₀=14/3, the ML variance is 14/9; the sample variance is 7/3. Maximization gives the first, while iid finite-variance repeated-sampling unbiasedness motivates the second. They optimize different criteria.
14. 상수 자료의 분산 최대는 어디에 있는가Where is the variance maximum for constant data?
독립 N(μ, v), v>0 모형에서 자료가 (2, 2, 2)입니다. (μ, v)=(2, 0)을 허용되는 MLE라고 보고할 수 있나요?
Independent N(μ, v) observations with v>0 are (2, 2, 2). Can (μ, v)=(2, 0) be reported as an admissible MLE?
풀이와 확인할 이유Solution and explanation
0은 모수공간의 양의 분산이 아닙니다. μ=2에서 SSE=0이고 우도는 (2πv)⁻³ᐟ²이므로 v↓0일 때 무한히 커집니다. 따라서 이 모형 안에는 최대가 없습니다. 분산 0인 점질량으로 확장하는 일은 별도 모형을 정의하는 것입니다.
No: zero is outside the positive-variance parameter space. At μ=2, the likelihood (2πv)⁻³ᐟ² grows without bound as v decreases to zero. No maximum exists in this model. Adding a zero-variance point mass defines a different model.
15. score가 0이어도 최대가 아닐 수 있다A zero score need not be a maximum
Let X|θ∼N(θ²−1, 1), θ∈ℝ, and observe x=0. Find and classify the stationary log-likelihood points.
풀이와 확인할 이유Solution and explanation
상수를 제외하면 ℓ(θ)=−(θ²−1)²/2이고 ℓ′=−2θ(θ²−1)입니다. 정지점은 −1, 0, 1입니다. ±1에서는 제곱 손실이 0이라 전역 최대입니다. 0에서는 가까운 비영 θ가 더 큰 로그우도를 주므로 국소 최소입니다. score=0만 검사해 최대라고 결론내리지 않습니다.
Ignoring a constant, ℓ=−(θ²−1)²/2 and ℓ′=−2θ(θ²−1). The stationary points are −1, 0, 1. The two stationary points ±1 are global maxima with zero squared loss; zero is a local minimum. A zero score alone is insufficient.
16. 정규 관측 하나One Gaussian observation
양의 미지 분산 v와 미지 평균 μ인 정규 모형에 관측 x=5 하나만 있습니다. 평균을 5로 둘 때 v의 우도와 ML 최대 존재 여부를 설명하세요.
A normal model has unknown mean μ and positive unknown variance v. The only observation is five. Describe likelihood along μ=5 and whether a joint ML maximum exists.
풀이와 확인할 이유Solution and explanation
잔차가 0이므로 우도는 (2πv)⁻¹ᐟ²입니다. v가 작아질수록 커져 양의 v에서 최대를 달성하지 못합니다. 평균 탐색만 보면 5가 최선이지만 두 모수를 동시에 추정하는 문제에는 최대가 없습니다. n−1 분모 표본분산도 n=1에서 정의되지 않습니다.
With zero residual, the likelihood is (2πv)⁻¹ᐟ² and is unbounded as v decreases to zero. Five maximizes over μ for fixed v, but no joint maximum exists. The n−1 sample variance is also undefined when n=1.
17. 정규 전역 최대의 유도Deriving the global Gaussian maximum
n≥2인 독립 동일 정규 관측에서 S₀=Σ(xᵢ−x̄)²>0입니다. μ와 v>0의 전역 최대가 (x̄, S₀/n)인 이유를 유도하세요.
For n≥2 independent identically normal observations, assume S₀=Σ(xᵢ−x̄)²>0. Derive the unique global maximum over μ and v>0.
풀이와 확인할 이유Solution and explanation
고정 v에서는 S(μ)=S₀+n(μ−x̄)²가 x̄에서 유일하게 최소여서 우도를 최대화합니다. 그 값을 대입한 로그우도의 변화율을 계산합니다.
The derivative changes from positive to negative at S₀/n. The profile tends to −∞ at both positive-variance boundaries, so (x̄, S₀/n) is the unique global maximum. The positive S₀ assumption excludes constant-data failure.
18. 세 후보의 같은 사전Equal priors on three candidates
iid Bernoulli 기록 (1, 0, 0, 0)에 후보 p=(1/4, 1/2, 3/4)와 사전 (1/3, 1/3, 1/3)을 둡니다. 사후 후보 확률을 구하세요.
For iid Bernoulli records (1, 0, 0, 0), use p=(1/4, 1/2, 3/4) with prior probabilities (1/3, 1/3, 1/3). Find their posterior probabilities.
풀이와 확인할 이유Solution and explanation
순서 우도는 (27, 16, 3)/256입니다. 사전의 공통 1/3도 소거되므로 사후는 (27, 16, 3)/46입니다. 우도가 가장 큰 후보와 사후가 가장 큰 후보는 이 경우 일치하지만, 사후가 1이 된 것은 아닙니다.
The ordered likelihoods are (27, 16, 3)/256. The common prior factor cancels, giving posterior (27, 16, 3)/46. The largest-likelihood candidate also has the largest posterior here, but its posterior is not one.
19. 다른 사전을 곱하는 손계산Multiply unequal priors by hand
iid Bernoulli 기록 (1, 0, 0, 0)의 후보 p=(1/4, 1/2, 3/4)에 사전 (1/2, 1/3, 1/6)을 둡니다. 정규화 전과 후의 값을 구하세요.
For iid Bernoulli records (1, 0, 0, 0), assign prior (1/2, 1/3, 1/6) to p=(1/4, 1/2, 3/4). Find unnormalized and normalized posterior weights.
풀이와 확인할 이유Solution and explanation
우도 (27, 16, 3)/256에 사전을 곱하면 공통 분모 1536에서 (81, 32, 3)입니다. 합은 116/1536이고 사후는 (81, 32, 3)/116입니다. 후보별 사전×우도를 먼저 계산하고 마지막에 한 번 전체 합으로 나누는 순서입니다.
Multiplying likelihoods (27, 16, 3)/256 by priors gives (81, 32, 3)/1536. Their sum is 116/1536, and the posterior is (81, 32, 3)/116. Normalize only after calculating all prior-times-likelihood contributions.
20. 주변 증거의 정규화Normalizing marginal evidence
후보 p=(1/4, 1/2, 3/4), 같은 사전, iid 기록 (1, 0, 0, 0)에서 관측의 주변 확률을 구하세요. 성공 수 K=1을 대신 관측하면 어떻게 바뀌나요?
Use equal priors on p=(1/4, 1/2, 3/4) and iid records (1, 0, 0, 0). Find the marginal observation probability. What changes if only K=1 is observed?
풀이와 확인할 이유Solution and explanation
순서 기록의 주변 확률은 (27+16+3)/(3·256)=23/384입니다. 성공 수 사건은 네 순서를 합쳐 4배인 23/96입니다. 두 사건의 증거는 다르지만 후보마다 같은 계수 4를 곱하므로 사후 후보 확률은 같습니다. 우도와 사전이 제대로 지정되어야 이 정규화를 확률이라고 부를 수 있습니다.
The ordered-record evidence is 46/(3·256)=23/384. The count event includes four orders, so its evidence is 23/96. These observation probabilities differ, but the common factor cancels from all posterior candidate weights.
21. 사전이 0인 후보A candidate with zero prior probability
Bernoulli 후보 p=(1/4, 1/2, 3/4)의 사전이 (0, 1/2, 1/2)이고 n=4, k=1입니다. 첫 후보의 우도가 양수이면 사후에서 되살아나나요?
Bernoulli candidates p=(1/4, 1/2, 3/4) have prior (0, 1/2, 1/2), with n=4, k=1. Does positive likelihood revive the first candidate?
풀이와 확인할 이유Solution and explanation
정규화 전 첫 값은 0·27/256=0입니다. 나머지 두 값의 합이 양수이므로 사후는 (0, 16/19, 3/19)입니다. 사전 확률 0인 후보는 양의 유한 우도만으로 되살아나지 않습니다. 후보 공간을 제외하는 선택에는 그만큼 강한 가정이 들어 있습니다.
Its prior-times-likelihood contribution remains zero. The other contributions normalize to posterior (0, 16/19, 3/19). A zero-prior candidate is not revived by positive finite likelihood. Excluding a possibility is a substantive assumption.
22. 모든 후보가 관측을 불가능하게 만들 때When every candidate excludes the observation
iid Bernoulli 두 번에서 (1, 0)을 얻었으나 후보는 p=0과 1뿐이고 각 사전은 1/2입니다. Bayes 식을 계산하고 문제를 진단하세요.
Two iid Bernoulli observations are (1, 0), but the only candidates are p=0 and p=1 with equal priors. Evaluate Bayes’ formula and diagnose the result.
풀이와 확인할 이유Solution and explanation
양 후보 모두 p(1−p)=0이라 증거도 0입니다. 0/0을 계산해야 하므로 이 관측에 대한 사후는 선언한 모형 안에서 정의되지 않습니다. 반반으로 다시 채우는 것은 정당한 Bayes 갱신이 아닙니다. 후보·관측 모형의 불일치를 확인해야 합니다.
Both likelihoods p(1−p) are zero, so evidence is zero. Bayes’ ratio is undefined; assigning equal posterior probabilities does not repair the specified model. Reconsider its candidate support or observation assumptions.
Candidates p=(1/4, 1/2, 3/4) have prior (1/2, 1/3, 1/6), and there are no observations. Find likelihoods, evidence and posterior.
풀이와 확인할 이유Solution and explanation
각 공집합 우도가 1이므로 사전×우도는 사전 그대로입니다. 그 합은 1이고 사후도 (1/2, 1/3, 1/6)입니다. 빈 관측은 선택한 proper 사전을 변화시키지 않습니다. 이는 부적절 사전을 정규화해 준다는 명제가 아닙니다.
Every empty-data likelihood is one. Evidence is the prior sum one, and the posterior is unchanged. This statement uses a proper prior; empty data do not normalize an improper one.
24. 두 번의 순차 갱신Two sequential updates
후보 p=(1/4, 1/2, 3/4)의 사전이 같습니다. 동일 p를 주면 두 관측이 iid이고, 첫 관측은 1, 두 번째는 0입니다. 순차 갱신과 한 번의 결합 갱신을 비교하세요.
Start with equal priors on p=(1/4, 1/2, 3/4). Two observations are iid conditional on p: the first is one and the second zero. Compare sequential and joint updating.
풀이와 확인할 이유Solution and explanation
첫 성공 뒤 사후는 (1/6, 1/3, 1/2)입니다. 실패 우도 (3/4, 1/2, 1/4)를 곱하면 (1/8, 1/6, 1/8), 합은 5/12입니다. 정규화하면 (3/10, 2/5, 3/10)입니다. 처음부터 p(1−p)에 같은 사전을 곱해도 (3, 4, 3)/10으로 같습니다. 같은 관측을 두 번 복사해서 새 증거라고 쓰는 경우는 아닙니다.
After success the posterior is (1/6, 1/3, 1/2). Multiplying by failure likelihoods gives (1/8, 1/6, 1/8), with sum 5/12. The normalized result is (3/10, 2/5, 3/10), matching a joint p(1−p) update. These are two observations, not a copied observation counted twice.
25. 연속 사전의 정규화Normalizing a continuous prior
0<p<1에서 사전밀도가 1이고 iid Bernoulli 성공 하나를 관측했습니다. 사후밀도와 사후평균을 직접 적분하세요.
A uniform density on 0< p<1 is updated by one Bernoulli success. Integrate directly to find posterior density and mean.
풀이와 확인할 이유Solution and explanation
정규화 전 식은 p이고 적분은 1/2이므로 사후밀도는 2p입니다. 평균은 ∫₀¹p·2p dp=2/3입니다. 이는 Beta(2, 1) 사후입니다. 밀도 2p의 최대 높이는 2에 접근하지만 점 p=1의 확률은 0이며, 높이를 확률로 읽지 않습니다.
The unnormalized density p integrates to 1/2, so the posterior is 2p, a Beta(2, 1) density. Its mean is ∫₀¹2p²dp=2/3. Density heights approaching two do not imply positive point probability at p=1.
26. Beta 공액 갱신A conjugate Beta update
p의 사전이 Beta(1, 1)이고 조건부 iid Bernoulli 자료 n=4, k=1입니다. 사후의 두 모수와 밀도 식을 구하세요.
A Beta(1, 1) prior is updated by n=4, k=1 conditionally iid Bernoulli observations. Find both posterior shapes and its density.
풀이와 확인할 이유Solution and explanation
사전의 지수는 각각 0이고 우도는 p(1−p)³입니다. 따라서 사후는 Beta(2, 4)입니다. B(2, 4)=1/20이므로 사후밀도는 20p(1−p)³입니다. 실제로 ∫₀¹p(1−p)³dp=1/20이라 전체 적분은 1입니다.
The likelihood contributes powers p¹(1−p)³, so the posterior is Beta(2, 4). Since B(2, 4)=1/20, its density is 20p(1−p)³ and integrates to one.
27. 사후평균의 가중 평균 표현A weighted-average posterior mean
a, b>0, n≥1이고 Beta(a, b) 사전과 iid Bernoulli 성공 수 k를 사용합니다. 사후평균을 사전평균과 표본비율의 가중 평균으로 나타내세요. 이 표현이 사전이 실제 관측 a+b개였다는 뜻인가요?
For a, b>0, n≥1, a Beta(a, b) prior and n conditionally iid Bernoulli observations with k successes, express the posterior mean using prior mean and sample proportion. Are a+b actual observed records?
풀이와 확인할 이유Solution and explanation
분자를 나누면 다음과 같습니다.
a+b+na+k=a+b+na+ba+ba+a+b+nnnk.
두 가중치는 양수이고 합이 1입니다. 이는 유용한 대수적 해석이지만 a, b가 실제 조사기록 수라는 뜻은 아닙니다. n=0에서는 k/n을 쓰지 않고 원 사전평균을 그대로 사용합니다.
Split its numerator:
a+b+na+k=a+b+na+ba+ba+a+b+nnnk.
The positive weights sum to one. This is an algebraic interpretation, not evidence of a+b real survey observations. For n=0, use the prior mean directly without k/n.
28. Beta 두 모멘트와 분산Two Beta moments and variance
사후 p∼Beta(2, 4)일 때 E[p], E[p²], Var(p)를 구하고 E[p²]와 E[p]²를 비교하세요.
For posterior p∼Beta(2, 4), find E[p], E[p²] and Var(p), and compare E[p²] with E[p]².
풀이와 확인할 이유Solution and explanation
A=2, B=4, S=6이므로 평균은 2/6=1/3이고 두 번째 모멘트는 2·3/(6·7)=1/7입니다. 분산은 1/7−1/9=2/63입니다. 따라서 E[p²]는 E[p]²보다 엄격히 큽니다. 양의 모수 Beta는 퇴화하지 않아 이 차이가 0이 아닙니다.
The mean is 2/6=1/3 and the second moment is 2·3/(6·7)=1/7. Variance is 1/7−1/9=2/63. The second moment strictly exceeds the squared mean because this proper positive-shape Beta is nondegenerate.
29. 밀도의 봉우리 조건을 나누기Classifying density peaks
Beta(2, 4), Beta(1, 1), Beta(1/2, 1/2), Beta(1, 1/2)의 표준 밀도 봉우리를 비교하세요. (A−1)/(A+B−2)를 모두에 대입해도 되나요?
Compare canonical density peaks for Beta(2, 4), Beta(1, 1), Beta(1/2, 1/2) and Beta(1, 1/2). Can (A−1)/(A+B−2) be used for all four?
풀이와 확인할 이유Solution and explanation
Beta(2, 4)는 안쪽 p=1/4에서 유일한 최대입니다. Beta(1, 1)은 모든 안쪽 점에서 같은 높이입니다. Beta(1/2, 1/2)는 양 끝에 접근할 때 밀도가 발산하고 Beta(1, 1/2)는 오른쪽 끝에서 발산합니다. 끝점 극한이 무한이어도 점질량은 0입니다. 안쪽 공식은 A, B>1인 경우에 적용하고 나머지 경우는 별도로 분류합니다.
The first has its unique interior peak at 1/4; the second is flat. The third diverges at both endpoint limits, and the fourth at the right endpoint. Such limits do not create point masses. The interior formula applies when both shapes exceed one; other cases need separate classification.
30. 모두 실패한 뒤의 양수 평균A positive mean after all failures
Beta(1, 1) 사전에 iid Bernoulli 실패 10개를 갱신합니다. ML 추정값, 사후평균, 사후분산과 p=0의 사후 점확률을 비교하세요.
Update Beta(1, 1) with ten iid Bernoulli failures. Compare the closed-space MLE, posterior mean, variance and posterior point probability at p=0.
풀이와 확인할 이유Solution and explanation
닫힌 [0, 1] 모수공간의 MLE는 0입니다. 사후는 Beta(1, 11)이라 평균은 1/12>0이고 분산은 11/(12²·13)=11/1872입니다. 연속 사후의 p=0 점확률은 0입니다. 양의 사후평균과 경계 ML 추정은 다른 양이며, 평균이 작아 표시가 0으로 반올림되는 경우도 정확한 0과 구별합니다.
The MLE on [0, 1] is zero. The posterior Beta(1, 11) has mean 1/12>0 and variance 11/1872. Its point probability at p=0 is zero. The posterior mean and boundary MLE answer different questions, and a rounded display zero is not an exact zero.
31. 매우 작은 proper 사전과 계산 범위A tiny proper prior and a numerical limit
관측이 없고 a=b=10⁻⁴⁰⁰인 Beta 사전입니다. 사전은 확률분포인가요? 평균과 분산을 쓰고, 실습이 CDF 근사를 제공하지 않을 때의 의미를 설명하세요.
With no observations, a=b=10⁻⁴⁰⁰ defines a Beta prior. Is it a probability distribution? Give its mean and variance, and interpret an unavailable numerical CDF.
풀이와 확인할 이유Solution and explanation
두 모수가 정확히 양수여서 proper 분포입니다. 평균은 1/2이고 분산은 1/[4(1+2·10⁻⁴⁰⁰)]로 1/4에 아주 가깝습니다. 밀도는 양 끝에 크게 몰리지만 점질량은 없습니다. CDF 근사를 제공하지 않는 것은 구현의 수치 범위 제한이며 분포 부재가 아닙니다. 입력을 먼저 일반 부동소수점으로 바꾸어 0으로 만드는 일과도 구별합니다.
Both exact shapes are positive, so the law is proper. Its mean is 1/2 and variance 1/[4(1+2·10⁻⁴⁰⁰)], close to 1/4. Endpoint concentration is not point mass. An unavailable CDF approximation reflects implementation limits, not absence of a law; prematurely converting the inputs to displayed zero is a separate issue.
32. 사후구간의 확률 면적Posterior interval probability as area
p의 사후가 Uniform(0, 1)입니다. 95% 등꼬리 사후구간과 그 안의 사후질량을 구하고 P(p=1/2|x)와 비교하세요.
The posterior for p is Uniform(0, 1). Find its 95% equal-tail interval and mass, and compare P(p=1/2|x).
풀이와 확인할 이유Solution and explanation
구간은 [0.025, 0.975]이고 길이 0.95가 사후질량입니다. 각 꼬리는 0.025입니다. 한 점의 확률은 0입니다. 양 끝을 포함하거나 빼도 이 연속 법칙의 구간질량은 같지만, 일반 원자 사후에서는 끝점 포함을 따로 확인해야 합니다.
The interval is [0.025, 0.975], with posterior mass 0.95 and each tail 0.025. A single point has probability zero. Endpoint inclusion does not change these continuous-law masses, but it matters for an atomic posterior.
33. 사후질량과 반복표집 포함률Posterior mass versus sampling coverage
참 p₀=0인 iid Bernoulli 모형을 [0, 1]에서 생각합니다. Beta(a, b), a, b>0 사전의 95% 등꼬리 사후구간을 매 표본에서 만듭니다. 이 경계에서 빈도주의 포함률이 얼마인지 설명하세요.
Consider iid Bernoulli sampling at true p₀=0 on [0, 1]. From a Beta(a, b) prior with a, b>0, form a 95% equal-tail posterior interval for each sample. What is frequentist coverage at this boundary?
풀이와 확인할 이유Solution and explanation
유한 n에서 자료는 확률 1로 모두 0입니다. 사후 Beta(a, b+n)의 0.025 분위수는 엄격히 양수여서 구간이 참 0을 포함하지 않습니다. 따라서 포함률은 0입니다. 각 사후구간의 모형 내 사후질량 0.95와는 다른 확률입니다. 이 반례는 모든 베이지안 구간이 나쁘다는 결론이 아니라 두 보장이 같지 않다는 뜻입니다.
Every finite sample is all zero with probability one. The Beta(a, b+n) posterior has a strictly positive 0.025 quantile, so the interval excludes zero. Coverage is zero despite posterior mass 0.95. The example separates two kinds of probability; it is not a blanket judgment about all Bayesian intervals.
34. 제곱손실의 사후 최적 결정The posterior squared-loss decision
p의 사후가 Beta(2, 4)입니다. 점 결정 d의 사후 제곱손실 E[(p−d)²|x]를 분해하고 d=1/3과 d=1/4의 위험 차이를 구하세요.
The posterior is Beta(2, 4). Decompose posterior squared risk for decision d and compare d=1/3 with d=1/4.
따라서 사후평균이 제곱손실을 유일하게 최소화합니다. 밀도 봉우리인 MAP=1/4가 이 손실의 최적 결정은 아닙니다.
The mean is 1/3 and variance 2/63. Centering eliminates the cross term:
E[(p−d)2∣x]R(1/4)−R(1/3)=2/63+(1/3−d)2,=1/144.
The posterior mean uniquely minimizes squared loss. The density MAP at 1/4 solves a different optimization problem.
35. 절대손실의 결정An absolute-loss decision
p의 사후가 Uniform(0, 1)이고 결정 d∈[0, 1]의 손실이 |p−d|입니다. 사후 기대손실을 적분해 최적 d를 찾으세요.
Let the posterior be Uniform(0, 1), with loss |p−d| for d∈[0, 1]. Integrate posterior expected loss and find its minimum.
풀이와 확인할 이유Solution and explanation
d의 왼쪽과 오른쪽을 나누면 기대손실은 d²/2+(1−d)²/2=(d−1/2)²+1/4입니다. 따라서 d=1/2가 유일한 최소입니다. 이 예에서는 평균과 중앙값이 같지만, 일반적인 절대손실의 최소는 사후 중앙값이며 제곱손실과 항상 같은 결정을 주지는 않습니다.
Splitting the integral at d gives d²/2+(1−d)²/2=(d−1/2)²+1/4. The unique optimum is 1/2. Here mean and median coincide; generally posterior medians minimize absolute loss, and need not equal squared-loss decisions.
36. MLE·MAP·사후평균을 한 번에 비교Compare MLE, MAP and posterior mean
n=4, k=1의 iid Bernoulli 자료, 닫힌 모수공간과 Beta(1, 1) 사전에서 MLE, MAP, 사후평균을 비교하세요. 세 값이 같아야 하나요?
For n=4, k=1 iid Bernoulli data, a closed parameter space and a Beta(1, 1) prior, compare MLE, MAP and posterior mean. Must all three agree?
풀이와 확인할 이유Solution and explanation
MLE는 1/4입니다. 사후 Beta(2, 4)의 밀도 봉우리도 1/4여서 이 경우 MAP는 MLE와 같습니다. 사후평균은 1/3입니다. 사전이 균일한 좌표에서 최대들이 일치할 수 있어도, 제곱손실 결정과 모수의 불확실성 평균은 다른 기준입니다. 좌표를 바꾸면 MAP의 일치도 유지되지 않을 수 있습니다.
The MLE is 1/4. The posterior Beta(2, 4) also peaks at 1/4, so MAP agrees here. Its mean is 1/3. Maximum density and minimum posterior squared loss are different criteria; MAP’s coordinate dependence adds another distinction.
37. logit 좌표의 밀도Density in logit coordinates
p의 사후가 Uniform(0, 1)이고 η=log[p/(1−p)]입니다. 새 사후밀도와 봉우리를 구하고 p 좌표의 MAP 집합과 비교하세요.
A posterior is Uniform(0, 1) in p. Set η=log[p/(1−p)]. Find its transformed density and peak, and compare the MAP set in p coordinates.
풀이와 확인할 이유Solution and explanation
역함수 p=(1+e⁻η)⁻¹는 매끄럽고 dp/dη=p(1−p)입니다. 원밀도 1에 곱해 η 밀도는 p(1−p)가 됩니다. 이 식은 p=1/2, 즉 η=0에서 유일하게 최대입니다. 원 p 밀도는 모든 안쪽 점에서 최대였습니다. 확률 면적은 일관되게 변환되지만 밀도 높이의 최대는 좌표에 의존합니다.
The smooth inverse p=(1+e⁻η)⁻¹ has derivative p(1−p). Thus the η density is p(1−p), uniquely maximized at p=1/2 or η=0. The original density was flat at all interior points. Probability areas transform consistently while density maxima depend on coordinates.
38. 부적절 사전의 사후 적절성Posterior propriety from an improper prior
형식 사전 π(p)∝1/[p(1−p)]를 0<p<1에서 사용합니다. iid Bernoulli 자료 (n, k)=(4, 1), (4, 0), (0, 0) 각각에서 사후 정규화가 가능한지 판정하세요.
Use the formal prior proportional to 1/[p(1−p)] on 0< p<1. For iid Bernoulli (n, k)=(4, 1), (4, 0), (0, 0), decide whether the formal posterior normalizes.
풀이와 확인할 이유Solution and explanation
형식 사후는 pᵏ⁻¹(1−p)ⁿ⁻ᵏ⁻¹에 비례합니다. (4, 1)은 p⁰(1−p)²여서 적분이 유한하고 Beta(1, 3)로 정규화됩니다. (4, 0)은 0 근처에서 p⁻¹처럼 발산해 적분 불가입니다. 빈 자료도 원래의 발산 적분을 그대로 남깁니다. proper Beta의 0 모수 극한 관례를 이 형식 갱신의 정당화로 쓰지 않습니다.
Its kernel is pᵏ⁻¹(1−p)ⁿ⁻ᵏ⁻¹. The first case normalizes to Beta(1, 3). The all-zero case has a nonintegrable p⁻¹ endpoint, and empty data retain the improper prior. Software conventions for zero-shape limits are not a posterior-propriety proof.
39. 적분 가능한 무한 밀도An integrable infinite density limit
Beta(1/2, 1/2) 사전에 Bernoulli 실패 하나를 갱신합니다. 사후 모수와 평균을 구하고 0에서 밀도가 발산해도 확률분포인 이유를 설명하세요.
Update Beta(1/2, 1/2) with one Bernoulli failure. Find posterior shapes and mean, and explain why an infinite density limit at zero does not prevent a proper law.
풀이와 확인할 이유Solution and explanation
사후는 Beta(1/2, 3/2), 평균은 (1/2)/2=1/4입니다. 0 근처에서 밀도는 상수배 p⁻¹ᐟ²와 비슷하고 ∫₀ᵋp⁻¹ᐟ²dp=2√ε가 유한합니다. 높이의 무한 극한과 면적의 유한성은 양립합니다. p=0의 점질량은 여전히 0입니다.
The posterior is Beta(1/2, 3/2), with mean 1/4. Near zero its density behaves as a constant times p⁻¹ᐟ², whose integral from zero to ε is 2√ε. An infinite endpoint height can have finite area; the endpoint point mass remains zero.
40. 다음 두 번 모두 성공Two future successes
사후가 Beta(2, 4)이고 미래 Y₁*, Y₂*는 같은 p를 주면 iid Bernoulli(p)이며 과거와도 조건부 독립입니다. 두 성공의 공동확률, plug-in 값과 미래 공분산을 구하세요.
The posterior is Beta(2, 4). Future Y₁*, Y₂* are iid Bernoulli(p) conditional on shared p, and conditionally independent of the past. Find their joint success probability, plug-in value and covariance.
풀이와 확인할 이유Solution and explanation
공동확률은 E[p²]=1/7입니다. 사후평균을 고정한 plug-in 값은 (1/3)²=1/9입니다. 두 값의 차이이자 Cov(Y₁*, Y₂*|x)는 Var(p)=2/63입니다. 양의 의존은 같은 미지 p를 공유하는 사후 혼합에서 생기며, 조건부 iid 가정과 모순되지 않습니다.
The joint probability is E[p²]=1/7, whereas posterior-mean plug-in gives 1/9. Their difference and the future covariance are Var(p)=2/63. Shared-parameter mixing creates positive marginal dependence without contradicting conditional independence.
41. 미래 두 번의 전체 질량The full law of two future trials
p|x∼Beta(2, 4)이고 p와 관측 자료 x를 주면 미래 두 번은 iid Bernoulli(p)입니다. K*=Y₁*+Y₂*의 세 질량과 평균·분산을 구하세요.
Given p|x∼Beta(2, 4), two future trials are iid Bernoulli(p) conditional on p and observed data x. Find the three masses, mean and variance of K*=Y₁*+Y₂*.
The masses sum to one. A plug-in binomial at p=1/3 matches the mean but not variance.
42. 사후가 균일할 때의 예측Prediction under a uniform posterior
p|x∼Uniform(0, 1)이고 p와 관측 자료 x를 주면 미래 두 번은 iid Bernoulli(p)입니다. K*의 질량과 plug-in Binomial(2, 1/2)을 비교하세요.
Let p|x∼Uniform(0, 1), with two future iid Bernoulli(p) trials conditional on p and observed data x. Compare their count law with plug-in Binomial(2, 1/2).
풀이와 확인할 이유Solution and explanation
E[p²]=1/3, E[(1−p)²]=1/3, 2E[p(1−p)]=1/3이라 세 질량이 같습니다. plug-in은 (1/4, 1/2, 1/4)입니다. 두 법칙 모두 평균 1이지만 분산은 각각 2/3과 1/2입니다. 미지 p를 적분하는 것과 먼저 평균으로 고정하는 것은 교환되지 않습니다.
The count probabilities are equal thirds because E[p²]=E[(1−p)²]=2E[p(1−p)]=1/3. Plug-in gives (1/4, 1/2, 1/4). Both means are one, but variances are 2/3 and 1/2. Integrating a shared parameter differs from fixing its mean.
43. 총분산으로 예측 분산 유도Derive predictive variance by total variance
사후 p의 평균 μ와 유한 분산 v가 있고 p와 관측 자료 x를 주면 미래 m≥1번은 iid Bernoulli(p)입니다. K*의 분산을 총분산으로 유도하세요.
A posterior for p has mean μ and variance v. There are m≥1 future iid Bernoulli(p) trials conditional on p and observed data x. Derive the variance of their count.
The extra term vanishes at m=1 and is positive when m>1, v>0. This result uses the stated conditional-iid mixture, not arbitrary dependence.
44. 미래 0회와 보조 두 관측Zero future trials and an auxiliary two-trial question
사후가 Beta(2, 4)이고 예측할 횟수 m=0입니다. 별도로 정의하는 미래 관측들은 공유 p 아래 조건부 iid Bernoulli(p)이며 전체 과거 자료와 조건부 독립입니다. 0회 성공 수의 평균·분산·질량과 가상 다음 두 번의 공동성공확률을 구별하세요.
With posterior Beta(2, 4), set future count m=0. Separately defined future observations are conditionally iid Bernoulli(p) at shared p and conditionally independent of the entire past. Distinguish the zero-trial count’s masses, moments and the hypothetical next-two success probability.
풀이와 확인할 이유Solution and explanation
0회 성공 수는 항상 0이므로 질량 P(K*=0)=1, 평균과 분산은 0입니다. 별도로 두 미래 관측을 정의하면 공동성공확률은 1/7입니다. 이는 m=0 성공 수의 사건이 아니라 다른 예측 질문입니다. 화면의 보조 수치를 같은 분포의 추가 행처럼 읽지 않습니다.
The zero-trial count is identically zero, with mass one at zero and zero mean/variance. Separately defining two future trials gives joint success probability 1/7. That auxiliary question is not an event of the zero-trial count law.
45. 모수 분산과 관측 분산Parameter variance versus observation variance
p|x∼Beta(2, 4)이고 새 Y*|p∼Bernoulli(p)입니다. Var(p|x)와 Var(Y*|x)를 구하고 단위·대상을 설명하세요.
Let p|x∼Beta(2, 4) and Y*|p∼Bernoulli(p). Compare Var(p|x) with Var(Y*|x) and explain their targets.
풀이와 확인할 이유Solution and explanation
모수 분산은 2/63입니다. 새 이진 관측은 주변 성공확률 1/3인 Bernoulli라 분산은 2/9입니다. p와 0/1 지시값이 무차원이므로 두 분산도 무차원이지만, 측정 대상은 다릅니다. 전자는 미지 확률 p의 사후 불확실성이고 후자는 실제로 나올 관측의 예측 변동입니다. 사후가 집중하더라도 p가 안쪽이면 한 새 관측의 변동은 사라지지 않습니다.
Parameter variance is 2/63. The single future binary observation has marginal success probability 1/3 and variance 2/9. Both are dimensionless because p and a binary indicator are dimensionless, but their targets differ. One measures uncertainty about p; the other measures future 0/1 variation. Concentrating a posterior does not eliminate observation variation at an interior success probability.
46. 작은 표본에서 사전을 바꾸기Changing priors in a small sample
Bernoulli 성공 하나를 관측했습니다. Beta(1, 1), Beta(2, 2), Beta(1, 9) 사전의 사후평균을 구하고 비교하세요.
Observe one Bernoulli success. Find posterior means from Beta(1, 1), Beta(2, 2) and Beta(1, 9) priors.
풀이와 확인할 이유Solution and explanation
사후는 각각 Beta(2, 1), Beta(3, 2), Beta(2, 9)이므로 평균은 2/3, 3/5, 2/11입니다. 같은 자료에서도 사전 중심과 강도가 달라 결과가 다릅니다. 이 차이는 실수라 숨길 것이 아니라 선택 가정을 공개할 이유입니다. 사전을 바꿔 본 것은 새 자료를 얻은 일이 아닙니다.
The posteriors are Beta(2, 1), Beta(3, 2) and Beta(2, 9), with means 2/3, 3/5 and 2/11. Different prior centers and strengths produce different results from the same observation. Report that sensitivity rather than hiding it; changing a prior does not add data.
47. 사후 집중의 직접 상계A direct posterior-concentration bound
참 p₀∈[0, 1]에서 iid Bernoulli 표본을 얻고 n과 무관한 고정 Beta(a, b), a, b>0 사전을 사용합니다. 사후평균 μₙ과 분산 vₙ으로 각 고정 ε>0의 사후 바깥 질량이 0으로 확률수렴함을 보이세요.
Suppose observations are iid Bernoulli at p₀∈[0, 1], with a fixed Beta(a, b) prior, a, b>0 independent of n. Use posterior mean μₙ and variance vₙ to prove concentration for every fixed ε>0.
The outer convergence refers to the original repeated-sampling law. It does not assert nominal finite-sample coverage for every posterior interval.
48. 사전이 표본 크기보다 빨리 강해질 때When prior strength grows faster than sample size
참 p₀≠1/2에서 iid Bernoulli 자료를 얻지만 표본 크기마다 사전을 Beta(n², n²)로 바꿉니다. 사후평균의 극한을 구하고 고정 사전 조건이 필요한 이유를 설명하세요.
At true p₀≠1/2, observe iid Bernoulli data but choose Beta(n², n²) at each sample size. Find the posterior-mean limit and explain the fixed-prior condition.
풀이와 확인할 이유Solution and explanation
사후평균은 (n²+k)/(2n²+n)=(1+k/n²)/(2+1/n)입니다. 0≤k≤n이라 k/n²→0이므로 극한은 1/2입니다. 참 p₀로 가지 않습니다. 앞의 집중 증명은 a, b를 고정했으며, 이 예처럼 사전의 강도를 더 빨리 늘리는 설정을 포함하지 않습니다.
The mean is (n²+k)/(2n²+n)=(1+k/n²)/(2+1/n). Since 0≤k≤n, the limit is 1/2 rather than p₀. The previous concentration argument fixes its prior shapes and does not cover this growing-prior sequence.
49. 정확한 0과 표시된 0Exact zero versus displayed zero
두 결과가 화면에서 0으로 보입니다. 하나는 모든 후보의 관측 우도가 정확히 0인 사후 정규화이고, 다른 하나는 proper Beta의 양수 꼬리가 표시 범위 아래인 경우입니다. 해석을 비교하세요.
Two screens show zero: one for posterior normalization when every candidate likelihood is exactly zero, and another for a positive tail of a proper Beta law below numeric display range. Compare them.
풀이와 확인할 이유Solution and explanation
첫 경우에는 증거 0 때문에 사후 비율이 정의되지 않습니다. 두 번째는 적절한 분포의 양수 꼬리가 존재하지만 일반 숫자 표시가 그 값을 보존하지 못한 것입니다. 유한 로그확률이나 양수 상태가 이를 구별할 수 있습니다. 작은 사후 모수의 CDF 계산이 지원되지 않는 경우는 또 다른 계산 범위 제한입니다.
Zero evidence makes the first posterior ratio undefined. The second law is proper and its tail positive, but numeric display loses the value; its log probability or positive status can distinguish this. Unsupported CDF approximation for extreme shapes is yet another computational limitation.
50. 세 가지 성공을 혼동하지 않기Do not confuse three kinds of success
수치 최적화가 종료됐고 사후 계산도 안정된 그림을 보였습니다. 이것만으로 모수가 식별되고 고객 예측이 실제 미래에 맞는다고 결론내릴 수 있나요?
An optimizer has stopped and posterior calculations show a stable plot. Does this establish identification and accurate future-customer prediction?
풀이와 확인할 이유Solution and explanation
아닙니다. 계산 종료는 선택 알고리즘의 조건에 관한 것이고 식별은 다른 모수가 다른 관측법칙을 주는지의 문제입니다. 미래 타당성은 표적집단·의존·시간 변화·모형 적합을 추가로 다룹니다. 정확히 계산한 잘못된 모형도 있을 수 있습니다. 원자료와 모형 조건, 계산 점검과 외부 검증을 각각 보고합니다.
No. Algorithm termination concerns computation; identification concerns distinct parameters giving distinct observation laws. Future validity additionally concerns target populations, dependence, time change and model fit. A misspecified model can be calculated accurately. Report these checks separately.
51. 16국의 알려진 비율The known fraction among sixteen countries
고정 2024년 16국 중 기대수명 80년 이상인 국가가 8개입니다. 8/16을 계산하려고 미지 Bernoulli p의 사후가 필요한가요? 세계 비율에 대한 해석은요?
Eight of sixteen fixed 2024 countries have life expectancy at least eighty. Is a posterior for unknown Bernoulli p needed to calculate 8/16? What about the world-country proportion?
풀이와 확인할 이유Solution and explanation
고정 목록의 기술 비율은 이미 1/2이므로 사후가 필요 없습니다. 미지 p의 사후는 목록을 어떤 모형의 관측으로 읽는다는 추가 설정입니다. 이 16국이 세계를 대표하는 iid 무작위 표본이라는 근거 없이 그 사후를 세계 비율의 인증된 불확실성으로 해석하지 않습니다.
The fixed-list descriptive fraction is already 1/2. A posterior concerns an additionally declared observation model. Without an established representative iid world-country sample, its posterior cannot be treated as certified uncertainty about the world proportion.
52. 국가 세 후보의 같은 사전 갱신Equal-prior updating for three country candidates
16국의 8개 성공을 iid Bernoulli 작업 모형으로 읽습니다. 후보 p=(1/4, 1/2, 3/4)의 우도가 (6561, 65536, 6561)/4294967296이고 사전이 같을 때 사후와 가운데 대 왼쪽 사후비를 구하세요.
Read eight successes among sixteen countries through an iid Bernoulli working model. Candidate likelihoods at p=(1/4, 1/2, 3/4) are (6561, 65536, 6561)/4294967296. With equal priors, find posteriors and middle-to-left odds.
풀이와 확인할 이유Solution and explanation
공통 분모와 같은 사전이 소거되어 사후는 (6561, 65536, 6561)/78658입니다. 가운데 값은 32768/39329이고 가운데 대 왼쪽 비는 65536/6561입니다. 같은 사전일 때 우도비와 사후비가 일치한 예입니다. 실제 목록의 생성 가정이 검증됐다는 결론은 아닙니다.
Normalize the numerators to get (6561, 65536, 6561)/78658. The middle posterior is 32768/39329, and middle-to-left odds are 65536/6561. This equality with likelihood odds uses equal priors and does not validate the actual sampling model.
53. 같은 우도와 다른 양끝 사전Equal tail likelihoods and unequal tail priors
국가 작업 모형 n=16, k=8에서 후보 (1/4, 1/2, 3/4)의 우도가 양끝에서 같습니다. 같은 사전을 (1/2, 1/3, 1/6)으로 바꾸면 양끝 사후비와 가운데 사후는 어떻게 되나요?
For country working data n=16, k=8, candidate likelihoods at 1/4 and 3/4 agree. Replace equal priors on (1/4, 1/2, 3/4) by (1/2, 1/3, 1/6). What happens to tail posterior odds and the middle posterior?
풀이와 확인할 이유Solution and explanation
양끝 사후비는 우도비 1에 사전비 3을 곱해 3:1입니다. 가운데 사전은 1/3 그대로이고 양끝 사전 합도 2/3 그대로여서 증거와 가운데 사후 32768/39329는 바뀌지 않습니다. 양끝 사후는 각각 19683/157316과 6561/157316입니다. 대칭 자료가 사전의 비대칭을 없애는 것은 아닙니다.
Tail posterior odds become 3:1. The middle prior remains 1/3 and combined tail prior remains 2/3, so evidence and middle posterior 32768/39329 are unchanged. Tail posteriors are 19683/157316 and 6561/157316. Symmetric likelihoods need not erase prior asymmetry.
54. 3010 로그값의 분산 눈금Variance scales for 3010 recorded logs
실제 가용 로그임금 3010개에서 S₀≈592.6416731449909입니다. S₀/3010과 S₀/3009를 계산하고 단위를 설명하세요. 어느 쪽이 더 큰가요?
For 3010 available log wages, S₀≈592.6416731449909. Calculate S₀/3010 and S₀/3009, compare them and state their units.
풀이와 확인할 이유Solution and explanation
ML 작업 분산은 약 0.1968909213106282이고 n−1 분산은 약 0.1969563553157165입니다. 후자는 전자의 3010/3009배라 더 큽니다. 단위는 원자료 로그 임금 눈금의 제곱이며, 달러²로 바로 읽지 않습니다. 분모의 차이는 결측 603개를 0으로 채웠다는 뜻도 아닙니다.
The ML working variance is about 0.1968909213106282, and the n−1 version is about 0.1969563553157165. The latter is 3010/3009 times larger. Units are squared source log-wage units, not directly dollars squared. Neither denominator imputes the 603 unavailable observations.
55. 결측 로그와 로그의 지수Unavailable logs and exponentiating a mean
3613행 중 가용 로그임금은 3010개이고 평균이 약 6.261831917744186입니다. 정규 작업 모형을 적합하면 빠진 603개가 확인되나요? 평균에 exp를 취하면 전체 원임금 산술평균인가요?
Among 3613 rows, 3010 log wages are available with mean about 6.261831917744186. Does fitting a Gaussian model identify the missing 603? Does exponentiating this mean give the full arithmetic mean of wages?
풀이와 확인할 이유Solution and explanation
두 질문 모두 아닙니다. 관측된 로그의 적합만으로 결측 로그값이나 전체 집단 분포는 식별되지 않습니다. exp(로그 평균)는 기록된 로그가 나타내는 수준값의 기하평균에 대응하고, 일반적으로 수준 산술평균과 다릅니다. 원자료의 로그 처리·반올림·센트 단위도 보존해야 합니다. 정규성 자체도 계산만으로 검증되지 않습니다.
Neither follows. Observed-log fitting does not identify missing values or the full population law. Exponentiating the recorded log mean corresponds to a geometric mean of represented levels, not generally an arithmetic mean. Preserve source processing, rounding and cent units; the fit alone does not verify normality.
56. 실제 이탈 비율과 사후평균의 차이An actual churn fraction and posterior mean
고객 3150기록 중 이탈 495개입니다. 닫힌 Bernoulli 작업 모형의 MLE와 Beta(1, 1) 사전의 사후평균을 정확한 분수로 구하고 차이를 계산하세요.
There are 495 churn indicators among 3150 customer records. Find the closed-space Bernoulli working MLE and the Beta(1, 1) posterior mean as exact fractions, and calculate their difference.
풀이와 확인할 이유Solution and explanation
MLE는 495/3150=11/70입니다. 사후 Beta(496, 2656)의 평균은 496/3152=31/197입니다. 차이는 다음과 같습니다.
This difference does not alter source records. A posterior mean for an unknown probability differs from the fixed-list fraction.
57. 큰 실제 표본에서도 공동 예측은 다르다Joint prediction still differs in a large actual sample
고객 자료의 사후가 Beta(496, 2656)입니다. 미래 고객들이 공유 p 아래 조건부 iid라고 가정할 때 다음 두 이탈의 공동확률은 15407/621141, plug-in 값은 961/38809입니다. 차이와 의미를 설명하세요.
The customer posterior is Beta(496, 2656). Assuming future customers are conditionally iid at shared p, the next-two churn probability is 15407/621141 and plug-in value 961/38809. Explain their difference.
풀이와 확인할 이유Solution and explanation
차이는 사후분산 5146/122364777≈0.00004205458569입니다. 일반 항등식 E[p²]−E[p]²=Var(p)를 적용한 것입니다. 표본이 커서 작아져도 두 공동법칙이 정확히 같은 것은 아닙니다. 실제 미래 고객들이 이 공유 iid 모형을 따른다는 타당성은 이 분수 계산과 별개입니다.
The difference is posterior variance 5146/122364777≈0.00004205458569, by E[p²]−E[p]²=Var(p). A small large-sample difference is not exact equality of joint laws. Whether actual future customers follow this shared-iid model is separate from the arithmetic.
58. 파일 접두부 0행의 갱신Updating with a zero-row file prefix
고객 파일에서 앞 0행을 선택하고 Beta(1, 9) 사전을 사용합니다. 사후·사후평균·한 번의 예측을 구하고, 접두부 길이를 늘리는 경로가 실제 시간 변화인지 설명하세요.
Select the first zero customer-file rows with a Beta(1, 9) prior. Find the posterior, mean and next-one prediction. Is the increasing-prefix path a business time trend?
풀이와 확인할 이유Solution and explanation
빈 우도는 1이므로 사후는 Beta(1, 9) 그대로이고 평균과 한 번의 성공 예측은 1/10입니다. 기록을 더 읽으면 모형 안의 갱신은 되지만, 원파일 순서가 실제 시간순이라는 증거가 없으면 이를 사업의 시간 변화로 해석할 수 없습니다. 파일 순서·접두부 수·사전을 명시합니다.
Empty likelihood leaves Beta(1, 9) unchanged, with mean and next-one success probability 1/10. Longer prefixes update the declared model, but source order is not verified chronology. Report file order, prefix length and prior rather than calling it a time trend.
59. 사후 95%의 보고 문장Reporting a 95% posterior statement
선택한 고객 모형과 Beta(1, 1) 사전에서 등꼬리 사후구간이 약 [0.14485815, 0.17027448]입니다. ‘이 구간이 미래 모든 고객집단의 참 비율을 95%로 보장한다’는 문장을 수정하세요.
A selected customer model with Beta(1, 1) prior gives equal-tail interval approximately [0.14485815, 0.17027448]. Correct the claim that it guarantees the true proportion of every future customer population with 95% probability.
풀이와 확인할 이유Solution and explanation
‘선택한 공유 확률의 조건부 iid Bernoulli 작업 모형과 Beta(1, 1) 사전 아래, 관측 자료에 대한 95% 등꼬리 사후구간은 약 [0.14485815, 0.17027448]이다’라고 씁니다. 반복표집 포함률이나 미래의 다른 고객집단 타당성을 별도로 검증했다고 덧붙이지 않습니다. 사전 민감도와 모형 가정도 함께 공개합니다.
State that under the chosen shared-p conditionally iid Bernoulli working model and Beta(1, 1) prior, this is the observed-data 95% equal-tail posterior interval. Do not add unverified sampling-coverage or future-population guarantees. Report prior sensitivity and model assumptions.
60. 하나의 작은 분석을 완결하기Complete one small analysis
관측 (1, 0, 0, 0), Beta(1, 1) 사전, 공유 p 아래 과거와 미래가 조건부 iid Bernoulli라는 모형을 선언합니다. 순서 우도·MLE·사후·제곱손실 결정·미래 두 번 성공 수 법칙을 차례로 보고하세요.
Declare records (1, 0, 0, 0), a Beta(1, 1) prior, and conditionally iid past/future Bernoulli observations at shared p. Report ordered likelihood, MLE, posterior, squared-loss decision and the next-two count law.
Likelihood compares parameters at fixed data; posterior adds a prior; the decision minimizes a chosen loss; prediction describes new outcomes. Keep these targets distinct and separately assess independence, representativeness and future application.
자료별 확보일·원행 식별·단위·이용 조건은 출처 기록을 확인하세요. 학습 사본은 제공처의 현재 최신 자료와 다를 수 있습니다.Consult each source record for retrieval dates, row identifiers, units and terms. Teaching copies can differ from current provider releases.