-
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.
- Loading branch information
1 parent
af179de
commit 1423abb
Showing
8 changed files
with
116 additions
and
66 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
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
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
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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
function Y = palm_gammainc(X,A,tail) | ||
% Quick patch until the "gammainc" function in Octave is fixed | ||
% http://savannah.gnu.org/bugs/?47800 | ||
% | ||
% Inputs and outputs are as in "gammainc", except | ||
% that A must be scalar. | ||
% | ||
% _____________________________________ | ||
% Anderson Winkler | ||
% FMRIB / University of Oxford | ||
% Apr/2016 | ||
% http://brainder.org | ||
|
||
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
% PALM -- Permutation Analysis of Linear Models | ||
% Copyright (C) 2016 Anderson M. Winkler | ||
% | ||
% This program is free software: you can redistribute it and/or modify | ||
% it under the terms of the GNU General Public License as published by | ||
% the Free Software Foundation, either version 3 of the License, or | ||
% any later version. | ||
% | ||
% This program is distributed in the hope that it will be useful, | ||
% but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
% GNU General Public License for more details. | ||
% | ||
% You should have received a copy of the GNU General Public License | ||
% along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
|
||
% For most cases, this will be enough: | ||
Y = gammainc(X,A,tail); | ||
|
||
% The patch is really only for Octave: | ||
if palm_isoctave, | ||
idx = Y == 0; | ||
if any(idx), | ||
gfun = @(t)exp(-t).*t.^(A-1); | ||
if strcmpi(tail,'upper'), | ||
Y(idx) = arrayfun(@(x)quad(gfun,x,Inf),X(idx)); | ||
else | ||
Y(idx) = arrayfun(@(x)quad(gfun,0,x),X(idx)); | ||
end | ||
Y(idx) = bsxfun(@rdivide,Y(idx),gamma(A)); | ||
end | ||
end |
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
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
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
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 +1 @@ | ||
Apr/2016 (version alpha93) | ||
Apr/2016 (version alpha94) |