115 年 國立臺灣大學土木系碩士班交通組《工程統計》

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

第 1 題20 分

Derive the mean and variance of the normal distribution.

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

這一題的完整詳解

本題要求推導常態(常態)分配的期望值(平均數)與變異數。

常態分配的機率密度函數 (PDF) 為:
f(x∣μ,σ2)=12πσ2e−(x−μ)22σ2,−∞<x<∞f(x|\mu, \sigma^2) = \frac{1}{\sqrt{2\pi\sigma^2}} e^{-\frac{(x-\mu)^2}{2\sigma^2}}, \quad -\infty < x < \infty
其中 μ\mu 是平均值,σ2\sigma^2 是變異數。

1. 推導平均值 (Mean, μ\mu)

根據期望值的定義,平均值是機率密度函數 f(x)f(x) 與 xx 的乘積在整個定義域上的積分:
μ=E[X]=∫−∞∞xf(x∣μ,σ2)dx=∫−∞∞x12πσ2e−(x−μ)22σ2dx\mu = E[X] = \int_{-\infty}^{\infty} x f(x|\mu, \sigma^2) dx = \int_{-\infty}^{\infty} x \frac{1}{\sqrt{2\pi\sigma^2}} e^{-\frac{(x-\mu)^2}{2\sigma^2}} dx
為了簡化積分,我們進行變數代換。令 y=x−μy = x - \mu,則 x=y+μx = y + \mu 且 dx=dydx = dy。積分範圍不變。
μ=∫−∞∞(y+μ)12πσ2e−y22σ2dy\mu = \int_{-\infty}^{\infty} (y + \mu) \frac{1}{\sqrt{2\pi\sigma^2}} e^{-\frac{y^2}{2\sigma^2}} dy
將積分拆成兩部分:
μ=∫−∞∞y12πσ2e−y22σ2dy+∫−∞∞μ12πσ2e−y22σ2dy\mu = \int_{-\infty}^{\infty} y \frac{1}{\sqrt{2\pi\sigma^2}} e^{-\frac{y^2}{2\sigma^2}} dy + \int_{-\infty}^{\infty} \mu \frac{1}{\sqrt{2\pi\sigma^2}} e^{-\frac{y^2}{2\sigma^2}} dy
考慮第一項積分:
∫−∞∞y12πσ2e−y22σ2dy\int_{-\infty}^{\infty} y \frac{1}{\sqrt{2\pi\sigma^2}} e^{-\frac{y^2}{2\sigma^2}} dy
被積函數 g(y)=ye−y22σ2g(y) = y e^{-\frac{y^2}{2\sigma^2}} 是一個奇函數(g(−y)=−ye−(−y)22σ2=−ye−y22σ2=−g(y)g(-y) = -y e^{-\frac{(-y)^2}{2\sigma^2}} = -y e^{-\frac{y^2}{2\sigma^2}} = -g(y))。奇函數在對稱區間(−∞-\infty 到 ∞\infty)上的積分為 0。
因此,第一項積分等於 0。

考慮第二項積分:
∫−∞∞μ12πσ2e−y22σ2dy=μ∫−∞∞12πσ2e−y22σ2dy\int_{-\infty}^{\infty} \mu \frac{1}{\sqrt{2\pi\sigma^2}} e^{-\frac{y^2}{2\sigma^2}} dy = \mu \int_{-\infty}^{\infty} \frac{1}{\sqrt{2\pi\sigma^2}} e^{-\frac{y^2}{2\sigma^2}} dy
第二項中的積分是標準常態機率密度函數在整個定義域上的積分,根據定義,這個積分值為 1。
∫−∞∞12πσ2e−y22σ2dy=1\int_{-\infty}^{\infty} \frac{1}{\sqrt{2\pi\sigma^2}} e^{-\frac{y^2}{2\sigma^2}} dy = 1
所以,第二項積分等於 μ×1=μ\mu \times 1 = \mu。

將兩項結果相加:
μ=0+μ=μ\mu = 0 + \mu = \mu
這證明了常態分配的平均值就是參數 μ\mu。

2. 推導變異數 (Variance, σ2\sigma^2)

變異數的定義是 Var(X)=E[(X−μ)2]Var(X) = E[(X - \mu)^2]。
Var(X)=∫−∞∞(x−μ)2f(x∣μ,σ2)dx=∫−∞∞(x−μ)212πσ2e−(x−μ)22σ2dxVar(X) = \int_{-\infty}^{\infty} (x-\mu)^2 f(x|\mu, \sigma^2) dx = \int_{-\infty}^{\infty} (x-\mu)^2 \frac{1}{\sqrt{2\pi\sigma^2}} e^{-\frac{(x-\mu)^2}{2\sigma^2}} dx
再次進行變數代換 y=x−μy = x - \mu,則 dy=dxdy = dx。

🔒

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

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

免費註冊

第 2 題20 分

A civil engineering firm wants to evaluate whether a newly introduced workplace safety program has successfully reduced the number of on-site accidents. Accident counts were collected at six construction sites during a comparable time period before and after the safety program was implemented. The recorded data are shown in the table below.

Site123456
Before129141089
After97138611

At a significance level of 0.05, assess whether the new safety program is effective in reducing the number of accidents.
(a) Analyze the data without treating the observations as paired.
(b) Analyze the data by treating the observations as paired.

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

這一題的完整詳解

本題旨在評估一項新的職場安全計畫是否有效降低了工地事故數量。我們將使用統計檢定來分析提供的數據,並比較兩種不同的分析方法:獨立樣本檢定和配對樣本檢定。顯著水準 α=0.05\alpha = 0.05。

數據摘要:
我們有六個工地(樣本),每個工地在實施安全計畫「之前」和「之後」各記錄了一次事故數量。

Before (計畫前) 數據: x1={12,9,14,10,8,9}x_1 = \{12, 9, 14, 10, 8, 9\}
After (計畫後) 數據: y1={9,7,13,8,6,11}y_1 = \{9, 7, 13, 8, 6, 11\}

a) 不將觀察值視為配對(獨立樣本 t 檢定)

這種方法將「Before」的事故數和「After」的事故數分別視為兩個獨立的樣本群體,假設它們來自具有相同變異數(或不同變異數)的兩個常態分配。由於我們只有 6 個樣本,通常會假設變異數相等(pooled variance t-test)。

假設:

  • 虛無假設 H0H_0: 安全計畫沒有降低事故數量,即計畫前後的平均事故數沒有差異或增加,μBefore≤μAfter\mu_{\text{Before}} \le \mu_{\text{After}}。
  • 對立假設 H1H_1: 安全計畫降低了事故數量,即計畫前的平均事故數大於計畫後的平均事故數,μBefore>μAfter\mu_{\text{Before}} > \mu_{\text{After}}。
    等價於:μAfter−μBefore<0\mu_{\text{After}} - \mu_{\text{Before}} < 0。

計算:
首先計算兩個樣本的平均值和變異數。

Before (x):
樣本數 n1=6n_1 = 6
平均值 xˉ=12+9+14+10+8+96=626=10.333\bar{x} = \frac{12+9+14+10+8+9}{6} = \frac{62}{6} = 10.333
變異數 s12=∑(xi−xˉ)2n1−1s_1^2 = \frac{\sum(x_i - \bar{x})^2}{n_1-1}
(12−10.333)2=1.6672≈2.778(12-10.333)^2 = 1.667^2 \approx 2.778
(9−10.333)2=(−1.333)2≈1.778(9-10.333)^2 = (-1.333)^2 \approx 1.778
(14−10.333)2=3.6672≈13.444(14-10.333)^2 = 3.667^2 \approx 13.444
(10−10.333)2=(−0.333)2≈0.111(10-10.333)^2 = (-0.333)^2 \approx 0.111
(8−10.333)2=(−2.333)2≈5.444(8-10.333)^2 = (-2.333)^2 \approx 5.444
(9−10.333)2=(−1.333)2≈1.778(9-10.333)^2 = (-1.333)^2 \approx 1.778
∑(xi−xˉ)2≈2.778+1.778+13.444+0.111+5.444+1.778=25.333\sum(x_i - \bar{x})^2 \approx 2.778 + 1.778 + 13.444 + 0.111 + 5.444 + 1.778 = 25.333
s12=25.3336−1=25.3335=5.067s_1^2 = \frac{25.333}{6-1} = \frac{25.333}{5} = 5.067

After (y):
樣本數 n2=6n_2 = 6
平均值 yˉ=9+7+13+8+6+116=546=9.000\bar{y} = \frac{9+7+13+8+6+11}{6} = \frac{54}{6} = 9.000
變異數 s22=∑(yi−yˉ)2n2−1s_2^2 = \frac{\sum(y_i - \bar{y})^2}{n_2-1}
(9−9)2=02=0(9-9)^2 = 0^2 = 0
(7−9)2=(−2)2=4(7-9)^2 = (-2)^2 = 4
(13−9)2=42=16(13-9)^2 = 4^2 = 16
(8−9)2=(−1)2=1(8-9)^2 = (-1)^2 = 1
(6−9)2=(−3)2=9(6-9)^2 = (-3)^2 = 9
(11−9)2=22=4(11-9)^2 = 2^2 = 4
∑(yi−yˉ)2=0+4+16+1+9+4=34\sum(y_i - \bar{y})^2 = 0 + 4 + 16 + 1 + 9 + 4 = 34
s22=346−1=345=6.800s_2^2 = \frac{34}{6-1} = \frac{34}{5} = 6.800

由於 s12≈5.067s_1^2 \approx 5.067 和 s22≈6.800s_2^2 \approx 6.800,兩者相差不算太大,我們可以考慮合併變異數(pooled variance)的 t 檢定。

合併變異數 sp2=(n1−1)s12+(n2−1)s22n1+n2−2s_p^2 = \frac{(n_1-1)s_1^2 + (n_2-1)s_2^2}{n_1+n_2-2}
sp2=(6−1)×5.067+(6−1)×6.8006+6−2=5×5.067+5×6.80010=25.335+34.00010=59.33510=5.9335s_p^2 = \frac{(6-1) \times 5.067 + (6-1) \times 6.800}{6+6-2} = \frac{5 \times 5.067 + 5 \times 6.800}{10} = \frac{25.335 + 34.000}{10} = \frac{59.335}{10} = 5.9335

檢定統計量 t=(xˉ−yˉ)−(μx−μy)0sp2(1n1+1n2)t = \frac{(\bar{x} - \bar{y}) - (\mu_x - \mu_y)_0}{\sqrt{s_p^2 (\frac{1}{n_1} + \frac{1}{n_2})}}
在這裡,我們檢定 μx−μy=0\mu_x - \mu_y = 0。

🔒

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

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

免費註冊

第 3 題20 分

The following table summarizes the ages of attendees at a professional baseball game. A researcher would like to examine whether the age distribution of the spectators can be reasonably modeled by a normal distribution with a mean of 42.3 years and a variance of 210.5. Using a goodness-of-fit test, determine whether the observed age data are consistent with this normal distribution. Conduct the test at a significance level of α=0.05\alpha=0.05.

Age (years)Frequency
25 and below18
25-3539
35-4567
45-5558
55-6532
Above 6517
Total231

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

這一題的完整詳解

本題要求使用卡方適合度檢定 (Chi-squared Goodness-of-Fit Test) 來檢驗觀測到的觀眾年齡分佈是否符合一個預設的常態分佈。

檢定資訊:

  • 顯著水準 α=0.05\alpha = 0.05
  • 假設的常態分配:平均數 μ=42.3\mu = 42.3 年,變異數 σ2=210.5\sigma^2 = 210.5。從而標準差 σ=210.5≈14.51\sigma = \sqrt{210.5} \approx 14.51。
  • 觀測到的頻率分佈(共 n=231n = 231 個樣本)。

步驟 1:設定假設

  • 虛無假設 H0H_0: 觀眾的年齡分佈符合平均數為 42.3 歲、變異數為 210.5 的常態分佈。
  • 對立假設 H1H_1: 觀眾的年齡分佈不符合該常態分佈。

步驟 2:計算預期頻率 (Expected Frequencies, EiE_i)

為了進行卡方檢定,我們需要計算在 H0H_0 為真的情況下,每個年齡區間的預期頻率。這需要將預設的常態分佈轉換為標準常態分佈 Z=X−μσZ = \frac{X - \mu}{\sigma},然後利用標準常態累計分佈函數 Φ(z)\Phi(z) 來計算每個區間的機率 P(X∈interval)P(X \in \text{interval}),最後乘以總樣本數 n=231n=231 得到預期頻率 Ei=n×P(X∈interval)E_i = n \times P(X \in \text{interval})。

年齡區間轉換為 Z 分數:

  • 25 and below: X≤25X \le 25
    Z=25−42.314.51=−17.314.51≈−1.19Z = \frac{25 - 42.3}{14.51} = \frac{-17.3}{14.51} \approx -1.19
    P(X≤25)=P(Z≤−1.19)=Φ(−1.19)P(X \le 25) = P(Z \le -1.19) = \Phi(-1.19)。查標準常態表,Φ(−1.19)≈0.1170\Phi(-1.19) \approx 0.1170。
    E1=231×0.1170≈27.027E_1 = 231 \times 0.1170 \approx 27.027

  • 25-35: 25<X≤3525 < X \le 35
    Z25=−1.19Z_{25} = -1.19 (已計算)
    Z35=35−42.314.51=−7.314.51≈−0.50Z_{35} = \frac{35 - 42.3}{14.51} = \frac{-7.3}{14.51} \approx -0.50
    P(25<X≤35)=P(−1.19<Z≤−0.50)=Φ(−0.50)−Φ(−1.19)P(25 < X \le 35) = P(-1.19 < Z \le -0.50) = \Phi(-0.50) - \Phi(-1.19)
    Φ(−0.50)≈0.3085\Phi(-0.50) \approx 0.3085
    P(25<X≤35)≈0.3085−0.1170=0.1915P(25 < X \le 35) \approx 0.3085 - 0.1170 = 0.1915
    E2=231×0.1915≈44.237E_2 = 231 \times 0.1915 \approx 44.237

  • 35-45: 35<X≤4535 < X \le 45
    Z35≈−0.50Z_{35} \approx -0.50 (已計算)
    Z45=45−42.314.51=2.714.51≈0.19Z_{45} = \frac{45 - 42.3}{14.51} = \frac{2.7}{14.51} \approx 0.19
    P(35<X≤45)=P(−0.50<Z≤0.19)=Φ(0.19)−Φ(−0.50)P(35 < X \le 45) = P(-0.50 < Z \le 0.19) = \Phi(0.19) - \Phi(-0.50)
    Φ(0.19)≈0.5753\Phi(0.19) \approx 0.5753
    P(35<X≤45)≈0.5753−0.3085=0.2668P(35 < X \le 45) \approx 0.5753 - 0.3085 = 0.2668
    E3=231×0.2668≈61.631E_3 = 231 \times 0.2668 \approx 61.631

  • 45-55: 45<X≤5545 < X \le 55
    Z45≈0.19Z_{45} \approx 0.19 (已計算)
    Z55=55−42.314.51=12.714.51≈0.88Z_{55} = \frac{55 - 42.3}{14.51} = \frac{12.7}{14.51} \approx 0.88
    P(45<X≤55)=P(0.19<Z≤0.88)=Φ(0.88)−Φ(0.19)P(45 < X \le 55) = P(0.19 < Z \le 0.88) = \Phi(0.88) - \Phi(0.19)
    Φ(0.88)≈0.8106\Phi(0.88) \approx 0.8106
    P(45<X≤55)≈0.8106−0.5753=0.2353P(45 < X \le 55) \approx 0.8106 - 0.5753 = 0.2353
    E4=231×0.2353≈54.354E_4 = 231 \times 0.2353 \approx 54.354

  • 55-65: 55<X≤6555 < X \le 65
    Z55≈0.88Z_{55} \approx 0.88 (已計算)
    Z65=65−42.314.51=22.714.51≈1.56Z_{65} = \frac{65 - 42.3}{14.51} = \frac{22.7}{14.51} \approx 1.56
    P(55<X≤65)=P(0.88<Z≤1.56)=Φ(1.56)−Φ(0.88)P(55 < X \le 65) = P(0.88 < Z \le 1.56) = \Phi(1.56) - \Phi(0.88)
    Φ(1.56)≈0.9406\Phi(1.56) \approx 0.9406
    P(55<X≤65)≈0.9406−0.8106=0.1300P(55 < X \le 65) \approx 0.9406 - 0.8106 = 0.1300

🔒

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

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

免費註冊

第 4 題20 分

In a manufacturing system, a critical machine may occasionally fail and must be repaired before production can resume. Let the repair time be a random variable X (measured in minutes). Historical data indicate that X follows a normal distribution with a mean of 130 minutes and a standard deviation of 7 minutes. If the repair takes longer than 136 minutes, all items currently in production are scrapped, resulting in a financial loss of $15,000.

(a) What is the expected loss associated with a single machine breakdown?
(b) Suppose process improvements reduce the mean repair time to 124 minutes, while the standard deviation remains unchanged. By how much does the expected loss of a breakdown decrease?

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

這一題的完整詳解

核心觀念

本題屬於工程經濟與品質管制中常見的「常態分佈應用與期望損失評估(Expected Loss Analysis)」,核心考點包含:

  1. 常態隨機變數的標準化(Standardization):
    若隨機變數 X∼N(μ,σ2)X \sim N(\mu, \sigma^2),則經標準化轉換後:

    Z=X−μσ∼N(0,1)Z = \frac{X - \mu}{\sigma} \sim N(0, 1)

    其超越特定臨界值 cc 的尾端機率(Tail Probability)為:

    P(X>c)=P(Z>c−μσ)=1−Φ(c−μσ)P(X > c) = P\left(Z > \frac{c - \mu}{\sigma}\right) = 1 - \Phi\left(\frac{c - \mu}{\sigma}\right)

    其中 Φ(⋅)\Phi(\cdot) 為標準常態累積機率分佈函數(CDF)。

  2. 離散二值損失的期望值(Expected Value of Binary Loss):
    令損失函數為隨機變數 LL。若當事件 A={X>c}A = \{X > c\} 發生時造成固定損失 CC,未發生時無損失(L=0L = 0),則單次事件的期望損失為:

    E[L]=C⋅P(X>c)+0⋅P(X≤c)=C⋅P(X>c)E[L] = C \cdot P(X > c) + 0 \cdot P(X \le c) = C \cdot P(X > c)

解題方法

(a) 計算單次機台故障的期望損失

  1. 建立損失函數與機率模型:
    設維修時間為隨機變數 X∼N(μ1=130,σ2=72)X \sim N(\mu_1 = 130, \sigma^2 = 7^2)(單位:分鐘)。
    當維修時間 X>136X > 136 分鐘時,損失金額為 $15,000;若 X≤136X \le 136 分鐘,損失為 $0。
    損失隨機變數 LL 的期望值為:

    E[L]=15000×P(X>136)E[L] = 15000 \times P(X > 136)
  2. 計算逾時機率 P(X>136)P(X > 136):
    將 XX 進行標準化:

    Z=136−1307=67≈0.8571≈0.86Z = \frac{136 - 130}{7} = \frac{6}{7} \approx 0.8571 \approx 0.86

    查標準常態分佈表:

    • 若 ZZ 取兩位小數 Z=0.86Z = 0.86:Φ(0.86)≈0.8051\Phi(0.86) \approx 0.8051
    • 逾時機率為: P(X>136)=P(Z>0.86)=1−Φ(0.86)=1−0.8051=0.1949P(X > 136) = P(Z > 0.86) = 1 - \Phi(0.86) = 1 - 0.8051 = 0.1949

    (若採用線性內插或精確值 Φ(0.8571)≈0.8043\Phi(0.8571) \approx 0.8043,則 P(Z>0.8571)≈0.1957P(Z > 0.8571) \approx 0.1957)

  3. 計算期望損失:

    E[L]=15000×0.1949=2923.5E[L] = 15000 \times 0.1949 = 2923.5

    (若以精確機率 0.19570.1957 計算,則 E[L]=15000×0.1957=2935.5E[L] = 15000 \times 0.1957 = 2935.5 元)


(b) 製程改善後期望損失的減少量

  1. 新參數下的機率模型:
    改善後平均維修時間降為 μ2=124\mu_2 = 124 分鐘,標準差維持 σ=7\sigma = 7 分鐘。
    新維修時間隨機變數設為 Xnew∼N(124,72)X_{\text{new}} \sim N(124, 7^2)。

  2. 計算改善後的逾時機率 P(Xnew>136)P(X_{\text{new}} > 136):
    將 XnewX_{\text{new}} 標準化:

🔒

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

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

免費註冊

第 5 題10 分

995 regular coins, with one side being "head" and the other side being "tail," and five irregular coins, with both sides being "head," are put in a bag. One coin is randomly selected from the bag. The coin is tossed 10 times and all of them are "heads," what is the probability that the selected coin is irregular?

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

這一題的完整詳解

本題是一個貝氏定理 (Bayes' Theorem) 的應用問題,涉及條件機率的計算。我們需要計算在觀察到連續 10 次拋擲都出現「正面」的結果後,所選硬幣是「不規則硬幣」的機率。

事件定義:

  • II: 選到的是不規則硬幣 (Irregular coin)。
  • RR: 選到的是規則硬幣 (Regular coin)。
  • H10H_{10}: 連續拋擲 10 次都出現正面 (10 heads in 10 tosses)。

給定資訊:

  • 硬幣總數 =995= 995 (規則) +5+ 5 (不規則) =1000= 1000 枚。

  • 選到規則硬幣的機率 P(R)=9951000=0.995P(R) = \frac{995}{1000} = 0.995。

  • 選到不規則硬幣的機率 P(I)=51000=0.005P(I) = \frac{5}{1000} = 0.005。

  • 規則硬幣的特性:一面是正面,一面是反面。拋擲一次出現正面的機率 P(Head∣R)=0.5P(\text{Head}|R) = 0.5。
    連續拋擲 10 次都出現正面的機率 P(H10∣R)=(0.5)10=11024P(H_{10}|R) = (0.5)^{10} = \frac{1}{1024}。

  • 不規則硬幣的特性:兩面都是正面。拋擲一次出現正面的機率 P(Head∣I)=1P(\text{Head}|I) = 1。
    連續拋擲 10 次都出現正面的機率 P(H10∣I)=(1)10=1P(H_{10}|I) = (1)^{10} = 1。

目標:
計算在觀察到 H10H_{10} 後,選到不規則硬幣的機率,即 P(I∣H10)P(I|H_{10})。

🔒

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

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

免費註冊

第 6 題10 分

Consider a multiple linear regression model with two predictors
y^=b0+b1x1+b2x2\hat{y} = b_0 + b_1 x_1 + b_2 x_2
where yy denotes the observed response variable, x1x_1 and x2x_2 are the first and second predictors, respectively, and b0b_0, b1b_1, and b2b_2 are unknown regression coefficients. Explain how the coefficients b0b_0, b1b_1, and b2b_2 can be estimated using the method of least squares.

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

這一題的完整詳解

本題要求解釋如何使用最小平方法 (Method of Least Squares) 來估計多元線性迴歸模型中的迴歸係數。

模型:
多元線性迴歸模型為:
yi=β0+β1xi1+β2xi2+ϵiy_i = \beta_0 + \beta_1 x_{i1} + \beta_2 x_{i2} + \epsilon_i
其中,yiy_i 是第 ii 個觀測值的應變數,xi1x_{i1} 和 xi2x_{i2} 是第 ii 個觀測值的兩個預測變數,β0,β1,β2\beta_0, \beta_1, \beta_2 是待估計的迴歸係數,ϵi\epsilon_i 是隨機誤差項。

在題目中,模型寫成預測值 y^\hat{y} 的形式,這通常是指估計值:
y^i=b0+b1xi1+b2xi2\hat{y}_i = b_0 + b_1 x_{i1} + b_2 x_{i2}
其中 b0,b1,b2b_0, b_1, b_2 是對 β0,β1,β2\beta_0, \beta_1, \beta_2 的估計值。

最小平方法原理:
最小平方法的核心思想是找到一組迴歸係數的估計值 (b0,b1,b2b_0, b_1, b_2),使得觀測值 yiy_i 與模型預測值 y^i\hat{y}_i 之間的殘差平方和 (Sum of Squared Residuals, SSR) 最小。

殘差 eie_i 定義為:
ei=yi−y^i=yi−(b0+b1xi1+b2xi2)e_i = y_i - \hat{y}_i = y_i - (b_0 + b_1 x_{i1} + b_2 x_{i2})

殘差平方和 SSRSSR 為:
SSR=∑i=1nei2=∑i=1n(yi−(b0+b1xi1+b2xi2))2SSR = \sum_{i=1}^{n} e_i^2 = \sum_{i=1}^{n} (y_i - (b_0 + b_1 x_{i1} + b_2 x_{i2}))^2
其中 nn 是觀測值的數量。

估計係數的推導 (透過微分):
為了最小化 SSRSSR,我們對 SSRSSR 分別對 b0,b1,b2b_0, b_1, b_2 求偏導數,並令其等於零,從而得到一組聯立方程式(正規方程式 Normal Equations)。

  1. 對 b0b_0 求偏導數:
    ∂SSR∂b0=∑i=1n2(yi−b0−b1xi1−b2xi2)(−1)=0\frac{\partial SSR}{\partial b_0} = \sum_{i=1}^{n} 2(y_i - b_0 - b_1 x_{i1} - b_2 x_{i2})(-1) = 0
    ∑i=1n(yi−b0−b1xi1−b2xi2)=0\sum_{i=1}^{n} (y_i - b_0 - b_1 x_{i1} - b_2 x_{i2}) = 0
    ∑yi−nb0−b1∑xi1−b2∑xi2=0\sum y_i - nb_0 - b_1 \sum x_{i1} - b_2 \sum x_{i2} = 0
    nb0+b1∑xi1+b2∑xi2=∑yinb_0 + b_1 \sum x_{i1} + b_2 \sum x_{i2} = \sum y_i
    除以 nn: b0+b1xˉ1+b2xˉ2=yˉb_0 + b_1 \bar{x}_1 + b_2 \bar{x}_2 = \bar{y}
    這個方程式表明,迴歸平面通過樣本均值的點 (xˉ1,xˉ2,yˉ)(\bar{x}_1, \bar{x}_2, \bar{y})。

  2. 對 b1b_1 求偏導數:
    ∂SSR∂b1=∑i=1n2(yi−b0−b1xi1−b2xi2)(−xi1)=0\frac{\partial SSR}{\partial b_1} = \sum_{i=1}^{n} 2(y_i - b_0 - b_1 x_{i1} - b_2 x_{i2})(-x_{i1}) = 0
    ∑i=1nxi1(yi−b0−b1xi1−b2xi2)=0\sum_{i=1}^{n} x_{i1}(y_i - b_0 - b_1 x_{i1} - b_2 x_{i2}) = 0
    ∑xi1yi−b0∑xi1−b1∑xi12−b2∑xi1xi2=0\sum x_{i1}y_i - b_0 \sum x_{i1} - b_1 \sum x_{i1}^2 - b_2 \sum x_{i1}x_{i2} = 0
    b0∑xi1+b1∑xi12+b2∑xi1xi2=∑xi1yib_0 \sum x_{i1} + b_1 \sum x_{i1}^2 + b_2 \sum x_{i1}x_{i2} = \sum x_{i1}y_i

  3. 對 b2b_2 求偏導數:

🔒

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

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

免費註冊

其他考古題