scipy.stats.mstats.
ks_1samp#
- scipy.stats.mstats.ks_1samp(x, cdf, args=(), alternative='two-sided', method='auto')[source]#
計算單樣本遮罩值的 Kolmogorov-Smirnov 檢定。
捨棄 x 中的遺失值。
- 參數:
- xarray_like
隨機變數觀測值的 1 維陣列。
- cdfstr 或 callable
如果是字串,則應為
scipy.stats
中分布的名稱。如果是可呼叫物件,則該可呼叫物件會用於計算 cdf。- argstuple、sequence、optional
分布參數,如果 cdf 是字串,則使用。
- alternative{‘two-sided’, ‘less’, ‘greater’}, optional
指示對立假設。預設值為 ‘two-sided’。
- method{‘auto’, ‘exact’, ‘asymp’}, optional
定義用於計算 p 值的方法。以下選項可用 (預設值為 ‘auto’)
‘auto’ : 小陣列尺寸使用 ‘exact’,大陣列尺寸使用 ‘asymp’
‘exact’ : 使用檢定統計量的精確分布近似值
‘asymp’ : 使用檢定統計量的漸近分布
- 回傳值:
- dfloat
Kolmogorov Smirnov 檢定的值
- pfloat
對應的 p 值。