115 年 國立政治大學統計學系碩士班《統計方法》
第 1 題
Consider the following hypothesis test:
vs. .
The population variance is . Using a level of significance.
(a) A sample of provided a sample mean of . What is the -value of the test?
(b) What is the probability of making a Type II error when the actual population mean is ?
Note: You may use some of the following quantities for computing #1(b).
.
登入後即可作答並保存紀錄。
此題考查常態母體平均數的雙尾假設檢定中 -value 的計算,以及在特定對立參數下型二錯誤(Type II error)機率 的推導。
核心觀念:
假設檢定設定如下:
已知母體變異數 母體標準差 ,樣本數 ,顯著水準 。
樣本平均數的標準誤為:
解題方法:
(a) -value 的計算
- 計算檢定統計量 值:
樣本平均數 ,在虛無假設 下:
- 雙尾檢定 -value:
查標準常態分配表得 $\Phi(0.5) \approx 0.6915$:
(b) 當真實母體平均數 時的型二錯誤機率
- 找出 的接受域(Acceptance Region):
在 下,雙尾檢定的臨界臨界值為 。
未拒絕 的條件為 ,對應之樣本平均數 的接受域範圍為:
- 在真實母體平均數 下計算 :
型二錯誤是指當 為真時,樣本平均數仍落入 接受域的機率:
將端點標準化(此時以真實均值 $2027.36$ 與標準誤 $2$ 為基準):
因此:
第 2 題
Consider the probability density function
A random sample of size is taken from , and the order statistics are denoted by , and . Let the observation of be . Conduct a test v.s. by rejecting if or .
Please find the power function of the test.
登入後即可作答並保存紀錄。
核心觀念
本題考查:
- 由機率密度函數求母體累積分布函數;
- 次序統計量最大值 的分布;
- 以拒絕域計算檢定的 power function。
令
檢定的拒絕域為
因此,給定參數 時,檢定力函數為
其中兩個事件互斥。
解題方法
1. 求母體累積分布函數
由題目給定
因此,當 時,
完整寫成
2. 求最大次序統計量的分布
因為 是 個樣本的最大值,
樣本獨立,因此
當 時,
3. 計算拒絕域機率
事件一:
當 時,所有觀察值均小於 ,所以
當 時,
事件二:
當 時,樣本值嚴格小於 ,所以
當 時,
由連續型分布,,故
Power function
綜合 的不同範圍,得到
第 3 題
To estimate a population proportion, the sample proportion is usually adopted as the point estimator. What is the probability that the sample proportion will be within of the population proportion? Suppose that the population proportion is , and the sample size is .
登入後即可作答並保存紀錄。
此題主要考驗對樣本比例抽樣分配的理解,以及利用常態近似計算機率。
核心觀念:
- 樣本比例的抽樣分配: 當樣本大小足夠大時,樣本比例 的抽樣分配近似於常態分配,其均值為母體比例 ,標準差為 。
- 常態近似: 當 且 時,二項分配可用常態分配近似。在此題中,, ,則 且 ,滿足常態近似條件。
- 機率計算: 利用標準化將樣本比例轉換為標準常態變數 ,再計算對應的機率。
步驟 1:確認參數與抽樣分配
母體比例 。
樣本大小 。
樣本比例 的抽樣分配近似於常態分配,其:
均值 。
標準差 。
計算標準差:。
步驟 2:設定問題的機率敘述
我們要求的是樣本比例 在母體比例 的 範圍內的機率。
即 。
這等同於 。
代入 ,我們要求 ,
也就是 。
步驟 3:標準化
將 的範圍轉換為標準常態變數 的範圍:
第 4 題
For each of following statements, answer True or False. For each of false statements, please explain why it is false. (請簡單扼要說明)
If the alternative hypothesis is true, then the -value will always be smaller than the significance level.
登入後即可作答並保存紀錄。
此題考查假設檢定中 -value 與顯著水準 的本質關係,以及型二錯誤(Type II error)的概念。
核心觀念:
- -value( 值): 在虛無假設 為真的條件下,檢定統計量觀察到比目前樣本更極端(或同等極端)結果的機率。-value 是由抽樣樣本所決定的隨機變數。
- 顯著水準(): 決策門檻,亦代表允許犯下型一錯誤(Type I error,當 為真卻誤拒絕 )的最大機率上限。當 時,我們才做出拒絕 的決策。
- 型二錯誤(Type II error, ): 當對立假設 (或 )為真,但樣本統計量未能落入拒絕域,導致未能拒絕 的機率。
解題方法(判斷敘述真偽):
該敘述為 False。
原因說明:
-value 是根據隨機抽取的樣本資料計算而來的隨機變數,其數值高低具有隨機波動性。
即使真實母體的對立假設 為真,由於抽樣變異(Sampling Variation),抽得的樣本統計量仍有一定的機率落入 的接受域內(即發生型二錯誤,其發生機率為 )。
當樣本統計量落在接受域內時,所計算出的 -value 必然大於或等於顯著水準 (),進而導致研究者無法拒絕 。因此,-value 並不會「總是」(always)小於顯著水準。
反例說明:
考慮單尾檢定 對 ,已知母體標準差 ,取樣本數 ,顯著水準 (拒絕域為 )。
假設真實母體平均數實際上為 (此時對立假設 確實為真):
若抽樣抽到觀測值 ,則標準化檢定統計量為:
第 5 題
For each of following statements, answer True or False. For each of false statements, please explain why it is false. (請簡單扼要說明)
The power of a test may be less or greater than the significance level.
登入後即可作答並保存紀錄。
核心觀念
此題涉及統計檢定中「檢定力函數(Power Function)」與「顯著水準(Significance Level)」的定義與相互關係。
設虛無假設為 ,對立假設為 。檢定力函數定義為 ,而顯著水準 定義為 。
一個統計檢定被稱為「不偏檢定(Unbiased Test)」,當且僅當對所有的 ,皆滿足 。若存在至少一個 使得 ,則該檢定為「有偏檢定(Biased Test)」。
解題方法
判斷此敘述的真偽,應檢驗是否存在「有偏檢定」的可能性,以及不偏檢定是否恆滿足 。
- 考慮有偏檢定的情況:若設計檢定時採用了不恰當的拒絕域(例如針對 vs 的檢定,卻錯誤地只將拒絕域設在左尾),則對於 的參數空間,其拒絕機率(檢定力)會隨著 增加而趨近於 0,顯然小於 。因此,檢定力確實可能小於 。
- 考慮不偏檢定的情況:在良好的統計檢定(如均值的雙尾 檢定)中,檢定力函數在 時達到最小值 ,對於 ,檢定力恆大於 。因此,檢定力亦可能大於 。
選項分析
敘述:"The power of a test may be less or greater than the significance level."
- 判斷結果:True(正確)
- 詳細說明:
- 為什麼可能大於 :在絕大多數統計實務中,我們追求的是不偏檢定(Unbiased test)。對於這些檢定,檢定力函數 在對立假設下皆嚴格大於或至少等於顯著水準 。因此,檢定力通常大於 是常態。
第 6 題
For each of following statements, answer True or False. For each of false statements, please explain why it is false. (請簡單扼要說明)
The significance level is greater than or equal to the probability of a type I error.
登入後即可作答並保存紀錄。
核心觀念
本題探討假設檢定(Hypothesis Testing)中「型 I 錯誤機率」(Probability of Type I error)與「顯著水準」(Significance level, )之間的數學關係。
- 型 I 錯誤(Type I error):指虛無假設 為真,但檢定統計量落入拒絕域而將 拒絕的錯誤。其機率定義為 。
- 顯著水準(Significance level, ):在設計檢定時,預先指定的型 I 錯誤機率之「上界」。一個檢定程序的設計要求,必須滿足對於所有屬於虛無假設空間的參數 ,皆有:
解題方法
透過檢定理論的定義進行比較:
- 檢定規格:統計學中,顯著水準 的功能是設定一個「容許上限」。
- 型 I 錯誤機率:在給定的檢定統計量與臨界值下,實際發生的型 I 錯誤機率取決於分配型態。
- 關係推導:由於定義上要求檢定程序的實際型 I 錯誤機率(即檢定之 Size,定義為 )必須小於或等於設定的 ,故可得:
即:
選項分析
本敘述為 True。
第 7 題
Suppose that a random sample from a normal distribution results in the following observations:
.
(a) Construct a confidence interval for if is unknown.
(b) Suppose that is known to be . Construct a confidence interval for , using the information of . What is your interpretation about this interval estimate?
登入後即可作答並保存紀錄。
此題主要考驗在常態母體 下,如何建構母體變異數 的 95% 信賴區間,並深入探討母體平均數 未知與已知時的自由度及估計精度差異。
核心觀念:
- 未知時的變異數估計:
以樣本平均數 作為中心點,樣本變異數為 。
統計量 ,自由度為 。其 信賴區間為:
- 已知()時的變異數估計:
直接以已知真值 為中心點,偏差平方和不需消耗自由度估計平均數,修正樣本變異數為 。
統計量 ,自由度為 。其 信賴區間為:
數據整理:
樣本數 ,觀測值為:79, 82, 63, 75, 83, 99, 71, 76, 77, 85。
解題方法:
(a) 當 未知時建構 95% 信賴區間
- 計算離均差平方和:
:
。
故 。 - 查卡方臨界值(自由度 ):
。
,。 - 計算信賴區間:
(b) 當 已知為 80 時建構 95% 信賴區間與結果解釋
- 計算對已知均值的偏差平方和:
:
第 8 題
The Avocado Price dataset from Kaggle and the Hass Avocado Board website comprises 18,249 observations. It includes several key variables: volume (total sales volume; Y), price (X1), date, type, season, year, region (Atlanta, Boston, San Diego, ...), and so on. In the current data analysis, we ignore the time information, limit our dataset to Boston and San Diego (338 observations in total), and conduct the following linear regression analysis.
Model 1:
Model 2:
Model 3:
As the first step, we consider a simple linear regression, Model 1, on the 338 observations, and the results is given in the following tables.
| Source of Variation | Sum of Squares | Degree of Freedom | Mean Square | F |
|---|---|---|---|---|
| Regression | 623,173 | 1 | (A2) | (A5) |
| Error | 3,319,382 | 336 | (A3) | |
| Total | (A1) | 337 | (A4) |
| Predictor | Coef | SE Coef |
|---|---|---|
| Constant | 732.36 | 24.90 |
| price | -163.18 | 20.55 |
(a) (7%) If the model is fitted directly without preliminary exploratory data analysis, such as scatter plots, it yields the unsatisfactory . The investigation of the scatter plot, given below, of Y versus X1 for Boston (marked as circle) and San Diego (marked as cross) suggests us to extend Model 1 to improve the . Please suggest one reasonable extended model, as the extension of Model 1, and clearly define every notation or variable that you use. Also, provide the reason for the extension.
🖼️【此處有附圖,請對照原卷】
(b) (7%) Consider the above Model 2, and suppose that is some other variable in the dataset. Is it possible that the under Model 1 and Model 2 take on identical values? Explain.
(c) (6%) Model 3 includes three additional predictors, , and , which are associated with Y. Conduct a global test of hypothesis to determine whether any of the regression coefficients under Model 3 are not zero. Use a level of significance. The answers should include the followings. Specify your null and alternative hypotheses. What is your conclusion about the test? What is the implication/interpretation about the conclusion of the F test? (The critical value for the global test is 2.39877.)
登入後即可作答並保存紀錄。
核心觀念
本題考查多元線性回歸模型(Multiple Linear Regression, MLR)的建立、擴充與假設檢定,涵蓋四大統計核心主題:
- 探索性資料分析(EDA)與虛擬變數(Dummy Variable):藉由觀察散佈圖中的分群特徵(Sub-populations),辨識未納入模型的定性變數(如地區 Region),並利用虛擬變數及其交互作用項(Interaction term)擴充單變量回歸模型,以捕捉截距與斜率的異質性並提升判定係數 。
- 巢狀模型(Nested Models)與判定係數性質:在最小平方法(OLS)下, 隨自變數增加具有單調不減性質();探討兩者相等的理論充要條件(偏回歸係數為零或完全多元共線性)。
- 方差分析表(ANOVA Table)的自由度與平方和恆等式:總平方和 、自由度分割()及均方計算(, )。
- 整體顯著性檢定(Global -test / Overall -test):檢定所有斜率係數是否同時為零之假說建立、臨界值比較、統計決策及其實質意涵解讀。
解題方法
原卷第 3 頁散佈圖橫軸為價格()、縱軸為銷量(),圓圈代表 Boston、叉叉代表 San Diego;第 4 頁提供了 Model 3 的 ANOVA 表()與參數估計表。
(a) 模型擴充建議與理由推導
- 散佈圖特徵辨識:
- 散佈圖明確將觀測點分為 Boston(圓圈)與 San Diego(叉叉)兩群。
- 兩城市在價格分佈與銷售水準存在系統性差異:San Diego 價格多落在 0.6 至 1.5 之間,而 Boston 價格普遍較高;在相同或相近價格下,兩地的基準銷量(截距)或價格對銷量的敏感度(斜率)明顯不同。
- Model 1 將兩地資料混合擬合為單一回歸直線,無法反映地區效應,造成殘差變異過大,導致 極低。
- 延伸模型建構:
引入地區虛擬變數(Indicator/Dummy variable):
可提出以下兩種合理的延伸模型(兩者皆成立,以包含交互作用項之完整模型最具解釋力):
- 截距位移模型(平行回歸線,即 Model 2 形式):
- $Y$:酪梨總銷售量(Total sales volume)。
- $X_1$:酪梨價格(Price)。
- $D$:地區虛擬變數。
- $\beta_0$:基準組(Boston)在價格為 0 時的基準銷量截距。
- $\beta_1$:價格對銷量的邊際效果(斜率)。
- $\beta_2$:San Diego 相對於 Boston 的基準銷量差異(截距位移)。
- $\epsilon$:隨機誤差項,滿足獨立同常態分佈假設 $\epsilon \sim \text{i.i.d. } N(0, \sigma^2)$。
- 完整交互作用模型(不同截距與不同斜率):
- $X_1 \cdot D$ 為價格與地區的交互作用項。
- $\beta_3$ 代表兩地區銷量對價格敏感度(斜率)的差異。
3. 擴充理由:
控制地區固定效應後,可將跨地區的組間變異自誤差平方和()中剝離,大幅縮小殘差平方和並增加回歸解釋平方和(),進而顯著提升 。
(b) Model 1 與 Model 2 的 相同之可能性分析
- 判定結論:
可能相同(Yes, it is possible)。 - 理論說明與成立條件:
- 在最小平方法(OLS)下,Model 1 嵌套於 Model 2 中(Model 1 is nested in Model 2)。增加一個預測變數 後,目標函數最小化之殘差平方和恆滿足:
- 兩者 恰好相等()之充分必要條件為 (即額外解釋平方和 )。此情況在以下兩種條件下發生:
- 偏回歸係數估計值為零:加入 後,經最小平方估計得到的偏回歸係數恰好為零()。依據 Frisch-Waugh-Lovell (FWL) 定理,這等價於控制 後, 的殘差與 的殘差之樣本共變異數為零(即偏相關係數 )。
- 完全多元共線性(Perfect Multicollinearity):若 與 存在完全線性相依關係(例如 ,其中 為常數),則 未帶來任何新的線性資訊,模型矩陣未增 rank, 與 保持不變。
(c) Model 3 整體顯著性檢定(Global -test)推導與計算
Model 3 為:
-
建立假說:
- 虛無假說 :(模型中所有自變數對 均無線性解釋力)。
- 對立假說 :至少存在一個 (其中 ,至少有一個自變數具有顯著線性解釋力)。
-
ANOVA 表數據計算與補齊:
- 總樣本數 。
- 預測變數個數 (分別為 )。
- 自由度:
- 回歸自由度:(即 (A8))。
- 誤差自由度:(即 (A9))。
- 總自由度:(即 (A10))。
- 平方和與均方:
- 由原卷第 4 頁知 。
- 回歸均方:
- 表格直接給定誤差均方:$MSE = 8,555$。
(驗算:總平方和 $SST = 623,173 + 3,319,382 = 3,942,555$,則 $SSE = SST - SSR = 3,942,555 - 1,093,708 = 2,848,847$;$MSE = \frac{2,848,847}{333} \approx 8,555.096 \approx 8,555$,完全相符)。
3. 計算 檢定統計量:
-
檢定決策:
- 顯著水準 。
- 題目給定臨界值:。
- 拒絕域:。
- 由於 (對應之 ),檢定結果拒絕虛無假說 。
-
結論與統計意涵解讀(Implication / Interpretation):
- 檢定結論:在 顯著水準下,有極充分的統計證據顯示,Model 3 中的四個回歸係數()至少有一個不等於零,整體回歸模型具高度統計顯著性。
- 實質意涵:
第 9 題
Time Series Analysis focuses on the values of a subject over time or certain space. For example, we may be interested in the five-year historical daily stock closing prices (股票收盤價) of a given company. A sequence of random variables is used to denote the values at time points (suppose that we have regular time points).
In order to measure the covariance between different time points, a so-called autocovariance function (ACF) at time point and , for , is defined and considered:
where . Since we simply obtain one realization of time series in real data, some stationary assumption is necessary for real data analysis. The following is the definition of a weakly stationary process:
(i) is constant and does not depend on time ;
(ii) the ACF depends on and only through their difference .
The computation of the sample ACF is a crucial step before fitting some time series models. Sample ACF:
where is the sample mean.
Please answer Questions (a) to (d).
(a) (5%) Consider the time series , where and are known constants and is a sequence of i.i.d. random variables with mean and variance . Determine whether is weakly stationary.
(b) (5%) Derive the ACF for the following process
where and are parameters, and is a sequence of i.i.d. random variables with mean and variance .
(c) (8%) Suppose that we have one observed time series of length , denoted by , and the value of and are missing. That is, what we observed: . In order to compute the sample ACF for this dataset which is with missing data, a student suggested to directly ignore what was missing and join what were observed. In other words, let , and the student computed sample ACF on the series for the sample ACF of . Please comment on the approach for missing data by the student. (Is it appropriate, or are there some drawbacks? Explain.)
(d) (7%) Please suggest an alternative approach to handling the missing data in (c) when computing the sample ACF, and explain its advantages.
登入後即可作答並保存紀錄。
此題為時間序列分析綜合題,內容涵蓋弱定常性(Weak Stationarity)判斷、移動平均過程之自共變異數函數(ACF)推導,以及時間序列缺失值處理方式的評析與替代方案。
核心觀念:
- 弱定常性(Weak Stationarity): 時間序列 滿足:
- 為與時間 無關的常數。
- 自共變異數函數 僅取決於時間差 ,記為 ,且滿足 。
- 移動平均模型 MA(2): 由白噪音之線性組合構成,其自共變異數在滯後階數超過其模型階數時截斷為 0。
- 時間序列等距結構: 時間序列分析高度依賴時間戳記的等間隔性。直接移除缺失值並拼接會破壞時間延遲(Lag)結構,導致自共變異數估計產生偏差。
解題方法:
(a) 判斷 是否為弱定常
計算序列的期望值:
- 若 : 期望值 為時間 的函數,隨時間持續改變,不滿足弱定常性的第一條件。因此,當 時, 不是弱定常過程(為具有確定性趨勢的非定常過程)。
- 若 : 為常數,且 僅取決於 ,此時為弱定常過程。
(b) 推導 的自共變異數函數(ACF)
已知 ,則 。自共變異數函數定義為 :
- 當 (變異數):
- 當 :
展開後僅保留相同下標的白噪音項:
由對稱性可知,$\gamma(-1) = \gamma(1) = \sigma^2(a + ab)$。
- 當 :
同理,$\gamma(-2) = \gamma(2) = b\sigma^2$。
- 當 :
與 無任何重疊的白噪音成分,協變異數為零:
(c) 評析學生直接刪除缺失值並拼接序列的做法
學生的做法並不恰當(Inappropriate),存在嚴重缺點:
- 破壞等距時間網格與延遲結構: 時間序列分析建立在觀測值具備固定的取樣週期。原序列中 與 實際相差 2 個時間單位(缺失 ),拼接後卻被視為相鄰的 與 ; 與 亦然。
- 導致樣本 ACF 估計嚴重偏差: 計算 的 lag-1 樣本自共變異數時,混合了真正的 1 期時間差與實際為 2 期的時間差;同理,計算更高階 lag 時亦混入不同的期差,破壞了原本的相關結構,使得樣本 ACF 無法真實反映母體的時間關聯性,對後續的模型識別(如 ARMA 階數判定)造成嚴重誤導。