115 年 國立政治大學統計學系碩士班《統計方法》

📄 試題原卷 免費註冊後即可對照原始考卷 PDF免費註冊

第 1 題

Consider the following hypothesis test:
H0:μ=2026H_0: \mu = 2026 vs. Hα:μ≠2026H_\alpha: \mu \neq 2026.
The population variance is 400400. Using a 0.050.05 level of significance.

(a) A sample of 100100 provided a sample mean of 20252025. What is the pp-value of the test?
(b) What is the probability of making a Type II error when the actual population mean is 2027.362027.36?

Note: You may use some of the following quantities for computing #1(b).
z0.001=3.09,z0.005=2.575,z0.01=2.33,z0.025=1.96,z0.05=1.645,z0.1=1.28z_{0.001} = 3.09, z_{0.005} = 2.575, z_{0.01} = 2.33, z_{0.025} = 1.96, z_{0.05} = 1.645, z_{0.1} = 1.28.

登入後即可作答並保存紀錄。

這一題的完整詳解

此題主要在考驗假設檢定中的 pp-value 計算以及 Type II 錯誤的機率計算。

核心觀念:

  1. pp-value: 在虛無假設為真的前提下,觀察到目前樣本統計量或比其更極端的統計量出現的機率。對於雙尾檢定,其計算方式為 2×P(統計量≥∣觀察值∣)2 \times P(\text{統計量} \ge |\text{觀察值}|)。
  2. Type II 錯誤: 當對立假設為真時,卻未能拒絕虛無假設。其機率通常以 β\beta 表示。
  3. 常態分配性質: 樣本平均數的抽樣分配近似於常態分配,且其均值為母體平均數 μ\mu,標準差為 σ/n\sigma/\sqrt{n}。

(a) pp-value 的計算

步驟 1:設定檢定統計量
由於母體變異數已知 (σ2=400\sigma^2 = 400),我們使用 zz-檢定。樣本大小 n=100n=100,母體標準差 σ=400=20\sigma = \sqrt{400} = 20。
樣本平均數 xˉ=2025\bar{x} = 2025。
檢定統計量為:
z=xˉ−μ0σ/nz = \frac{\bar{x} - \mu_0}{\sigma/\sqrt{n}}
其中 μ0\mu_0 是虛無假設下的母體平均數,即 20262026。

步驟 2:計算檢定統計量的值
z=2025−202620/100=−120/10=−12=−0.5z = \frac{2025 - 2026}{20/\sqrt{100}} = \frac{-1}{20/10} = \frac{-1}{2} = -0.5

步驟 3:計算 pp-value
此為雙尾檢定 (Hα:μ≠2026H_\alpha: \mu \neq 2026)。
p-value=2×P(Z≥∣−0.5∣)=2×P(Z≥0.5)p\text{-value} = 2 \times P(Z \ge |-0.5|) = 2 \times P(Z \ge 0.5)
查標準常態分配表,可得 P(Z≥0.5)=1−P(Z<0.5)=1−Φ(0.5)≈1−0.6915=0.3085P(Z \ge 0.5) = 1 - P(Z < 0.5) = 1 - \Phi(0.5) \approx 1 - 0.6915 = 0.3085。
所以,p-value=2×0.3085=0.617p\text{-value} = 2 \times 0.3085 = 0.617。

【答案】 0.6170.617

(b) Type II 錯誤機率 β\beta 的計算

步驟 1:釐清 Type II 錯誤的定義
Type II 錯誤發生於虛無假設為假,但我們卻未能拒絕虛無假設。在此題中,實際母體平均數 μ=2027.36\mu = 2027.36,而虛無假設為 μ=2026\mu = 2026。檢定水準為 α=0.05\alpha = 0.05。

🔒

後續完整解題步驟與【答案】

免費註冊,享三天全站完整詳解閱覽。

免費註冊

第 2 題

Consider the probability density function

f(x)={2xθ2,0<x<θ0,otherwisef(x) = \begin{cases} \frac{2x}{\theta^2}, & 0 < x < \theta \\ 0, & \text{otherwise} \end{cases}

A random sample of size 55 is taken from f(x)f(x), and the order statistics are denoted by X(1),X(2),X(3),X(4)X_{(1)}, X_{(2)}, X_{(3)}, X_{(4)}, and X(5)X_{(5)}. Let the observation of X(5)X_{(5)} be y5y_5. Conduct a test H0:θ=1H_0: \theta = 1 v.s. Hα:θ≠1H_\alpha: \theta \neq 1 by rejecting H0H_0 if y5≤0.5y_5 \le 0.5 or y5≥1y_5 \ge 1.

Please find the power function of the test.

登入後即可作答並保存紀錄。

這一題的完整詳解

核心觀念

本題考查:

  • 由機率密度函數求母體累積分布函數;
  • 次序統計量最大值 X(5)X_{(5)} 的分布;
  • 以拒絕域計算檢定的 power function。

令

Y=X(5)=max⁡(X1,…,X5).Y=X_{(5)}=\max(X_1,\ldots,X_5).

檢定的拒絕域為

R={Y≤0.5}∪{Y≥1}.R=\{Y\le 0.5\}\cup\{Y\ge 1\}.

因此,給定參數 θ\theta 時,檢定力函數為

π(θ)=Pθ(Y≤0.5)+Pθ(Y≥1),\pi(\theta)=P_\theta(Y\le 0.5)+P_\theta(Y\ge 1),

其中兩個事件互斥。


解題方法

1. 求母體累積分布函數

由題目給定

f(x)=2xθ2,0<x<θ.f(x)=\frac{2x}{\theta^2},\qquad 0<x<\theta.

因此,當 0<x<θ0<x<\theta 時,

Fθ(x)=∫0x2tθ2 dt=x2θ2.F_\theta(x) =\int_0^x \frac{2t}{\theta^2}\,dt =\frac{x^2}{\theta^2}.

完整寫成

Fθ(x)={0,x≤0,x2θ2,0<x<θ,1,x≥θ.F_\theta(x)= \begin{cases} 0, & x\le 0,\\[4pt] \dfrac{x^2}{\theta^2}, & 0<x<\theta,\\[8pt] 1, & x\ge \theta. \end{cases}

2. 求最大次序統計量的分布

因為 Y=X(5)Y=X_{(5)} 是 55 個樣本的最大值,

Pθ(Y≤y)=Pθ(X1≤y,…,X5≤y).P_\theta(Y\le y) =P_\theta(X_1\le y,\ldots,X_5\le y).

樣本獨立,因此

Pθ(Y≤y)=[Fθ(y)]5.P_\theta(Y\le y) =\left[F_\theta(y)\right]^5.

當 0<y<θ0<y<\theta 時,

Pθ(Y≤y)=(y2θ2)5=y10θ10.P_\theta(Y\le y) =\left(\frac{y^2}{\theta^2}\right)^5 =\frac{y^{10}}{\theta^{10}}.

3. 計算拒絕域機率

事件一:Y≤0.5Y\le 0.5

當 θ≤0.5\theta\le 0.5 時,所有觀察值均小於 θ≤0.5\theta\le 0.5,所以

Pθ(Y≤0.5)=1.P_\theta(Y\le 0.5)=1.

當 θ>0.5\theta>0.5 時,

Pθ(Y≤0.5)=(0.52θ2)5=(14θ2)5=145θ10.P_\theta(Y\le 0.5) =\left(\frac{0.5^2}{\theta^2}\right)^5 =\left(\frac{1}{4\theta^2}\right)^5 =\frac{1}{4^5\theta^{10}}.

事件二:Y≥1Y\ge 1

🔒

後續完整解題步驟與【答案】

免費註冊,享三天全站完整詳解閱覽。

免費註冊

第 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 ±3%\pm 3\% of the population proportion? Suppose that the population proportion is .35.35, and the sample size is 100100.

登入後即可作答並保存紀錄。

這一題的完整詳解

此題主要考驗對樣本比例抽樣分配的理解,以及利用常態近似計算機率。

核心觀念:

  1. 樣本比例的抽樣分配: 當樣本大小足夠大時,樣本比例 p^\hat{p} 的抽樣分配近似於常態分配,其均值為母體比例 pp,標準差為 p(1−p)n\sqrt{\frac{p(1-p)}{n}}。
  2. 常態近似: 當 np≥10np \ge 10 且 n(1−p)≥10n(1-p) \ge 10 時,二項分配可用常態分配近似。在此題中,n=100n=100, p=0.35p=0.35,則 np=35≥10np = 35 \ge 10 且 n(1−p)=100(0.65)=65≥10n(1-p) = 100(0.65) = 65 \ge 10,滿足常態近似條件。
  3. 機率計算: 利用標準化將樣本比例轉換為標準常態變數 ZZ,再計算對應的機率。

步驟 1:確認參數與抽樣分配
母體比例 p=0.35p = 0.35。
樣本大小 n=100n = 100。
樣本比例 p^\hat{p} 的抽樣分配近似於常態分配,其:
均值 E(p^)=p=0.35E(\hat{p}) = p = 0.35。
標準差 SD(p^)=p(1−p)n=0.35(1−0.35)100=0.35×0.65100=0.2275100=0.002275SD(\hat{p}) = \sqrt{\frac{p(1-p)}{n}} = \sqrt{\frac{0.35(1-0.35)}{100}} = \sqrt{\frac{0.35 \times 0.65}{100}} = \sqrt{\frac{0.2275}{100}} = \sqrt{0.002275}。
計算標準差:0.002275≈0.0477\sqrt{0.002275} \approx 0.0477。

步驟 2:設定問題的機率敘述
我們要求的是樣本比例 p^\hat{p} 在母體比例 pp 的 ±3%\pm 3\% 範圍內的機率。
即 P(∣p^−p∣≤0.03)P(| \hat{p} - p | \le 0.03)。

🔒

後續完整解題步驟與【答案】

免費註冊,享三天全站完整詳解閱覽。

免費註冊

第 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 pp-value will always be smaller than the significance level.

登入後即可作答並保存紀錄。

這一題的完整詳解

此題考驗對 pp-value 和顯著水準 α\alpha 的關係的理解。

核心觀念:

  1. pp-value: 在虛無假設 (H0H_0) 為真的前提下,觀察到樣本統計量或比觀察到的樣本統計量更極端的結果的機率。
  2. 顯著水準 (α\alpha): 預設的拒絕虛無假設的機率上限。如果 p-value<αp\text{-value} < \alpha,則拒絕 H0H_0。
  3. 對立假設為真時: 當對立假設 (HαH_\alpha) 為真時,意味著虛無假設 (H0H_0) 為假。

判斷:False

解釋:
pp-value 的定義與虛無假設為真時的機率有關。當對立假設為真時,虛無假設為假。
pp-value 的值會隨著樣本數據的變動而變動。

  • 如果對立假設為真,而且樣本數據「非常」支持對立假設(即非常不支持虛無假設),那麼 pp-value 很可能會小於顯著水準 α\alpha,導致我們拒絕虛無假設。
  • 然而,即使對立假設為真,也不保證 pp-value 就一定會小於 α\alpha。有可能因為樣本變異度較大,或者樣本觀察值剛好落在虛無假設的接受域內,導致 pp-value 大於 α\alpha。
🔒

後續完整解題步驟與【答案】

免費註冊,享三天全站完整詳解閱覽。

免費註冊

第 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 和顯著水準 α\alpha 的關係的理解。

核心觀念:

  1. 顯著水準 (α\alpha): 虛無假設 (H0H_0) 為真時,拒絕 H0H_0 的機率。它是 Type I 錯誤的機率上限。
  2. 檢定 Power (1−β1-\beta): 對立假設 (HαH_\alpha) 為真時,拒絕 H0H_0 的機率。它是正確決策的機率。
  3. α\alpha 與 Power 的關係: α\alpha 是在 H0H_0 為真時的機率,而 Power 是在 HαH_\alpha 為真時的機率。兩者描述的是不同條件下的機率,它們之間沒有固定的大小關係,可以互相獨立。

判斷:True

解釋:

  • 顯著水準 α\alpha 是 Type I 錯誤的機率,即當虛無假設為真時,我們錯誤地拒絕它。
  • 檢定 Power (1−β1-\beta) 是正確地拒絕虛無假設的機率,即當對立假設為真時,我們正確地拒絕虛無假設。
🔒

後續完整解題步驟與【答案】

免費註冊,享三天全站完整詳解閱覽。

免費註冊

第 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.

登入後即可作答並保存紀錄。

這一題的完整詳解

此題考驗對顯著水準 α\alpha 和 Type I 錯誤機率的理解。

核心觀念:

  1. 顯著水準 (α\alpha): 在進行假設檢定前,使用者設定的一個機率值。它代表了在虛無假設為真時,我們願意承擔的最大錯誤決策(拒絕 H0H_0)的風險。
  2. Type I 錯誤: 當虛無假設 (H0H_0) 為真時,卻錯誤地拒絕了虛無假設。
  3. Type I 錯誤的機率: 在虛無假設為真時,實際發生 Type I 錯誤的機率。

判斷:False

🔒

後續完整解題步驟與【答案】

免費註冊,享三天全站完整詳解閱覽。

免費註冊

第 7 題

Suppose that a random sample from a normal distribution N(μ,σ2)N(\mu, \sigma^2) results in the following observations:
79,82,63,75,83,99,71,76,77,and 8579, 82, 63, 75, 83, 99, 71, 76, 77, \text{and } 85.

(a) Construct a 95%95\% confidence interval for σ2\sigma^2 if μ\mu is unknown.
(b) Suppose that μ\mu is known to be 8080. Construct a 95%95\% confidence interval for σ2\sigma^2, using the information of μ\mu. What is your interpretation about this interval estimate?

登入後即可作答並保存紀錄。

這一題的完整詳解

此題主要考驗如何建構母體變異數 σ2\sigma^2 的信賴區間,並區分 μ\mu 未知與已知時的差異。

核心觀念:

  1. 母體變異數 σ2\sigma^2 的信賴區間:
    • 當 μ\mu 未知時,使用 χ2\chi^2 分配。樣本變異數 s2=1n−1∑i=1n(xi−xˉ)2s^2 = \frac{1}{n-1} \sum_{i=1}^n (x_i - \bar{x})^2。信賴區間為 ((n−1)s2χα/2,n−12,(n−1)s2χ1−α/2,n−12)\left( \frac{(n-1)s^2}{\chi^2_{\alpha/2, n-1}}, \frac{(n-1)s^2}{\chi^2_{1-\alpha/2, n-1}} \right)。
    • 當 μ\mu 已知時,使用 χ2\chi^2 分配。使用修正的樣本變異數 s~2=1n∑i=1n(xi−μ0)2\tilde{s}^2 = \frac{1}{n} \sum_{i=1}^n (x_i - \mu_0)^2。信賴區間為 (ns~2χα/2,n2,ns~2χ1−α/2,n2)\left( \frac{n\tilde{s}^2}{\chi^2_{\alpha/2, n}}, \frac{n\tilde{s}^2}{\chi^2_{1-\alpha/2, n}} \right)。
  2. χ2\chi^2 分配的自由度: 當 μ\mu 未知時,自由度為 n−1n-1;當 μ\mu 已知時,自由度為 nn。
  3. 信賴區間的解釋: 95% 的信賴區間表示,如果我們重複多次抽樣並計算信賴區間,平均有 95% 的區間會包含真實的母體參數。

數據準備:
樣本大小 n=10n = 10。
樣本數據:79,82,63,75,83,99,71,76,77,8579, 82, 63, 75, 83, 99, 71, 76, 77, 85。

步驟 1:計算樣本平均數 xˉ\bar{x}
xˉ=79+82+63+75+83+99+71+76+77+8510=79010=79\bar{x} = \frac{79+82+63+75+83+99+71+76+77+85}{10} = \frac{790}{10} = 79。

步驟 2:計算樣本變異數 s2s^2 (用於 (a) μ\mu 未知)
首先計算平方和 ∑i=110(xi−xˉ)2\sum_{i=1}^{10} (x_i - \bar{x})^2:
(79−79)2=0(79-79)^2 = 0
(82−79)2=32=9(82-79)^2 = 3^2 = 9
(63−79)2=(−16)2=256(63-79)^2 = (-16)^2 = 256
(75−79)2=(−4)2=16(75-79)^2 = (-4)^2 = 16
(83−79)2=42=16(83-79)^2 = 4^2 = 16
(99−79)2=202=400(99-79)^2 = 20^2 = 400
(71−79)2=(−8)2=64(71-79)^2 = (-8)^2 = 64
(76−79)2=(−3)2=9(76-79)^2 = (-3)^2 = 9
(77−79)2=(−2)2=4(77-79)^2 = (-2)^2 = 4
(85−79)2=62=36(85-79)^2 = 6^2 = 36
總和 =0+9+256+16+16+400+64+9+4+36=810= 0 + 9 + 256 + 16 + 16 + 400 + 64 + 9 + 4 + 36 = 810。

樣本變異數 s2=∑(xi−xˉ)2n−1=81010−1=8109=90s^2 = \frac{\sum (x_i - \bar{x})^2}{n-1} = \frac{810}{10-1} = \frac{810}{9} = 90。

(a) μ\mu 未知時,建構 95% 信賴區間

步驟 3:確定 χ2\chi^2 分配的臨界值
信賴水準為 95%95\%,所以 α=1−0.95=0.05\alpha = 1 - 0.95 = 0.05。
自由度為 n−1=10−1=9n-1 = 10-1 = 9。
我們需要 χ0.025,92\chi^2_{0.025, 9} 和 χ1−0.025,92=χ0.975,92\chi^2_{1-0.025, 9} = \chi^2_{0.975, 9}。
查 χ2\chi^2 分配表:
χ0.025,92≈19.023\chi^2_{0.025, 9} \approx 19.023
χ0.975,92≈2.700\chi^2_{0.975, 9} \approx 2.700

步驟 4:計算信賴區間

🔒

後續完整解題步驟與【答案】

免費註冊,享三天全站完整詳解閱覽。

免費註冊

第 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: Y=β0+β1X1+ϵY = \beta_0 + \beta_1 X_1 + \epsilon
Model 2: Y=β0+β1X1+β2X2+ϵY = \beta_0 + \beta_1 X_1 + \beta_2 X_2 + \epsilon
Model 3: Y=β0+β1X1+β3X3+β4X4+β5X5+ϵY = \beta_0 + \beta_1 X_1 + \beta_3 X_3 + \beta_4 X_4 + \beta_5 X_5 + \epsilon

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 VariationSum of SquaresDegree of FreedomMean SquareF
Regression623,1731(A2)(A5)
Error3,319,382336(A3)
Total(A1)337(A4)
PredictorCoefSE Coef
Constant732.3624.90
price-163.1820.55

(a) (7%) If the model is fitted directly without preliminary exploratory data analysis, such as scatter plots, it yields the unsatisfactory R2R^2. 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 R2R^2. 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 X2X_2 is some other variable in the dataset. Is it possible that the R2R^2 under Model 1 and Model 2 take on identical values? Explain.

(c) (6%) Model 3 includes three additional predictors, X3,X4X_3, X_4, and X5X_5, 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 0.050.05 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.)

🖼️ 本題含圖表,以下為原卷對應頁面:
原卷第 2 頁原卷第 3 頁

登入後即可作答並保存紀錄。

這一題的完整詳解

此題為一綜合題,涵蓋了迴歸分析中的模型擴充、R2R^2 的判斷以及複迴歸的聯合檢定。

核心觀念:

  1. 迴歸分析的基本概念: 包含總變異量 (SST)、迴歸變異量 (SSR)、殘差變異量 (SSE) 及其關係:SST=SSR+SSESST = SSR + SSE。
  2. R2R^2 (判定係數): R2=SSRSST=1−SSESSTR^2 = \frac{SSR}{SST} = 1 - \frac{SSE}{SST}。它衡量模型解釋了應變數總變異的比例。
  3. 模型擴充的理由: 當初步分析顯示模型不佳(如 R2R^2 低、殘差圖顯示模式)時,可以考慮加入其他潛在變數或變數的轉換(如多項式項、交互項、類別變數的虛擬變數)來改善模型。
  4. 複迴歸的聯合檢定 (Global Test): 用於檢定所有迴歸係數(不含截距項)是否同時為零。使用 F 檢定。
  5. F 檢定的統計量: F=SSR/kSSE/(n−k−1)F = \frac{SSR/k}{SSE/(n-k-1)},其中 kk 是自變數的個數。

數據整理與計算 (Model 1)
由 ANOVA 表格:
n=338n = 338 (總觀測數)
k=1k = 1 (Model 1 中自變數 X1X_1 的個數)

Regression Sum of Squares (SSR) = 623,173
Error Sum of Squares (SSE) = 3,319,382
Total Sum of Squares (SST) = A1 = SSR + SSE = 623,173 + 3,319,382 = 3,942,555

Degree of Freedom for Regression (dfR) = 1
Degree of Freedom for Error (dfE) = 336
Degree of Freedom for Total (dfT) = 337

Mean Square Regression (MSR) = A2 = SSR / dfR = 623,173 / 1 = 623,173
Mean Square Error (MSE) = A3 = SSE / dfE = 3,319,382 / 336 ≈ 9879.113

F statistic (A5) = MSR / MSE = 623,173 / 9879.113 ≈ 63.077

R2=SSRSST=623,1733,942,555≈0.1581R^2 = \frac{SSR}{SST} = \frac{623,173}{3,942,555} \approx 0.1581
或者 R2=1−SSESST=1−3,319,3823,942,555≈1−0.8419=0.1581R^2 = 1 - \frac{SSE}{SST} = 1 - \frac{3,319,382}{3,942,555} \approx 1 - 0.8419 = 0.1581

從 Predictor 表格:
截距 (Constant) 的係數 β^0=732.36\hat{\beta}_0 = 732.36
X1X_1 (price) 的係數 β^1=−163.18\hat{\beta}_1 = -163.18
X1X_1 的標準誤 SE(β^1\hat{\beta}_1) = 20.55

(a) 模型擴充建議

問題分析:
散佈圖顯示 YY (volume) 對 X1X_1 (price) 的關係,對於 Boston (圓圈) 和 San Diego (叉叉) 兩個地區,似乎並非單純的線性關係。

  1. 非線性關係: 數據點似乎呈現一種「U」型或「倒U」型的趨勢,尤其是在較低的價格範圍,隨著價格上升,銷量先下降,但到某個點後,銷量又開始上升,或者存在一個價格區間,銷量相對較高。這暗示了平方項 (X12X_1^2) 可能是一個有用的加入項。
  2. 地區差異: 散佈圖顯示 Boston 和 San Diego 的數據點有明顯的分佈差異。Boston 的點(圓圈)似乎集中在較低的價格和中等的銷量範圍,而 San Diego 的點(叉叉)則在較高的價格範圍有較多的觀測,並且銷量也有較高的情況。這暗示了地區變數可能對銷量有顯著影響,需要引入地區的虛擬變數 (dummy variables)。

建議的擴充模型:
基於上述觀察,一個合理的擴充模型可以包含價格的平方項以及地區的虛擬變數。

模型建議:
Y=β0+β1X1+β2X12+β3D+ϵY = \beta_0 + \beta_1 X_1 + \beta_2 X_1^2 + \beta_3 D + \epsilon

變數定義:

  • YY: 總銷售量 (volume)。
  • X1X_1: 價格 (price)。
  • X12X_1^2: 價格的平方項,用以捕捉價格與銷量之間可能的非線性關係。
  • DD: 一個地區的虛擬變數 (dummy variable)。由於我們有兩個地區 (Boston 和 San Diego),我們可以設立一個虛擬變數。例如:
    • D=1D = 1 if the region is San Diego
    • D=0D = 0 if the region is Boston
      (這裡我們選擇 Boston 作為參考組)。
  • β0\beta_0: 截距項。
  • β1\beta_1: 價格 X1X_1 的係數(當 D=0D=0,即 Boston 時)。
  • β2\beta_2: 價格平方項 X12X_1^2 的係數。
  • β3\beta_3: 地區虛擬變數 DD 的係數。它代表了 San Diego 相對於 Boston 的價格效應變動。
  • ϵ\epsilon: 殘差項。

理由:

  1. 捕捉非線性: 加入 X12X_1^2 項可以捕捉價格與銷量之間可能存在的曲線關係,例如 U 型或倒 U 型的關係,這比單純的線性關係更符合散佈圖的視覺觀察。
  2. 考慮地區效應: 加入地區虛擬變數 DD 可以讓模型考慮到不同地區(Boston 與 San Diego)的銷售行為可能存在系統性差異。例如,San Diego 的消費者可能對價格的反應不同,或者有其他未被模型包含但與地區相關的因素影響銷量。β3\beta_3 的存在允許模型為 San Diego 的銷售量建立一個與 Boston 不同的基線水平,或者影響價格係數的效應。

其他可能的擴充:

  • 交互項: 也可以考慮價格與地區的交互項,例如 β4(X1×D)\beta_4 (X_1 \times D)。這將允許價格對銷量的影響在不同地區有所不同。
    模型會變成:Y=β0+β1X1+β2X12+β3D+β4(X1×D)+ϵY = \beta_0 + \beta_1 X_1 + \beta_2 X_1^2 + \beta_3 D + \beta_4 (X_1 \times D) + \epsilon。
    這個模型更為完整,因為它允許價格的線性效應 (由 β1\beta_1 和 β4\beta_4 控制) 以及價格的平方效應 (由 β2\beta_2 控制) 都可能因地區而異。

(在此題中,只需建議一個合理的模型,上述包含 X12X_1^2 和 DD 的模型是足夠的。)

【答案】
建議模型:Y=β0+β1X1+β2X12+β3D+ϵY = \beta_0 + \beta_1 X_1 + \beta_2 X_1^2 + \beta_3 D + \epsilon
變數定義:
YY: 總銷售量 (volume)。
X1X_1: 價格 (price)。
X12X_1^2: 價格的平方項。
DD: 地區虛擬變數,若地區為 San Diego,D=1D=1;若地區為 Boston,D=0D=0。
ϵ\epsilon: 殘差項。
理由:散佈圖顯示 Y 對 X1X_1 的關係可能存在非線性(U型或倒U型),故加入 X12X_1^2;同時,Boston 和 San Diego 的數據點分佈有明顯差異,顯示地區效應顯著,故加入地區虛擬變數 DD 來捕捉此差異。

(b) Model 1 與 Model 2 的 R2R^2 值是否可能相同?

問題分析:
Model 1: Y=β0+β1X1+ϵY = \beta_0 + \beta_1 X_1 + \epsilon
Model 2: Y=β0+β1X1+β2X2+ϵY = \beta_0 + \beta_1 X_1 + \beta_2 X_2 + \epsilon

Model 2 在 Model 1 的基礎上加入了一個新的自變數 X2X_2。
R2R^2 的定義是 R2=1−SSESSTR^2 = 1 - \frac{SSE}{SST}。
SSESSE 是殘差平方和,代表模型未能解釋的變異量。
SSTSST 是總平方和,代表應變數 YY 的總變異量。

判斷:可能相同,但只有在 X2X_2 對 YY 沒有任何解釋力時。

解釋:

  • 當我們加入一個新的自變數到迴歸模型中時,殘差平方和 (SSE) 永遠不會增加,只會保持不變或減少。
  • R2R^2 的公式是 R2=SSRSST=1−SSESSTR^2 = \frac{SSR}{SST} = 1 - \frac{SSE}{SST}。
🔒

後續完整解題步驟與【答案】

免費註冊,享三天全站完整詳解閱覽。

免費註冊

第 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 X1,X2,…,XnX_1, X_2, \dots, X_n is used to denote the values at time points 1,2,…,n1, 2, \dots, n (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 ss and tt, for 1≤s,t≤n1 \le s, t \le n, is defined and considered:
yX(s,t)=E[(Xs−μs)(Xt−μt)]y_X(s, t) = E[(X_s - \mu_s)(X_t - \mu_t)]
where μs=E(Xs)\mu_s = E(X_s). 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) E(Xt)E(X_t) is constant and does not depend on time tt;
(ii) the ACF yX(s,t)y_X(s, t) depends on ss and tt only through their difference ∣s−t∣|s - t|.

The computation of the sample ACF is a crucial step before fitting some time series models. Sample ACF:
γ^(h)=1n−h∑t=1n−h(xt+h−xˉ)(xt−xˉ)\hat{\gamma}(h) = \frac{1}{n-h} \sum_{t=1}^{n-h} (x_{t+h} - \bar{x})(x_t - \bar{x})
where xˉ\bar{x} is the sample mean.

Please answer Questions (a) to (d).

(a) (5%) Consider the time series Xt=β0+β1t+ZtX_t = \beta_0 + \beta_1 t + Z_t, where β0\beta_0 and β1\beta_1 are known constants and ZtZ_t is a sequence of i.i.d. random variables with mean 00 and variance σ2\sigma^2. Determine whether XtX_t is weakly stationary.

(b) (5%) Derive the ACF for the following process
Xt=Zt+aZt−1+b⋅Zt−2X_t = Z_t + a Z_{t-1} + b \cdot Z_{t-2}
where aa and bb are parameters, and ZtZ_t is a sequence of i.i.d. random variables with mean 00 and variance σ2\sigma^2.

(c) (8%) Suppose that we have one observed time series of length 3030, denoted by x1,x2,…,x30x_1, x_2, \dots, x_{30}, and the value of x3x_3 and x15x_{15} are missing. That is, what we observed: x1,x2,x4,…,x14,x16,…,x30x_1, x_2, x_4, \dots, x_{14}, x_{16}, \dots, x_{30}. 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 y1=x1,y2=x2,y3=x4,…,y13=x14,y14=x16,…,y28=x30y_1 = x_1, y_2 = x_2, y_3 = x_4, \dots, y_{13} = x_{14}, y_{14} = x_{16}, \dots, y_{28} = x_{30}, and the student computed sample ACF on the series {yt}\{y_t\} for the sample ACF of XtX_t. 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.

登入後即可作答並保存紀錄。

這一題的完整詳解

此題為時間序列分析的綜合題,涵蓋了弱定常性判斷、自共變異數函數 (ACF) 推導、以及處理缺失值的方法。

核心觀念:

  1. 弱定常性 (Weak Stationarity): 一個時間序列若滿足:(i) 平均數不隨時間改變 (E(Xt)=μE(X_t) = \mu 為常數),(ii) 自共變異數 Cov(Xs,Xt)Cov(X_s, X_t) 僅取決於時間差 ∣s−t∣|s-t|,則稱之為弱定常。
  2. 自共變異數函數 (ACF): 衡量時間序列在不同時間點上的協變異程度,對於定常過程,通常定義為 γ(h)=Cov(Xt,Xt+h)\gamma(h) = Cov(X_t, X_{t+h})。
  3. 樣本 ACF: 用於估計真實 ACF 的統計量。
  4. 缺失值處理: 在時間序列分析中,缺失值會影響 ACF 的計算,需要妥善處理。常見方法包括刪除觀測值、插補法等。

(a) 判斷 Xt=β0+β1t+ZtX_t = \beta_0 + \beta_1 t + Z_t 是否為弱定常

步驟 1:檢查平均數是否為常數
E(Xt)=E(β0+β1t+Zt)E(X_t) = E(\beta_0 + \beta_1 t + Z_t)
由於 β0\beta_0 和 β1\beta_1 是常數,且 E(Zt)=0E(Z_t) = 0,
E(Xt)=β0+β1t+E(Zt)=β0+β1tE(X_t) = \beta_0 + \beta_1 t + E(Z_t) = \beta_0 + \beta_1 t。
因為 E(Xt)E(X_t) 包含時間項 tt,它不是一個常數,而是隨時間 tt 變化的。
根據弱定常性的定義 (i),平均數必須是常數。此序列的平均數隨時間改變。

結論: XtX_t 不是弱定常過程。

【答案】 XtX_t 不是弱定常過程。因為其平均數 E(Xt)=β0+β1tE(X_t) = \beta_0 + \beta_1 t 隨時間 tt 改變,不滿足弱定常性的第一個條件。

(b) 推導 Xt=Zt+aZt−1+bZt−2X_t = Z_t + a Z_{t-1} + b Z_{t-2} 的 ACF

核心觀念:

  • MA(2) 模型 (Moving Average of order 2)。
  • 自共變異數 γ(h)=Cov(Xt,Xt+h)\gamma(h) = Cov(X_t, X_{t+h})。
  • Cov(Xt,Xt+h)=Cov(∑iciZt−i,∑jcjZt+h−j)Cov(X_t, X_{t+h}) = Cov(\sum_{i} c_i Z_{t-i}, \sum_{j} c_j Z_{t+h-j})。
  • 由於 ZtZ_t 是 i.i.d. 且 E(Zt)=0,Var(Zt)=σ2E(Z_t) = 0, Var(Z_t) = \sigma^2,則 Cov(Zi,Zj)=0Cov(Z_i, Z_j) = 0 if i≠ji \neq j, and Cov(Zi,Zi)=Var(Zi)=σ2Cov(Z_i, Z_i) = Var(Z_i) = \sigma^2。

步驟 1:計算平均數
E(Xt)=E(Zt+aZt−1+bZt−2)E(X_t) = E(Z_t + a Z_{t-1} + b Z_{t-2})
E(Xt)=E(Zt)+aE(Zt−1)+bE(Zt−2)E(X_t) = E(Z_t) + a E(Z_{t-1}) + b E(Z_{t-2})
由於 E(Zk)=0E(Z_k) = 0 對於所有 kk。
E(Xt)=0+a(0)+b(0)=0E(X_t) = 0 + a(0) + b(0) = 0。
平均數為 0,是一個常數。

步驟 2:計算自共變異數 γ(h)=Cov(Xt,Xt+h)\gamma(h) = Cov(X_t, X_{t+h})
我們需要計算 h=0,1,2h=0, 1, 2 的情況,因為模型中最多有 Zt−2Z_{t-2}。

情況 h=0:計算變異數 γ(0)=Var(Xt)\gamma(0) = Var(X_t)
Var(Xt)=Var(Zt+aZt−1+bZt−2)Var(X_t) = Var(Z_t + a Z_{t-1} + b Z_{t-2})
由於 Zt,Zt−1,Zt−2Z_t, Z_{t-1}, Z_{t-2} 是獨立的,
Var(Xt)=Var(Zt)+Var(aZt−1)+Var(bZt−2)Var(X_t) = Var(Z_t) + Var(a Z_{t-1}) + Var(b Z_{t-2})
Var(Xt)=Var(Zt)+a2Var(Zt−1)+b2Var(Zt−2)Var(X_t) = Var(Z_t) + a^2 Var(Z_{t-1}) + b^2 Var(Z_{t-2})
Var(Xt)=σ2+a2σ2+b2σ2=σ2(1+a2+b2)Var(X_t) = \sigma^2 + a^2 \sigma^2 + b^2 \sigma^2 = \sigma^2 (1 + a^2 + b^2)。
所以,γ(0)=σ2(1+a2+b2)\gamma(0) = \sigma^2 (1 + a^2 + b^2)。

情況 h=1:計算 γ(1)=Cov(Xt,Xt+1)\gamma(1) = Cov(X_t, X_{t+1})
Xt=Zt+aZt−1+bZt−2X_t = Z_t + a Z_{t-1} + b Z_{t-2}
Xt+1=Zt+1+aZt+bZt−1X_{t+1} = Z_{t+1} + a Z_{t} + b Z_{t-1}
Cov(Xt,Xt+1)=Cov(Zt+aZt−1+bZt−2,Zt+1+aZt+bZt−1)Cov(X_t, X_{t+1}) = Cov(Z_t + a Z_{t-1} + b Z_{t-2}, Z_{t+1} + a Z_{t} + b Z_{t-1})
展開後,由於 ZiZ_i 之間互相獨立,只有當索引相同時,協變異數才不為零。
Cov(Xt,Xt+1)=Cov(Zt,aZt)+Cov(aZt−1,bZt−1)+Cov(bZt−2,Zt+1)+...Cov(X_t, X_{t+1}) = Cov(Z_t, a Z_t) + Cov(a Z_{t-1}, b Z_{t-1}) + Cov(b Z_{t-2}, Z_{t+1}) + ... (其他項的 ZZ 索引不同)
Cov(Xt,Xt+1)=aCov(Zt,Zt)+abCov(Zt−1,Zt−1)Cov(X_t, X_{t+1}) = a Cov(Z_t, Z_t) + ab Cov(Z_{t-1}, Z_{t-1})
Cov(Xt,Xt+1)=aVar(Zt)+abVar(Zt−1)Cov(X_t, X_{t+1}) = a Var(Z_t) + ab Var(Z_{t-1})
Cov(Xt,Xt+1)=aσ2+abσ2=σ2(a+ab)Cov(X_t, X_{t+1}) = a \sigma^2 + ab \sigma^2 = \sigma^2 (a + ab)。
所以,γ(1)=σ2(a+ab)\gamma(1) = \sigma^2 (a + ab)。

情況 h=2:計算 γ(2)=Cov(Xt,Xt+2)\gamma(2) = Cov(X_t, X_{t+2})
Xt=Zt+aZt−1+bZt−2X_t = Z_t + a Z_{t-1} + b Z_{t-2}
Xt+2=Zt+2+aZt+1+bZtX_{t+2} = Z_{t+2} + a Z_{t+1} + b Z_{t}
Cov(Xt,Xt+2)=Cov(Zt+aZt−1+bZt−2,Zt+2+aZt+1+bZt)Cov(X_t, X_{t+2}) = Cov(Z_t + a Z_{t-1} + b Z_{t-2}, Z_{t+2} + a Z_{t+1} + b Z_{t})
Cov(Xt,Xt+2)=Cov(bZt−2,Zt+2)+Cov(aZt−1,Zt+2)+Cov(Zt,bZt)Cov(X_t, X_{t+2}) = Cov(b Z_{t-2}, Z_{t+2}) + Cov(a Z_{t-1}, Z_{t+2}) + Cov(Z_t, b Z_t)
Cov(Xt,Xt+2)=Cov(Zt,bZt)Cov(X_t, X_{t+2}) = Cov(Z_t, b Z_t)
Cov(Xt,Xt+2)=bCov(Zt,Zt)=bVar(Zt)=bσ2Cov(X_t, X_{t+2}) = b Cov(Z_t, Z_t) = b Var(Z_t) = b \sigma^2。
所以,γ(2)=bσ2\gamma(2) = b \sigma^2。

情況 h > 2:計算 γ(h)=Cov(Xt,Xt+h)\gamma(h) = Cov(X_t, X_{t+h}) for h>2h > 2
Xt=Zt+aZt−1+bZt−2X_t = Z_t + a Z_{t-1} + b Z_{t-2}
Xt+h=Zt+h+aZt+h−1+bZt+h−2X_{t+h} = Z_{t+h} + a Z_{t+h-1} + b Z_{t+h-2}
由於 h>2h > 2,則 t+h−2>t−2t+h-2 > t-2。所以 XtX_t 中的 ZZ 項的索引 ( t,t−1,t−2t, t-1, t-2 ) 和 Xt+hX_{t+h} 中的 ZZ 項的索引 ( t+h,t+h−1,t+h−2t+h, t+h-1, t+h-2 ) 之間,沒有相同的索引。
因此,所有的協變異數項都是零。
Cov(Xt,Xt+h)=0Cov(X_t, X_{t+h}) = 0 for h>2h > 2。

ACF 的定義:
ρ(h)=γ(h)γ(0)\rho(h) = \frac{\gamma(h)}{\gamma(0)}

ACF 結果:
γ(0)=σ2(1+a2+b2)\gamma(0) = \sigma^2 (1 + a^2 + b^2)
γ(1)=σ2(a+ab)\gamma(1) = \sigma^2 (a + ab)
γ(2)=bσ2\gamma(2) = b \sigma^2
γ(h)=0\gamma(h) = 0 for h>2h > 2

【答案】
自共變異數函數 (ACF) 如下:
γ(0)=Cov(Xt,Xt)=σ2(1+a2+b2)\gamma(0) = Cov(X_t, X_t) = \sigma^2 (1 + a^2 + b^2)
γ(1)=Cov(Xt,Xt+1)=σ2(a+ab)\gamma(1) = Cov(X_t, X_{t+1}) = \sigma^2 (a + ab)
γ(2)=Cov(Xt,Xt+2)=bσ2\gamma(2) = Cov(X_t, X_{t+2}) = b \sigma^2
γ(h)=Cov(Xt,Xt+h)=0\gamma(h) = Cov(X_t, X_{t+h}) = 0 for h>2h > 2。

(c) 關於學生處理缺失值方法的評論

學生方法: 直接刪除缺失值,並將剩餘的觀測值視為一個連續的序列來計算樣本 ACF。
原始序列長度 n=30n = 30。
缺失值:x3,x15x_3, x_{15}。

🔒

後續完整解題步驟與【答案】

免費註冊,享三天全站完整詳解閱覽。

免費註冊

其他考古題