]> Creatis software - CreaPhase.git/blob - octave_packages/nan-2.5.5/flag_implicit_significance.m
Add a useful package (from Source forge) for octave
[CreaPhase.git] / octave_packages / nan-2.5.5 / flag_implicit_significance.m
1 function alpha=flag_implicit_significance(i)
2 % The use of FLAG_IMPLICIT_SIGNIFICANCE is in experimental state. 
3 % flag_implicit_significance might even become obsolete.
4 %
5 % FLAG_IMPLICIT_SIGNIFICANCE sets and gets default alpha (level) of any significance test
6 % The default alpha-level is stored in the global variable FLAG_implicit_significance
7 % The idea is that the significance must not be assigned explicitely. 
8 % This might yield more readable code. 
9 %
10 % Choose alpha low enough, because in alpha*100% of the cases, you will 
11 % reject the Null hypothesis just by change. For this reason, the default
12 % alpha is 0.01. 
13
14 %   flag_implicit_significance(0.01) 
15 %       sets the alpha-level for the significance test
16
17 % alpha = flag_implicit_significance()
18 %       gets default alpha
19 %
20 % flag_implicit_significance(alpha)
21 %       sets default alpha-level
22 %
23 % alpha = flag_implicit_significance(alpha)
24 %       gets and sets alpha 
25 %
26 % features:
27 % - compatible to Matlab and Octave
28 %
29 % see also: CORRCOEF, PARTCORRCOEF
30
31 %       $Id: flag_implicit_significance.m 8223 2011-04-20 09:16:06Z schloegl $
32 %       Copyright (C) 2000-2002,2009,2010 by Alois Schloegl <alois.schloegl@gmail.com>  
33 %       This function is part of the NaN-toolbox
34 %       http://pub.ist.ac.at/~schloegl/matlab/NaN/
35 %
36 %    This program is free software; you can redistribute it and/or modify
37 %    it under the terms of the GNU General Public License as published by
38 %    the Free Software Foundation; either version 3 of the License, or
39 %    (at your option) any later version.
40 %
41 %    This program is distributed in the hope that it will be useful,
42 %    but WITHOUT ANY WARRANTY; without even the implied warranty of
43 %    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
44 %    GNU General Public License for more details.
45 %
46 %    You should have received a copy of the GNU General Public License
47 %    along with this program; If not, see <http://www.gnu.org/licenses/>.
48
49
50 persistent FLAG_implicit_significance;
51 DEFAULT_ALPHA = 0.01;
52
53 %%% check whether FLAG was already defined 
54 if ~exist('FLAG_implicit_significance','var'),
55         FLAG_implicit_significance = DEFAULT_ALPHA;  % default value 
56 end;
57 if isempty(FLAG_implicit_significance),
58         FLAG_implicit_significance = DEFAULT_ALPHA;  % default value 
59 end;
60
61 if nargin>0,
62         fprintf(2,'Warning: flag_implicit_significance is in an experimental state\n');
63         fprintf(2,'It might become obsolete.\n');
64         FLAG_implicit_significance = i; 
65 end;
66
67 alpha = FLAG_implicit_significance;