112 年 國立中央大學工業管理研究所碩士班《統計學》
第 1 題15 分
Let be independent and identically distributed random variables from . Set .
(a) Find the probability density function (pdf) of .
(b) Let be independent random variables such that has a continuous and strictly increasing cumulative distribution function (CDF) . Let . Show that are independent .
(c) Show that is distributed as .
Hint: .
登入後即可作答並保存紀錄。
核心觀念
本題綜合考查:
- 隨機變數變換與聯合密度函數。
- Probability Integral Transform:若 的 CDF 為連續且嚴格遞增的 ,則 。
- 獨立隨機變數經各自函數變換後仍保持獨立。
- 指數分布與卡方分布的關係:
其中 採用 rate 參數化,。 - 獨立卡方隨機變數之和仍為卡方分布,自由度相加。
(a) 求 的 pdf
解題方法
直接處理比值的變換。令
則反變換為
由於 為獨立的 隨機變數,其聯合密度函數為
計算 Jacobian:
因此 Jacobian 的絕對值為 。所以 的聯合密度為
整理得
對 積分即可得到 的邊際密度:
因為被積函數為偶函數,
利用
取 ,得到
這正是標準 Cauchy 分布的密度,因此
(b) 證明 彼此獨立且服從
1. 證明
固定一個 。因為 連續且嚴格遞增,對 ,可使用其反函數 :
因此 的 CDF 為
這正是 的 CDF,所以
2. 證明 彼此獨立
對任意 ,
由於 彼此獨立,
而每個 ,故
這符合獨立性的定義,因此
(c) 證明
解題方法
先逐項處理
由於 ,所以
而且因為 彼此獨立, 也彼此獨立。
令
對 ,
第 2 題10 分
Let be independent random variables such that has a continuous and strictly increasing cumulative distribution function (CDF) . Let .
(a) Show that are independent .
(b) Show that is distributed as .
Hint: .
登入後即可作答並保存紀錄。
本題為題組題,(a) 部分已在第一題 (b) 中證明,(b) 部分已在第一題 (c) 中證明。
(a) 證明 獨立且服從 。
令 是一個連續隨機變數,其 CDF 為 ,且 是嚴格遞增的。令 。
我們需要計算 的 CDF,即 。
由於 是嚴格遞增的,存在反函數 。
。
由於 ,所以 。
因為 ,所以 。
這個結果對於 在 的值域內成立。由於 是連續隨機變數,其 CDF 的值域是 。
因此, 的 CDF 是 對於 。
這就是 的 CDF。
所以, 服從 。
現在證明獨立性。
令 ,其中 是獨立的。
我們需要證明 。
由於 是嚴格遞增的,這等同於
由於 是獨立的,
而 (對於 )。
所以,。
因此, 是獨立的 隨機變數。
【答案】證明完畢。
(b) 證明 服從 分布。
已知 獨立。
令 。
由於 ,則 獨立。
。
的 CDF 為:
。
第 3 題10 分
The moment generating function of random variable is defined as follows:
, where is the pdf of .
Show that .
登入後即可作答並保存紀錄。
本題考查動差生成函數 (Moment Generating Function, MGF) 的性質,特別是如何利用 MGF 求取隨機變數的動差 (moments)。
核心觀念:動差生成函數對時間 的微分,在 時等於該隨機變數的對應動差。
解題過程:
動差生成函數的定義為 。
我們要求 。根據動差生成函數的性質,我們需要對 進行微分。
首先,我們計算 對 的一階微分:
假設我們可以交換微分和期望值運算(這在 的 MGF 存在且其微分也存在的條件下是成立的):
對 對 微分,得到 :
現在,我們將 代入上式:
這證明了 MGF 的一階微分在 時等於隨機變數的期望值 。
接下來,我們計算 對 的二階微分:
第 4 題10 分
Suppose a civil engineer wishes to compare the strengths of two different types of beams, one (A) made of steel and the other (B) made of a different and more expensive alloy. A certain deflection (in units of 0.001 inch) was measured for each beam when submitted to a given force; thus a small deflection would indicate a beam of great strength. The order observations for the two samples of size , and are the following:
| Types | Deflection (in 0.001 inch) |
|---|---|
| A | 79, 81, 83, 84, 86, 86, 86, 87 |
| B | 74, 75, 76, 77, 78, 82 |
(a) Please conduct a 2-samples t-test to identify whether there is a difference between the two means of deflections of different types of beams? Use .
Suppose there are two more different types of beams, (C) and (D), made of different alloys. The resulted sample means and sample variances of deflections from the two corresponding samples of Type C with size , and of Type D with size , are as following:
| Types | Sample size | Sample mean | Sample Variance |
|---|---|---|---|
| C | 6 | 79 | 7.6 |
| D | 6 | 73 | 8.0 |
(b) Please conduct an ANOVA to identify whether there is a difference between the four means of deflections of different types of beams? Use , and summarize the test result in an ANOVA table.
登入後即可作答並保存紀錄。
核心觀念
- (a) 兩獨立樣本 檢定:比較兩母體平均數是否相等( vs. )。當兩組樣本變異數相近時,可採合併變異數(pooled variance) 檢定。
- (b) 單因子變異數分析(One-Way ANOVA):同時比較 組母體平均數( vs. 至少有兩組不相等),將總變異 分解為組間變異 與組內變異 。
解題方法
(a) A 與 B 兩組的兩樣本 檢定()
- 計算基本統計量:
- A 組():,。
離差平方和 ,故 。 - B 組():,。
離差平方和 ,故 。
- A 組():,。
- 假設設定:,,。
- 兩組樣本變異數均為 ,採合併變異數 ,檢定統計量為:
- 自由度 ,雙尾臨界值 。因 ,拒絕 ,顯示 A、B 兩種樑的平均撓度有顯著差異(若採 Welch 檢定,因 ,統計量仍為 ,自由度 ,臨界值 ,結論相同)。
(b) 四組樑之單因子 ANOVA()
- 彙整四組統計量:
- A:
- B:
- C:
- D:
- 總樣本數 ,總和 ,總平均 。
- 計算平方和:
第 4 題10 分
(c) Following the test result in (b), we need to make comparisons between the four means, noted as pairwise-t tests. Please conduct a pairwise-t test between the two means of deflections of type A and type B with a = 0.05. Show the difference between (a) and (c).
登入後即可作答並保存紀錄。
核心觀念
在 ANOVA 拒絕虛無假設後進行事後成對比較(pairwise -test / Fisher's LSD),其誤差變異數估計不再僅仰賴被比較的兩組樣本,而是使用整個 ANOVA 模型所有組別彙總的組內均方 ,自由度亦隨之提升為 。
解題方法
- 計算 (c) 的成對 檢定統計量()
沿用 (a)、(b) 正確統計量:、、、,且整個 ANOVA 的 、,故 。
檢定 vs. :
在 (未調整之單次比較水準)及自由度 下,雙尾臨界值 。因 ,拒絕 ,認定 A 與 B 的平均撓度有顯著差異。
- 比較 (a) 與 (c) 的差異
- 變異數估計基礎不同:(a) 的兩樣本 檢定僅使用 A、B 兩組數據估計共同變異數();(c) 的事後成對 檢定則假設四組變異數同質,使用所有四組數據彙總的組內均方 作為共通誤差變異數估計,估計更精確。
- 自由度與臨界值不同:(a) 的自由度為 (臨界值 );
第 5 題4 分
Following 10 records are used to train a Naïve Bayesian Classification model to predict tennis-playing or not, based on weather information.
| Day | Outlook | Temperature | Humidity | Wind | Play Tennis |
|---|---|---|---|---|---|
| 1 | Sunny | Hot | High | Weak | No |
| 2 | Sunny | Hot | High | Strong | No |
| 3 | Overcast | Hot | High | Weak | Yes |
| 4 | Rainy | Mild | High | Weak | Yes |
| 5 | Rainy | Cool | Normal | Weak | Yes |
| 6 | Rainy | Cool | Normal | Strong | No |
| 7 | Overcast | Cool | Normal | Strong | Yes |
| 8 | Sunny | Mild | High | Weak | No |
| 9 | Sunny | Cool | Normal | Weak | Yes |
| 10 | Rainy | Mild | Normal | Weak | Yes |
(a) Let's define the event A as "play_tennis = yes", while as "play_tennis = no". Please determine the (prior) probabilities of and by counting the frequencies based on the 10 records.
(b) Let's define the event as "outlook= sunny", as "outlook= overcast", and as "outlook= rainy". Please determine the conditional probabilities of and , , by counting the frequencies based on the 10 records. (for example, and )
Similarly, we can define events
as "temperature = hot", as "temperature = mild", and as "temperature = cool";
as "humidity = high", and as "humidity = normal";
as "wind = weak", and as "wind = strong".
Assume events , , , and are mutually independent. Hence the can be determined as . For example,
(c) Let's use event X as "outlook = sunny, temperature = cool, humidity = normal, wind = weak". Please determine the conditional probabilities of and by counting the frequencies based on the 10 records with assuming independence.
(d) Try to use Bayes' Theorem to calculate the (posterior) probabilities, and .
(e) With the posterior probabilities in (d), would the unknown sample X be classified/predicted as "play_tennis = yes" or "play_tennis = no"?
登入後即可作答並保存紀錄。
核心觀念
本題考查機率論與機器學習的核心基礎:單純貝氏分類器(Naïve Bayes Classifier)與貝氏定理(Bayes' Theorem)。
- 事前機率(Prior Probability):在未觀測特徵前,目標類別發生的邊際機率 與 。
- 條件機率與條件獨立假設(Conditional Independence Assumption):
單純貝氏分類器的核心假設為「在給定類別的條件下,各屬性特徵彼此相互獨立」: - 事後機率(Posterior Probability)與貝氏定理(Bayes' Theorem):
根據全機率定理與貝氏定理,觀測到特徵向量 後,屬於類別 的事後機率為: - 最大事後機率準則(MAP, Maximum A Posteriori):
比較 與 ,將樣本分類至事後機率較大之類別。
解題方法與推導
全體樣本數為 。
將 10 筆資料依照目標變數「Play Tennis」進行分類統計:
- 類別 (Play Tennis = Yes):共 6 筆(Day 3, 4, 5, 7, 9, 10)。
- 類別 (Play Tennis = No):共 4 筆(Day 1, 2, 6, 8)。
(a) 計算事前機率 與
直接計算類別出現的相對頻率:
(b) 計算各項條件機率
計算給定 (共 6 筆)與給定 (共 4 筆)之條件下,各特徵的條件機率:
-
Outlook ():
- 在 中:Sunny () 有 1 次 (Day 9);Overcast () 有 2 次 (Day 3, 7);Rainy () 有 3 次 (Day 4, 5, 10)。
- 在 中:Sunny () 有 3 次 (Day 1, 2, 8);Overcast () 有 0 次;Rainy () 有 1 次 (Day 6)。
-
Temperature ():
- 在 中:Hot () 有 1 次 (Day 3);Mild () 有 2 次 (Day 4, 10);Cool () 有 3 次 (Day 5, 7, 9)。
- 在 中:Hot () 有 2 次 (Day 1, 2);Mild () 有 1 次 (Day 8);Cool () 有 1 次 (Day 6)。
-
Humidity ():
- 在 中:High () 有 2 次 (Day 3, 4);Normal () 有 4 次 (Day 5, 7, 9, 10)。
- 在 中:High () 有 3 次 (Day 1, 2, 8);Normal () 有 1 次 (Day 6)。
-
Wind ():
- 在 中:Weak () 有 5 次 (Day 3, 4, 5, 9, 10);Strong () 有 1 次 (Day 7)。
- 在 中:Weak () 有 2 次 (Day 1, 8);Strong () 有 2 次 (Day 2, 6)。
(c) 計算特徵事件 的條件機率 與
給定事件 ,即:
「Outlook = Sunny, Temperature = Cool, Humidity = Normal, Wind = Weak」。
根據單純貝氏之類別條件獨立性:
代入數值計算:
同理計算在 條件下:
代入數值計算:
(d) 應用貝氏定理計算事後機率 與
-
計算聯合機率分子項:
-
依全機率定理計算邊際機率 :
取分母最小公倍數 :