chi2inv (Calls: 9, Time: 0.026 sec)
Generated 28-May-2016 14:58:47 using performance time.
function in file /home/johs/MATLAB/R2015b/toolbox/stats/stats/chi2inv.m
Copy to new window for comparing multiple runs
Function Name | Function Type | Calls |
Optimizer_cpu>Optimizer_cpu.score | class method | 9 |
Line Number | Code | Calls | Total Time | % Time | Time Plot |
32 | x = gaminv(p,v/2,2); | 9 | 0.019 s | 72.2% | ![]() |
25 | [errorcode p v] = distchck(2,p... | 9 | 0.007 s | 25.9% | ![]() |
27 | if errorcode > 0 | 9 | 0.000 s | 0.0% | ![]() |
21 | if nargin < 2, | 9 | 0.000 s | 0.0% | ![]() |
All other lines | 0.000 s | 1.8% | ![]() | ||
Totals | 0.026 s | 100% |
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
gaminv | function | 9 | 0.007 s | 26.7% | ![]() |
distchck | function | 9 | 0.002 s | 8.7% | ![]() |
Self time (built-ins, overhead, etc.) | 0.017 s | 64.6% | ![]() | ||
Totals | 0.026 s | 100% |
Line number | Message |
25 | Best practice is to separate output variables with commas. |
25 | Best practice is to separate output variables with commas. |
Total lines in function | 32 |
Non-code lines (comments, blank lines) | 24 |
Code lines (lines that can run) | 8 |
Code lines that did run | 4 |
Code lines that did not run | 4 |
Coverage (did run/can run) | 50.00 % |
time | Calls | line | |
---|---|---|---|
1 | function x = chi2inv(p,v) | ||
2 | %CHI2INV Inverse of the chi-square cumulative distribution function (cdf). | ||
3 | % X = CHI2INV(P,V) returns the inverse of the chi-square cdf with V | ||
4 | % degrees of freedom at the values in P. The chi-square cdf with V | ||
5 | % degrees of freedom, is the gamma cdf with parameters V/2 and 2. | ||
6 | % | ||
7 | % The size of X is the common size of P and V. A scalar input | ||
8 | % functions as a constant matrix of the same size as the other input. | ||
9 | % | ||
10 | % See also CHI2CDF, CHI2PDF, CHI2RND, CHI2STAT, ICDF. | ||
11 | |||
12 | % References: | ||
13 | % [1] M. Abramowitz and I. A. Stegun, "Handbook of Mathematical | ||
14 | % Functions", Government Printing Office, 1964, 26.4. | ||
15 | % [2] E. Kreyszig, "Introductory Mathematical Statistics", | ||
16 | % John Wiley, 1970, section 10.2 (page 144) | ||
17 | |||
18 | % Copyright 1993-2010 The MathWorks, Inc. | ||
19 | |||
20 | |||
< 0.01 | 9 | 21 | if nargin < 2, |
22 | error(message('stats:chi2inv:TooFewInputs')); | ||
23 | end | ||
24 | |||
< 0.01 | 9 | 25 | [errorcode p v] = distchck(2,p,v); |
26 | |||
< 0.01 | 9 | 27 | if errorcode > 0 |
28 | error(message('stats:chi2inv:InputSizeMismatch')); | ||
29 | end | ||
30 | |||
31 | % Call the gamma inverse function. | ||
0.02 | 9 | 32 | x = gaminv(p,v/2,2); |