2016年3月7日月曜日

Metric 予測 by 複数 Metric:Predictors 選択 = モデル比較

曖昧 Prior の強い影響」からの続き。

先日「多変量解析は簡単じゃない」と書いた。それはデータ分析の難しさでもある。変数の重みである「coefficients(係数)」を推定する以前に

その predictors は予測変数として必要か

という問いがある。そして、行き着く先は「モデル比較」。

ここでは、4 つの predictors でパラメーター推定する。データは以前も使用した実際の SAT スコア。これら predictors の詳細は割愛する。
> library(GGally)
> ggpairs(myData[,c("Spend","PrcntTake","StuTeaRat","Salary")])


SpendSalary に強い相関がある(0.87)。

4 つの predictors なので、対象のモデルの数は全部で 24 = 16 。スクリプト Jags-Ymet-XmetMulti-MrobustVarSelect-Example.R で以下のように predictors を指定する(Exercise 18.5)。

yName = "SATT" ; xName = c("Spend","PrcntTake","StuTeaRat","Salary")
fileNameRoot = "Guber1999data-Jags-4X-VarSelect-"
numSavedSteps=15000 ; thinSteps=20

sigmaBetapriormode = 1, SD = 10 。

以下が推定結果で図18.15 に相当。全 16 モデルのうち 8 モデル(Model Prob が、ほぼ 0 % の 8 モデルは除く)のパラメーター推定結果。
全てのモデルにある predictorPrctTake(赤枠)。次に多く含まれるのは Spend(オレンジ枠)と Salary(緑枠) 。SpendHDI は明らかに nonezero を排除しているのもあるが、含むものもある。SalaryHDISpend より nonzero の傾向が見られる。

What should be reported and what should be concluded? Which candidate predictors should be included in an explanatory model? How should predictions of future data be made? 
この分析結果はどうなる?

残念ながら

There is no singular "correct" answer.

先ず「best model をただ一つ選ぶ」という分析レポートの場合を考えてみる。

18.15 の結果から、Spend,  PrctTake のモデルが best model として採用される。これは「SalaryStuTeaRat は、 SAT スコアとは "zero relation"」を意味することになる。

これで良いのか?

結論から言えば、分析レポートとして best model だけを選ぶのは失格。他の競合モデルも併せて明記すべき。

今回の推定結果から、2 位と 1 位のモデル確率を比較すると 0.226/0.462 ≈ 0.49 3 位と 1 位では 0.076/0.462 ≈ 0.16 。例えば、best model の少なくとも 1/3 の確率を持つモデルをレポートする案がある。この場合は、上位 2 つのモデルが対象になる。

分析する対象によっても、レポートの仕方は変わると思う。例えば、可能な限り多くの predictors を検討したい場合もあるだろう。

結論的には、「多変量解析は簡単じゃない」の末尾に引用したこと。ここでは、包括的な結論を再度引用する。

Variable selection is a reasonable approach only if it is genuinely plausible and meaningful that candidate predictors have zero relation to the predicted variable. The results can be surprisingly sensitive to the seemingly innocuous choice of prior for the regression coefficients, and, of course, the prior for the inclusion probability. Because of these limitations, hierarchical shrinkage priors may be a more meaningful approach.


保留の Interaction

掛算の効果(実装例)」の最後に記した「スッキリしない理由」、つまり「interaction の可否判断方法」については「保留」とする。本章の最終節 "18.4.5 Caution: Interaction variables" の要点を取り上げようと思ったが、見送ることにした。このテーマは、要点をまとめただけでは不十分で、より具体的な分析例が必要だと思ったから。

多変量解析は難しいが、データ分析をやっていれば「行き着く先」と思っている。

0 件のコメント:

コメントを投稿