2016年2月23日火曜日

Metric 予測 by 複数 Metric:冗長 Predictors

お金で成績を買えるか? 」からの続き。

データ予測の predictors の数に「理論上」の上限はない。しかし、「現実的 or 実務的」な上限があることは明らか。ここでは、前回の SAT スコアデータを用いて、redundant(冗長)な predictors について考察する。


Clues to Redundancy in Predictors

以下は、Jags-Ymet-XmetMulti-Mrobust-Example.R の実行結果。左から順に、本書の図18.518.6 に相当。違いは、右のモデルは「冗長な predictor」があること。
右のモデルは、左のモデルに「PropNotTake(受験しなかった率)」を追加、これが「冗長な predictor」。冗長であるのは、PropNotTake = (100 - PrcnTake)/100 の関係式からも自明。つまり、PrcnTake, PropNotTake には強い相関がある。右図下段赤枠は  PrcnTake, PropNotTake の「perfect correlation」を示している。

PrcntTake の係数 β2 を比較すると

 冗長なし:mode = -2.89, 95%HDI[-3.31, -2.45]
 冗長あり:mode = -2.47, 95%HDI[-9.42, 5.85]

冗長ありの場合、95%HDI の幅が明らかに広がっている。

また、以下の diagnostic graphs of the chains からも、redundancy in predictors のヒントは得られる。
左は冗長なしモデル、右は冗長ありモデル。
The chains for the regression coefficients of redundant predictors are highly autocorrelated and very highly correlated with each other.

以下は、スクリプトの実行結果の correlation matrix

 冗長なし
            Spend PrcntTake
 Spend     1.000     0.593
 PrcntTake 0.593     1.000

 冗長あり
               Spend PrcntTake PropNotTake
 Spend        1.000     0.593      -0.593
 PrcntTake    0.593     1.000      -1.000
 PropNotTake -0.593    -1.000       1.000

冗長ありに、-1 の perfect correlation が見られる。

現実には、こんな明確には redundant predictors は発見は多くはないだろうが、上記のポイントで clues to redundancy in predictors は発見できる。


冗長 Predictors に対して

では、冗長な predictors を発見したら何をすべきか?

二つの場合で対応方法は異なる。

perfectly correlated の場合:

最も関係のある predictors のみを残す

これは分かりやすい。先の例では、PrcnTake を残して PropNotTake を除く(逆も真)。

perfectly correlated ではなく very strongly correlated の場合:

本書では
extracting an underlying common factor for the correlated predictors 
相関する predictors の共通因子を取り出す
以下の 2 つの方法が提示されている。
  • arbitrarily to create a single predictor that averages the correlated predictors
  • instead of creating a deterministic transform of the predictors, an underlying common factor can be estimated using factor analysis or structural equation modeling (SEM)

つまり、このブログでも何度か取り上げた「因子分析」です。「SEM:共分散構造分析」については、詳しく取り上げていないが、再び Bayesian に没頭する前は SEM の分析を頻繁にしていた。本書では SEM は扱っていないが、近いうちに Bayesian と絡めて再度取り組みたい。


0 件のコメント:

コメントを投稿