Cross-validated correlation

バージョン 1.0.0.0 (4.01 KB) 作成者: Ben
leave-one-out crossvalidated linear regression
ダウンロード: 378
更新 2015/11/22

ライセンスの表示

[PearsonR, PearsonP, SpearmanR, SpearmanP, yhat, R2 ] = BenStuff_CrossValCorr( x,y, [MathMagic], [OmNullModel] )

leave-one-out cross-validated simple linear regression
INPUT VARIABLES:
x, y: vectors of data (x(n) and y(n) correspond to a pair of observations)
MathMagic: optional parameter; defaults to 1 - avoid looping through n model with the power of MathMagic (http://stats.stackexchange.com/questions/164223/proof-of-loocv-formula)
OmNullModel: optional parameter; defaults to 1 - should null model for R2 be 'omnisicent'? if set to 1 (default) R2 will compare explained variance against variance around mean of *all* data points; if set to 0 will comapre against iteration-specific mean excluding data point to predict
OUTPUT VARIABLES:
PearsonR: Pearson correlation between predicted and observed values
PearsonP: p-value for PearsonR
SpearmanR: Spearman correlation between predicted and observed values
SpearmanP: p-value for SpearmanR
yhat: LOO predicted values
R2: cross-validated proportion of variance in y explained by x-based predictions

NOTE: depressingly, LOOCV isn't the holy grail either
(according to http://www.sciencedirect.com/science/article/pii/S1093326301001231 high LOO R^2 is a
necessary but not sufficient condition for (generalising) predictive validity)
also check out http://andrewgelman.com/2015/06/02/cross-validation-magic/ for some general words of caution

found a bug? please let me know!
benjamindehaas [at] gmail.com 11/2015

引用

Ben (2024). Cross-validated correlation (https://www.mathworks.com/matlabcentral/fileexchange/54120-cross-validated-correlation), MATLAB Central File Exchange. 取得済み .

MATLAB リリースの互換性
作成: R2012b
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersStatistics and Machine Learning Toolbox についてさらに検索
タグ タグを追加

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
バージョン 公開済み リリース ノート
1.0.0.0

n/a
n/a