Least-Squares Regression
導入済み
7:48
二変量データの探索
ある小学校から三十人の子供。各子供について二つの数値:靴のサイズと読力テストの得点。子供ごとに一点プロットする。パターンを把握するのは難しい…
英語のナレーション・英語と中国語の字幕を切り替え可能
このレッスンの内容
| English | 意味 |
|---|---|
| least-squares line/liːst skweəz laɪn/ | 最小二乗法直線 |
| sum of squared residuals | |
| slope/sləʊp/ | The change in a line's vertical coordinate divided by the corresponding change in its horizontal coordinate. |
| intercept/ˌɪntəˈsept/ | The coordinate at which a graph crosses a specified coordinate axis. |
| Residuals/rɪˈsɪdʒuːəlz/ | |
| r-squared | |
| variation/ˌveərɪˈeɪʃn/ | Differences in characteristics between individuals or values within a set. |
| coefficient of determination/ˌkəʊɪˈfɪʃənt ɒv dɪˌtɜːmɪˈneɪʃn/ | 決定係数 |
| correlation/ˌkɒrɪˈleɪʃn/ | |
| linear relationship/ˈlɪnɪə rɪˈleɪʃənʃɪp/ | |
| prediction error | |
| standard deviation of the residuals | |
| response/rɪˈspɒns/ | |
| summary stats | |
| summary statistics/ˈsʌməri stəˈtɪstɪks/ | |
| raw data | |
| standard deviations/ˈstændəd ˌdiːvɪˈeɪʃnz/ | |
| linear model/ˈlɪnɪə ˈmɒdl/ | A model that describes a relationship using a linear equation. |
なぜ「最小二乗」なのか?
- クラウドのようなデータ通過する直線はいくつでもあり得るが、どれが最良か?
- 最小二乗直線とは、残差の二乗和を最小にする直線のことであり、これにより最適解が定まる。
- 二乗することで誤差を正に保ち、大きな外れ値に対してより重いペナルティを与える。
- この合計を最小化することが、唯一の最良適合の傾きと切片を確定させる。

rの二乗:説明される変動
- 決定係数 $r^2$ は、$y$の変動のうちモデルによって説明される割合である。
- 相関係数の二乗そのものであり、したがって$0 \le r^2 \le 1$となる。
- $r^2 = 0.64$ とは、「 $y$ の変動の $64\%$ は、 $x$ との線形関係によって説明される」ことを意味する。
- 残りの部分($36\%$)は他の要因や散らばりによるものである。

残余は観測値から予測値を引いたものであり、最小二乗法はそれらの平方和を最小にする
s:一般的な予測誤差
- 残差の標準偏差 $s$ は、予測誤差の一般的な大きさを表す。
- $y$と同じ単位で表され、「予測値は通常$s$程度ずれる」と解釈できる。
- $s$が小さいほどフィットがtightで、$s$が大きいほど予測のばらつきが大きい。
- $s$は「現実の単位でどれだけずれたか?」に答え、$r^2$は「何分の一が説明されたか?」に答える。
要約統計量からの傾き
- 生データなしに要約統計量から直線を構築できる:
- 傾き:$b = r\dfrac{s_y}{s_x}$ — 相関係数にばらつきの比を掛けたもの。
- 切片:直線は常に$(\bar{x}, \bar{y})$を通るため、$a = \bar{y} - b\bar{x}$となる。
- これら2つの式は、$r$、平均値、標準偏差から$\hat{y} = a + bx$を復元する。
2つの「fit」の数値を混同しないでください。$r^2$ は無次元の分数(「$64\%$ の変動が説明された割合」)です。$s$ は $y$ の単位における典型的な誤差(「約 $s$ ずれている」)です。また、傾きを計算する際は順序に注意してください:$b = r\,s_y/s_x$ — これは $s_y$(応答の変動)を $s_x$(説明変数の変動)で割ったものであり、その逆ではありません。
あるフィットには$r = 0.8$、$s_x = 2$、$s_y = 10$、$\bar{x}=5$、$\bar{y}=60$が含まれる。
- 傾き: $b = 0.8 \times \dfrac{10}{2} = 4$。
- 切片: $a = 60 - 4(5) = 40$、したがって$\hat{y} = 40 + 4x$。
- $r^2 = 0.64$ :モデルによる説明で、 $y$ の変動の $64\%$ が説明される。
最小二乗直線は残差の二乗和を最小化する。$r^2$は$y$の変動のうち説明される割合(無次元、$0$–$1$)であり、$s$は$y$の単位における一般的な予測誤差である。要約統計量からは$b = r\dfrac{s_y}{s_x}$が求められ、直線は$(\bar{x}, \bar{y})$を通る。
変動の81%から書き起こす
- 線形モデルにおける相関係数 r は0.9である。
- 0.64のr-squaredは別のモデルである。
A least-squares linear model with an intercept has correlation r=0.9. What percentage of the variation in y does the model explain?
r squared is the fraction of variation explained.
For a least-squares linear model with an intercept and r=0.9, what percentage of variation in y is explained?
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
r²=0.9²=0.81. Convert the fraction to a percentage: 0.81×100=81% of the variation in y is explained by its linear relationship with x.
The best-fit least-squares line
The line that makes the total squared vertical gap smallest.
With r = 0.8, s_x = 2, s_y = 10, find the slope b = r·(s_y/s_x).
難易度 2/5 · 140 コイン + 今日初回達成時の小ボーナス
b = 0.8 × (10/2) = 0.8 × 5 = 4.
If the correlation is r = 0.8, what is r-squared?
難易度 2/5 · 140 コイン + 今日初回達成時の小ボーナス
r² = 0.8² = 0.64.
r² = 0.64 is best interpreted as...
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
r² is the fraction of y's variation explained.
The least-squares line minimizes the sum of the squared residuals.
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
That is exactly the criterion that defines it.
Which quantity is a typical prediction error, measured in the units of y?
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
s is in y-units; r² and r are unitless.
何が問題でしたか?この内容はサイトの運営チームだけが確認します。