Debian Codegraph @

contrib/ms-sbvar/TZcode/MatlabFiles/normpar.m

raw
1 function f = normpar(ab, XLO, XUP, PLO, PUP);
2
3 % The function takes as inputs the parameters ab=[a, b] of the Normal
4 % distribution (a = mean, b = standard deviation), the bounds of the
5 % support [XLO, XUP], the the corresponding probabilities of the bounds
6 % [PLO, PUP] and returns the residual value f.
7
8 %
9 % Copyright (C) 1997-2012 Tao Zha
10 %
11 % This free software: you can redistribute it and/or modify
12 % it under the terms of the GNU General Public License as published by
13 % the Free Software Foundation, either version 3 of the License, or
14 % (at your option) any later version.
15 %
16 % It is distributed in the hope that it will be useful,
17 % but WITHOUT ANY WARRANTY; without even the implied warranty of
18 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 % GNU General Public License for more details.
20 %
21 % If you did not received a copy of the GNU General Public License
22 % with this software, see <http://www.gnu.org/licenses/>.
23 %
24
25 a = ab(1); b = abs(ab(2));
26 f1 = PLO - normcdf(XLO, a, b);
27 f2 = PUP - normcdf(XUP, a, b);
28
29 f = [f1, f2];