-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updates on arLRT and arWaterfallPlot
- Loading branch information
1 parent
e9dbb68
commit 8ee14b7
Showing
2 changed files
with
19 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,26 @@ | ||
% [pval,q] = arLRT(DeltaChi2, DeltaDF, alpha) | ||
% | ||
% Performs Likelihood Ratio Test | ||
% | ||
% DeltaDF degrees of freedom | ||
% alpha significance level | ||
% | ||
% q = TRUE: accept H0, the smaller model can not be dismissed | ||
% q = FALSE: reject H0, dismiss smaller model in favour of larger model | ||
% | ||
% Example: (ar2 ist the larger model, m1 must be nested in m2, i.e. a special case) | ||
% ar = ar1; | ||
% arCalcMerit | ||
% [~,m1] = arGetMerit; | ||
% ar = ar2; | ||
% arCalcMerit | ||
% [~,m2] = arGetMerit; | ||
% DeltaChi2 = m1.loglik_all - m2.loglik_all % must be positive | ||
% DeltaDF = m2.npara - m1.npara; % must be positive | ||
|
||
|
||
function [pval,q] = arLRT(DeltaChi2, DeltaDF, alpha) | ||
if(~exist('alpha','var') || isempty(alpha)) | ||
alpha = 0.05; | ||
end | ||
pval = 1-chi2cdf(DeltaChi2, DeltaDF); | ||
q = pval > alpha; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters