http://blog.csdn.net/xiao_xia_/article/details/6906465
t-檢驗(yàn):
t-檢驗(yàn),又稱student‘s t-test,可以用于比較兩組數(shù)據(jù)是否來自同一分布(可以用于比較兩組數(shù)據(jù)的區(qū)分度),假設(shè)了數(shù)據(jù)的正態(tài)性,并反應(yīng)兩組數(shù)據(jù)的方差在統(tǒng)計(jì)上是否有顯著差異。
matlab中提供了兩種相同形式的方法來解決這一假設(shè)檢驗(yàn)問題,分別為ttest方法和ttest2方法,兩者的參數(shù)、返回值類型均相同,不同之處在于ttest方法做的是 One-sample and paired-sample t-test,而ttest2則是 Two-sample t-test with pooled or unpooled variance estimate, performs an unpaired two-sample t-test。但是這里至于paired和unpaired之間的區(qū)別我卻還沒搞清楚,只是在Student's t-test中看到了如下這樣一段解釋:
“Two-sample t-tests for a difference in mean involve independent samples, paired samples and overlapping samples. Pairedt-tests are a form of blocking, and have greater powerthan unpaired tests when the paired units are similar with respect to "noise factors" that are independent of membership in the two groups being compared.[8] In a different context, paired t-tests can be used to reduce the effects ofconfounding factors in an observational study.”
因此粗略認(rèn)為paired是考慮了噪聲因素的。
在同樣的兩組數(shù)據(jù)上分別用ttest和ttest2方法得出的結(jié)果進(jìn)行比較,發(fā)現(xiàn)ttest返回的參數(shù)p普遍更小,且置信區(qū)間ci也更小。
最常用用法:
[H,P,CI]=ttest2(x,y);(用法上ttest和ttest2相同,完整形式為[H,P,CI, STATS]=ttest2(x,y, ALPHA);)
其中,x,y均為行向量(維度必須相同),各表示一組數(shù)據(jù),ALPHA為可選參數(shù),表示設(shè)置一個(gè)值作為t檢驗(yàn)執(zhí)行的顯著性水平(performs the test at the significance level
(100*ALPHA)%),在不設(shè)置ALPHA的情況下默認(rèn)ALPHA為0.05,即計(jì)算x和y在5%的顯著性水平下是否來自同一分布(假設(shè)是否被接受)
結(jié)果:H=0,則表明零假設(shè)在5%的置信度下不被拒絕(根據(jù)當(dāng)設(shè)置x=y時(shí)候,返回的H=0推斷而來),即x,y在統(tǒng)計(jì)上可看做來自同一分布的數(shù)據(jù);H=1,表明零假設(shè)被拒絕,即x,y在統(tǒng)計(jì)上認(rèn)為是來自不同分布的數(shù)據(jù),即有區(qū)分度。
P為一個(gè)概率,matlab help中的解釋是“ the p-value, i.e., the probability of observing the given result, or one more extreme, by chance if the null hypothesis is true. Small values of P cast doubt on the validity of the null hypothesis.” 暫且認(rèn)為表示判斷值在真實(shí)分布中被觀察到的概率(?不太懂)
CI為置信區(qū)間(confidence interval),表示“a 100*(1-ALPHA)% confidence interval for the true difference of population means”,即達(dá)到100*(1-ALPHA)%的置信度的數(shù)據(jù)區(qū)間(?)
應(yīng)用:常與k-fold crossValidation(交叉驗(yàn)證)聯(lián)用可以用于兩種算法效果的比較,例如A1,A2兩算法得出的結(jié)果分別為x,y,且從均值上看mean(x)>mean(y),則對(duì)[h,p,ci]=ttest2(x,y);當(dāng)h=1時(shí),表明可以從統(tǒng)計(jì)上斷定算法A1的結(jié)果大于(?)A2的結(jié)果(即兩組數(shù)據(jù)均值的比較是有意義的),h=0則表示不能根據(jù)平均值來斷定兩組數(shù)據(jù)的大小關(guān)系(因?yàn)閰^(qū)分度小)
臨時(shí)學(xué)的,沒經(jīng)過太多測(cè)試,不一定對(duì),還請(qǐng)高手指教。
另外還有在某個(gè)ppt(http://jura.wi.mit.edu/bio/education/hot_topics/pdf/matlab.pdf)中看到這樣一頁

參考資料:
經(jīng)驗(yàn)+自身理解
matlab 7.11.0(R2010b)的幫助文檔
wikipedia
http://www.biosino.org/pages/newhtm/r/schtml/One_002d-and-two_002dsample-tests.html