2016年3月7日月曜日

Metric 予測 by One Nominal:MCMCの前準備

本投稿は John KruschkeDoing Bayesian Data Analysis の第 19 章 "Metric Predicted variable with One Nominal Predictor" をもとにした。


本章では、前章同様に predicted(推定)する ymetric だが、predictor(変数)が 1 つの nominal variable という点が異なる。

この nominal とは「順序のない、分類する、カテゴリカル」。Wiktionary の解説がわかり易い。

本章での MCMC での推定の前に、"15.2.4.1 Linear model for a single nominal predictor" をもとに、本モデルのシンプルな解説を行う。

表記上の注意:x のように、右肩に → ある表記は「vector(ベクトル)」を意味する。本来 → は x の「真上」。ところで「昔の人」が vector を「ベクター」と訳さなかったのは何故....。

vector x の例を示す。

 x が「性別」の場合:
 x = <1, 0> :男、x = <0, 1> :女

 x が「支持政党」の場合:
 x = <1, 0, 0, 0, 0> :Greenx = <0, 1, 0, 0, 0> :Democratx = <0, 0, 1, 0, 0> :Republican, ...

これらは全て nominal variables 

次に、モデルを数式化する前に、今回のモデルの単純な例を示す。

「性別から身長を推定する」モデルでは「baseline 値」は平均身長。predictor が「男」の場合、身長は baseline 値に対して「プラス」に働く(本書では "an upward deflection to the predicted height" と記述)。「女」の場合は、「マイナス」に働く("a downward deflection to the predicted height")。

実は、以下のように数式化した方がわかり易い。

baseline 値を β0 , jth の deflection を β[j] として

 y = β0 + β[1] x[1] + ... + β[Jx[J]
    = β0 + β→ x

β→ x は "dot product" of the vectors 。


合計ゼロの制約

baseline 値の設定例。男の平均が 1.76, 女の平均が 1.62 の場合、baseline 値値を 1.69 する。よって、baseline 値から男なら +0.07 、女なら -0.07 となる。

左の式 15.4 が示すのは
the baseline is constrained so that deflections sum to zero across the categories

以下の図 15.4 は、先の「支持政党」の例。
全ての係数の合計は 4 + (-3) + (-2) + 6 + (-5) = 0 という具合に、式 15.4 の制約通り。

Analogous to ANOVA」に続く。

/* tex */

0 件のコメント:

コメントを投稿