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 CenterMATLAB Answers에서 Statistics 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