summaryrefslogtreecommitdiffstats
path: root/scilab/modules/statistics
diff options
context:
space:
mode:
Diffstat (limited to 'scilab/modules/statistics')
-rw-r--r--scilab/modules/statistics/Makefile.in2
-rw-r--r--scilab/modules/statistics/help/en_US/1_cdf/binomial.xml19
-rw-r--r--scilab/modules/statistics/help/ja_JP/1_cdf/binomial.xml19
-rw-r--r--scilab/modules/statistics/help/mml/binomial_equation_1_en_US.mml95
-rw-r--r--scilab/modules/statistics/help/mml/binomial_equation_1_fr_FR.mml95
-rw-r--r--scilab/modules/statistics/help/mml/binomial_equation_1_ru_RU.mml95
-rw-r--r--scilab/modules/statistics/help/pt_BR/1_cdf/binomial.xml24
-rw-r--r--scilab/modules/statistics/help/ru_RU/1_cdf/binomial.xml26
-rw-r--r--scilab/modules/statistics/macros/histc.sci5
-rw-r--r--scilab/modules/statistics/tests/unit_tests/cdfgam.dia.ref127
-rw-r--r--scilab/modules/statistics/tests/unit_tests/cdfgam.tst11
-rw-r--r--scilab/modules/statistics/tests/unit_tests/histc.tst6
12 files changed, 61 insertions, 463 deletions
diff --git a/scilab/modules/statistics/Makefile.in b/scilab/modules/statistics/Makefile.in
index 996af99..6a4a24b 100644
--- a/scilab/modules/statistics/Makefile.in
+++ b/scilab/modules/statistics/Makefile.in
@@ -499,9 +499,11 @@ NMEDIT = @NMEDIT@
499OBJDUMP = @OBJDUMP@ 499OBJDUMP = @OBJDUMP@
500OBJEXT = @OBJEXT@ 500OBJEXT = @OBJEXT@
501OCAMLC = @OCAMLC@ 501OCAMLC = @OCAMLC@
502OCAMLCFLAGS = @OCAMLCFLAGS@
502OCAMLDEP = @OCAMLDEP@ 503OCAMLDEP = @OCAMLDEP@
503OCAMLLEX = @OCAMLLEX@ 504OCAMLLEX = @OCAMLLEX@
504OCAMLOPT = @OCAMLOPT@ 505OCAMLOPT = @OCAMLOPT@
506OCAMLOPTFLAGS = @OCAMLOPTFLAGS@
505OCAMLYACC = @OCAMLYACC@ 507OCAMLYACC = @OCAMLYACC@
506OPENMPI_CC = @OPENMPI_CC@ 508OPENMPI_CC = @OPENMPI_CC@
507OPENMPI_CFLAGS = @OPENMPI_CFLAGS@ 509OPENMPI_CFLAGS = @OPENMPI_CFLAGS@
diff --git a/scilab/modules/statistics/help/en_US/1_cdf/binomial.xml b/scilab/modules/statistics/help/en_US/1_cdf/binomial.xml
index 58ddbae..d15d2bd 100644
--- a/scilab/modules/statistics/help/en_US/1_cdf/binomial.xml
+++ b/scilab/modules/statistics/help/en_US/1_cdf/binomial.xml
@@ -13,14 +13,17 @@
13 * along with this program. 13 * along with this program.
14 * 14 *
15 --> 15 -->
16<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="binomial" xml:lang="en"> 16<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
17 xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml"
18 xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
19 xmlns:scilab="http://www.scilab.org" xml:id="binomial" xml:lang="en">
17 <refnamediv> 20 <refnamediv>
18 <refname>binomial</refname> 21 <refname>binomial</refname>
19 <refpurpose>binomial distribution probabilities</refpurpose> 22 <refpurpose>binomial distribution probabilities</refpurpose>
20 </refnamediv> 23 </refnamediv>
21 <refsynopsisdiv> 24 <refsynopsisdiv>
22 <title>Syntax</title> 25 <title>Syntax</title>
23 <synopsis>pr=binomial(p,n)</synopsis> 26 <synopsis>pr = binomial(p, n)</synopsis>
24 </refsynopsisdiv> 27 </refsynopsisdiv>
25 <refsection> 28 <refsection>
26 <title>Arguments</title> 29 <title>Arguments</title>
@@ -56,13 +59,11 @@
56 random variable following the B(n,p) distribution, and numerically 59 random variable following the B(n,p) distribution, and numerically
57 : 60 :
58 </para> 61 </para>
59 <informalequation> 62 <para>
60 <mediaobject> 63 <latex style="display" alt="pr(k+1) = p^k (1-p)^(n-k) n!/[k!(n-k)!]">
61 <imageobject> 64 pr(k+1)=\left(\frac{n!}{k!\,(n-k)!}\right)\,p^k\,(1-p)^{n-k}
62 <imagedata align="center" fileref="../../mml/binomial_equation_1_en_US.mml"/> 65 </latex>
63 </imageobject> 66 </para>
64 </mediaobject>
65 </informalequation>
66 </refsection> 67 </refsection>
67 <refsection> 68 <refsection>
68 <title>Examples</title> 69 <title>Examples</title>
diff --git a/scilab/modules/statistics/help/ja_JP/1_cdf/binomial.xml b/scilab/modules/statistics/help/ja_JP/1_cdf/binomial.xml
index 05d37b1..4ea5559 100644
--- a/scilab/modules/statistics/help/ja_JP/1_cdf/binomial.xml
+++ b/scilab/modules/statistics/help/ja_JP/1_cdf/binomial.xml
@@ -13,14 +13,17 @@
13 * along with this program. 13 * along with this program.
14 * 14 *
15 --> 15 -->
16<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="binomial" xml:lang="ja"> 16<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
17 xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml"
18 xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
19 xmlns:scilab="http://www.scilab.org" xml:id="binomial" xml:lang="ja">
17 <refnamediv> 20 <refnamediv>
18 <refname>binomial</refname> 21 <refname>binomial</refname>
19 <refpurpose>2項分布確率</refpurpose> 22 <refpurpose>2項分布確率</refpurpose>
20 </refnamediv> 23 </refnamediv>
21 <refsynopsisdiv> 24 <refsynopsisdiv>
22 <title>呼び出し手順</title> 25 <title>呼び出し手順</title>
23 <synopsis>pr=binomial(p,n)</synopsis> 26 <synopsis>pr = binomial(p, n)</synopsis>
24 </refsynopsisdiv> 27 </refsynopsisdiv>
25 <refsection> 28 <refsection>
26 <title>パラメータ</title> 29 <title>パラメータ</title>
@@ -59,13 +62,11 @@
59 <literal>pr(k+1) = probability(X=k)</literal>で, 62 <literal>pr(k+1) = probability(X=k)</literal>で,
60 数値的には以下のようになります : 63 数値的には以下のようになります :
61 </para> 64 </para>
62 <informalequation> 65 <para>
63 <mediaobject> 66 <latex style="display" alt="pr(k+1) = p^k (1-p)^(n-k) n!/[k!(n-k)!]">
64 <imageobject> 67 pr(k+1)=\left(\frac{n!}{k!\,(n-k)!}\right)\,p^k\,(1-p)^{n-k}
65 <imagedata align="center" fileref="../../mml/binomial_equation_1_en_US.mml"/> 68 </latex>
66 </imageobject> 69 </para>
67 </mediaobject>
68 </informalequation>
69 </refsection> 70 </refsection>
70 <refsection> 71 <refsection>
71 <title>例</title> 72 <title>例</title>
diff --git a/scilab/modules/statistics/help/mml/binomial_equation_1_en_US.mml b/scilab/modules/statistics/help/mml/binomial_equation_1_en_US.mml
deleted file mode 100644
index 3ec3380..0000000
--- a/scilab/modules/statistics/help/mml/binomial_equation_1_en_US.mml
+++ /dev/null
@@ -1,95 +0,0 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE math:math PUBLIC "-//OpenOffice.org//DTD Modified W3C MathML 1.01//EN" "math.dtd">
3<math:math xmlns:math="http://www.w3.org/1998/Math/MathML">
4 <math:semantics>
5 <math:mrow>
6 <math:mi math:fontstyle="italic">pr</math:mi>
7 <math:mrow>
8 <math:mrow>
9 <math:mo math:stretchy="false">(</math:mo>
10 <math:mrow>
11 <math:mi>k</math:mi>
12 <math:mo math:stretchy="false">+</math:mo>
13 <math:mn>1</math:mn>
14 </math:mrow>
15 <math:mo math:stretchy="false">)</math:mo>
16 </math:mrow>
17 <math:mo math:stretchy="false">=</math:mo>
18 <math:mrow>
19 <math:mrow>
20 <math:mfenced math:open="" math:close="">
21 <math:mtable>
22 <math:mtr>
23 <math:mi>n</math:mi>
24 </math:mtr>
25 <math:mtr>
26 <math:mi>k</math:mi>
27 </math:mtr>
28 </math:mtable>
29 </math:mfenced>
30 <math:mo math:stretchy="false">⋅</math:mo>
31 <math:msup>
32 <math:mi>p</math:mi>
33 <math:mi>k</math:mi>
34 </math:msup>
35 </math:mrow>
36 <math:mo math:stretchy="false">⋅</math:mo>
37 <math:msup>
38 <math:mrow>
39 <math:mo math:stretchy="false">(</math:mo>
40 <math:mrow>
41 <math:mn>1</math:mn>
42 <math:mo math:stretchy="false">−</math:mo>
43 <math:mi>p</math:mi>
44 </math:mrow>
45 <math:mo math:stretchy="false">)</math:mo>
46 </math:mrow>
47 <math:mrow>
48 <math:mi>n</math:mi>
49 <math:mo math:stretchy="false">−</math:mo>
50 <math:mi>k</math:mi>
51 </math:mrow>
52 </math:msup>
53 </math:mrow>
54 </math:mrow>
55 <math:mtext> with </math:mtext>
56 <math:mrow>
57 <math:mfenced math:open="" math:close="">
58 <math:mtable>
59 <math:mtr>
60 <math:mi>n</math:mi>
61 </math:mtr>
62 <math:mtr>
63 <math:mi>k</math:mi>
64 </math:mtr>
65 </math:mtable>
66 </math:mfenced>
67 <math:mo math:stretchy="false">=</math:mo>
68 <math:mfrac>
69 <math:mrow>
70 <math:mi>n</math:mi>
71 <math:mi>!</math:mi>
72 </math:mrow>
73 <math:mrow>
74 <math:mi>k</math:mi>
75 <math:mrow>
76 <math:mi>!</math:mi>
77 <math:mo math:stretchy="false">⋅</math:mo>
78 <math:mrow>
79 <math:mo math:stretchy="false">(</math:mo>
80 <math:mrow>
81 <math:mi>n</math:mi>
82 <math:mo math:stretchy="false">−</math:mo>
83 <math:mi>k</math:mi>
84 </math:mrow>
85 <math:mo math:stretchy="false">)</math:mo>
86 </math:mrow>
87 </math:mrow>
88 <math:mi>!</math:mi>
89 </math:mrow>
90 </math:mfrac>
91 </math:mrow>
92 </math:mrow>
93 <math:annotation math:encoding="StarMath 5.0">pr(k+1) = left ( stack{ n # k } right ) cdot p^k cdot (1 - p)^{n-k} &quot; with &quot; left ( stack { n # k } right ) = {{n!} over {k! cdot (n-k)!}}</math:annotation>
94 </math:semantics>
95</math:math> \ No newline at end of file
diff --git a/scilab/modules/statistics/help/mml/binomial_equation_1_fr_FR.mml b/scilab/modules/statistics/help/mml/binomial_equation_1_fr_FR.mml
deleted file mode 100644
index c30a262..0000000
--- a/scilab/modules/statistics/help/mml/binomial_equation_1_fr_FR.mml
+++ /dev/null
@@ -1,95 +0,0 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE math:math PUBLIC "-//OpenOffice.org//DTD Modified W3C MathML 1.01//EN" "math.dtd">
3<math:math xmlns:math="http://www.w3.org/1998/Math/MathML">
4 <math:semantics>
5 <math:mrow>
6 <math:mi math:fontstyle="italic">pr</math:mi>
7 <math:mrow>
8 <math:mrow>
9 <math:mo math:stretchy="false">(</math:mo>
10 <math:mrow>
11 <math:mi>k</math:mi>
12 <math:mo math:stretchy="false">+</math:mo>
13 <math:mn>1</math:mn>
14 </math:mrow>
15 <math:mo math:stretchy="false">)</math:mo>
16 </math:mrow>
17 <math:mo math:stretchy="false">=</math:mo>
18 <math:mrow>
19 <math:mrow>
20 <math:mfenced math:open="" math:close="">
21 <math:mtable>
22 <math:mtr>
23 <math:mi>n</math:mi>
24 </math:mtr>
25 <math:mtr>
26 <math:mi>k</math:mi>
27 </math:mtr>
28 </math:mtable>
29 </math:mfenced>
30 <math:mo math:stretchy="false">⋅</math:mo>
31 <math:msup>
32 <math:mi>p</math:mi>
33 <math:mi>k</math:mi>
34 </math:msup>
35 </math:mrow>
36 <math:mo math:stretchy="false">⋅</math:mo>
37 <math:msup>
38 <math:mrow>
39 <math:mo math:stretchy="false">(</math:mo>
40 <math:mrow>
41 <math:mn>1</math:mn>
42 <math:mo math:stretchy="false">−</math:mo>
43 <math:mi>p</math:mi>
44 </math:mrow>
45 <math:mo math:stretchy="false">)</math:mo>
46 </math:mrow>
47 <math:mrow>
48 <math:mi>n</math:mi>
49 <math:mo math:stretchy="false">−</math:mo>
50 <math:mi>k</math:mi>
51 </math:mrow>
52 </math:msup>
53 </math:mrow>
54 </math:mrow>
55 <math:mtext> avec </math:mtext>
56 <math:mrow>
57 <math:mfenced math:open="" math:close="">
58 <math:mtable>
59 <math:mtr>
60 <math:mi>n</math:mi>
61 </math:mtr>
62 <math:mtr>
63 <math:mi>k</math:mi>
64 </math:mtr>
65 </math:mtable>
66 </math:mfenced>
67 <math:mo math:stretchy="false">=</math:mo>
68 <math:mfrac>
69 <math:mrow>
70 <math:mi>n</math:mi>
71 <math:mi>!</math:mi>
72 </math:mrow>
73 <math:mrow>
74 <math:mi>k</math:mi>
75 <math:mrow>
76 <math:mi>!</math:mi>
77 <math:mo math:stretchy="false">⋅</math:mo>
78 <math:mrow>
79 <math:mo math:stretchy="false">(</math:mo>
80 <math:mrow>
81 <math:mi>n</math:mi>
82 <math:mo math:stretchy="false">−</math:mo>
83 <math:mi>k</math:mi>
84 </math:mrow>
85 <math:mo math:stretchy="false">)</math:mo>
86 </math:mrow>
87 </math:mrow>
88 <math:mi>!</math:mi>
89 </math:mrow>
90 </math:mfrac>
91 </math:mrow>
92 </math:mrow>
93 <math:annotation math:encoding="StarMath 5.0">pr(k+1) = left ( stack{ n # k } right ) cdot p^k cdot (1 - p)^{n-k} &quot; avec &quot; left ( stack { n # k } right ) = {{n!} over {k! cdot (n-k)!}}</math:annotation>
94 </math:semantics>
95</math:math> \ No newline at end of file
diff --git a/scilab/modules/statistics/help/mml/binomial_equation_1_ru_RU.mml b/scilab/modules/statistics/help/mml/binomial_equation_1_ru_RU.mml
deleted file mode 100644
index b13cc98..0000000
--- a/scilab/modules/statistics/help/mml/binomial_equation_1_ru_RU.mml
+++ /dev/null
@@ -1,95 +0,0 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE math:math PUBLIC "-//OpenOffice.org//DTD Modified W3C MathML 1.01//EN" "math.dtd">
3<math:math xmlns:math="http://www.w3.org/1998/Math/MathML">
4 <math:semantics>
5 <math:mrow>
6 <math:mi math:fontstyle="italic">pr</math:mi>
7 <math:mrow>
8 <math:mrow>
9 <math:mo math:stretchy="false">(</math:mo>
10 <math:mrow>
11 <math:mi>k</math:mi>
12 <math:mo math:stretchy="false">+</math:mo>
13 <math:mn>1</math:mn>
14 </math:mrow>
15 <math:mo math:stretchy="false">)</math:mo>
16 </math:mrow>
17 <math:mo math:stretchy="false">=</math:mo>
18 <math:mrow>
19 <math:mrow>
20 <math:mfenced math:open="" math:close="">
21 <math:mtable>
22 <math:mtr>
23 <math:mi>n</math:mi>
24 </math:mtr>
25 <math:mtr>
26 <math:mi>k</math:mi>
27 </math:mtr>
28 </math:mtable>
29 </math:mfenced>
30 <math:mo math:stretchy="false">⋅</math:mo>
31 <math:msup>
32 <math:mi>p</math:mi>
33 <math:mi>k</math:mi>
34 </math:msup>
35 </math:mrow>
36 <math:mo math:stretchy="false">⋅</math:mo>
37 <math:msup>
38 <math:mrow>
39 <math:mo math:stretchy="false">(</math:mo>
40 <math:mrow>
41 <math:mn>1</math:mn>
42 <math:mo math:stretchy="false">−</math:mo>
43 <math:mi>p</math:mi>
44 </math:mrow>
45 <math:mo math:stretchy="false">)</math:mo>
46 </math:mrow>
47 <math:mrow>
48 <math:mi>n</math:mi>
49 <math:mo math:stretchy="false">−</math:mo>
50 <math:mi>k</math:mi>
51 </math:mrow>
52 </math:msup>
53 </math:mrow>
54 </math:mrow>
55 <math:mtext> где </math:mtext>
56 <math:mrow>
57 <math:mfenced math:open="" math:close="">
58 <math:mtable>
59 <math:mtr>
60 <math:mi>n</math:mi>
61 </math:mtr>
62 <math:mtr>
63 <math:mi>k</math:mi>
64 </math:mtr>
65 </math:mtable>
66 </math:mfenced>
67 <math:mo math:stretchy="false">=</math:mo>
68 <math:mfrac>
69 <math:mrow>
70 <math:mi>n</math:mi>
71 <math:mi>!</math:mi>
72 </math:mrow>
73 <math:mrow>
74 <math:mi>k</math:mi>
75 <math:mrow>
76 <math:mi>!</math:mi>
77 <math:mo math:stretchy="false">⋅</math:mo>
78 <math:mrow>
79 <math:mo math:stretchy="false">(</math:mo>
80 <math:mrow>
81 <math:mi>n</math:mi>
82 <math:mo math:stretchy="false">−</math:mo>
83 <math:mi>k</math:mi>
84 </math:mrow>
85 <math:mo math:stretchy="false">)</math:mo>
86 </math:mrow>
87 </math:mrow>
88 <math:mi>!</math:mi>
89 </math:mrow>
90 </math:mfrac>
91 </math:mrow>
92 </math:mrow>
93 <math:annotation math:encoding="StarMath 5.0">pr(k+1) = left ( stack{ n # k } right ) cdot p^k cdot (1 - p)^{n-k} &quot; где &quot; left ( stack { n # k } right ) = {{n!} over {k! cdot (n-k)!}}</math:annotation>
94 </math:semantics>
95</math:math> \ No newline at end of file
diff --git a/scilab/modules/statistics/help/pt_BR/1_cdf/binomial.xml b/scilab/modules/statistics/help/pt_BR/1_cdf/binomial.xml
index 422af3b..08ce403 100644
--- a/scilab/modules/statistics/help/pt_BR/1_cdf/binomial.xml
+++ b/scilab/modules/statistics/help/pt_BR/1_cdf/binomial.xml
@@ -13,14 +13,17 @@
13 * along with this program. 13 * along with this program.
14 * 14 *
15 --> 15 -->
16<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="binomial" xml:lang="pt"> 16<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
17 xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml"
18 xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
19 xmlns:scilab="http://www.scilab.org" xml:id="binomial" xml:lang="pt">
17 <refnamediv> 20 <refnamediv>
18 <refname>binomial</refname> 21 <refname>binomial</refname>
19 <refpurpose>probabilidades de distribuição binomial</refpurpose> 22 <refpurpose>probabilidades de distribuição binomial</refpurpose>
20 </refnamediv> 23 </refnamediv>
21 <refsynopsisdiv> 24 <refsynopsisdiv>
22 <title>Seqüência de Chamamento</title> 25 <title>Seqüência de Chamamento</title>
23 <synopsis>pr=binomial(p,n)</synopsis> 26 <synopsis>pr = binomial(p, n)</synopsis>
24 </refsynopsisdiv> 27 </refsynopsisdiv>
25 <refsection> 28 <refsection>
26 <title>Parâmetros</title> 29 <title>Parâmetros</title>
@@ -52,17 +55,14 @@
52 binomial, i.e. <literal>pr(k+1)</literal> é a probabilidade de 55 binomial, i.e. <literal>pr(k+1)</literal> é a probabilidade de
53 <literal>k</literal> successos em <literal>n</literal> tentativas 56 <literal>k</literal> successos em <literal>n</literal> tentativas
54 independentes de Bernoulli com probabilidade de sucesso 57 independentes de Bernoulli com probabilidade de sucesso
55 <literal>p</literal>. Em outras palavras : <literal>pr(k+1) = 58 <literal>p</literal>. Em outras palavras : <literal>pr(k+1) = probability(X=k)</literal>
56 probability(X=k) 59 ,com X uma variável aleatória, segundo a distribuição B(n,p) , e numericamente :
57 </literal> 60 </para>
58 ,com X uma variável aleatória, segundo a 61 <para>
59 distribuição B(n,p) , e numericamente : 62 <latex style="display" alt="pr(k+1) = p^k (1-p)^(n-k) n!/[k!(n-k)!]">
63 pr(k+1)=\left(\frac{n!}{k!\,(n-k)!}\right)\,p^k\,(1-p)^{n-k}
64 </latex>
60 </para> 65 </para>
61 <programlisting><![CDATA[
62 / n \ k n-k / n \ n!
63 pr(k+1) = | | p (1-p) com | | = ---------
64 \ k / \ k / k! (n-k)!
65 ]]></programlisting>
66 </refsection> 66 </refsection>
67 <refsection> 67 <refsection>
68 <title>Exemplos</title> 68 <title>Exemplos</title>
diff --git a/scilab/modules/statistics/help/ru_RU/1_cdf/binomial.xml b/scilab/modules/statistics/help/ru_RU/1_cdf/binomial.xml
index e6aface..d1f51bc 100644
--- a/scilab/modules/statistics/help/ru_RU/1_cdf/binomial.xml
+++ b/scilab/modules/statistics/help/ru_RU/1_cdf/binomial.xml
@@ -13,14 +13,17 @@
13 * along with this program. 13 * along with this program.
14 * 14 *
15 --> 15 -->
16<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="binomial" xml:lang="ru"> 16<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
17 xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml"
18 xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
19 xmlns:scilab="http://www.scilab.org" xml:id="binomial" xml:lang="ru">
17 <refnamediv> 20 <refnamediv>
18 <refname>binomial</refname> 21 <refname>binomial</refname>
19 <refpurpose>вероятности по биномиальному распределению</refpurpose> 22 <refpurpose>вероятности по биномиальному распределению</refpurpose>
20 </refnamediv> 23 </refnamediv>
21 <refsynopsisdiv> 24 <refsynopsisdiv>
22 <title>Синтаксис</title> 25 <title>Синтаксис</title>
23 <synopsis>pr=binomial(p,n)</synopsis> 26 <synopsis>pr = binomial(p, n)</synopsis>
24 </refsynopsisdiv> 27 </refsynopsisdiv>
25 <refsection> 28 <refsection>
26 <title>Аргументы</title> 29 <title>Аргументы</title>
@@ -48,15 +51,18 @@
48 <refsection> 51 <refsection>
49 <title>Описание</title> 52 <title>Описание</title>
50 <para> 53 <para>
51 <literal>pr=binomial(p,n)</literal> возвращает вектор вероятности по биномиальному распределению, т. е. <literal>pr(k+1)</literal> равно вероятности <literal>k</literal> "успехов" в <literal>n</literal> независимых экспериментах с вероятностью "успеха" в каждом из них <literal>p</literal>. Другими словами: <literal>pr(k+1) = вероятности (X=k)</literal>, где X - случайное значение по распределению B(n,p), и численно: 54 <literal>pr=binomial(p,n)</literal> возвращает вектор вероятности по биномиальному
55 распределению, т. е. <literal>pr(k+1)</literal> равно вероятности <literal>k</literal>
56 "успехов" в <literal>n</literal> независимых экспериментах с вероятностью "успеха"
57 в каждом из них <literal>p</literal>. Другими словами:
58 <literal>pr(k+1) = вероятности (X=k)</literal>, где X - случайное значение по
59 распределению B(n,p), и численно :
60 </para>
61 <para>
62 <latex style="display" alt="pr(k+1) = p^k (1-p)^(n-k) n!/[k!(n-k)!]">
63 pr(k+1)=\left(\frac{n!}{k!\,(n-k)!}\right)\,p^k\,(1-p)^{n-k}
64 </latex>
52 </para> 65 </para>
53 <informalequation>
54 <mediaobject>
55 <imageobject>
56 <imagedata align="center" fileref="../../mml/binomial_equation_1_ru_RU.mml"/>
57 </imageobject>
58 </mediaobject>
59 </informalequation>
60 </refsection> 66 </refsection>
61 <refsection> 67 <refsection>
62 <title>Примеры</title> 68 <title>Примеры</title>
diff --git a/scilab/modules/statistics/macros/histc.sci b/scilab/modules/statistics/macros/histc.sci
index 5c8b758..3cd874a 100644
--- a/scilab/modules/statistics/macros/histc.sci
+++ b/scilab/modules/statistics/macros/histc.sci
@@ -70,8 +70,9 @@ function [heights, jokers, binsOut, ind] = histc(data, bins, options)
70 // ------------------------- 70 // -------------------------
71 mode55 = %f 71 mode55 = %f
72 // Check for Scilab 5.5 back-compatibility 72 // Check for Scilab 5.5 back-compatibility
73 if (isdef("data","l") & isdef("bins", "l") & type(bins)>0) & .. 73 if ~isdef("from_histplot") & isdef("data","l") & isdef("bins", "l") & ..
74 size(data,"*")< size(bins,"*") & or(type(data)==[1 8]) & type(bins)~=10 74 type(bins)>0 & size(data,"*")< size(bins,"*") & ..
75 or(type(data)==[1 8]) & type(bins)~=10
75 msg = _("%s: data are now expected in argument #1 => arguments #1 and #2 switched\n") 76 msg = _("%s: data are now expected in argument #1 => arguments #1 and #2 switched\n")
76 warning(msprintf(msg, fname)) 77 warning(msprintf(msg, fname))
77 mode55 = %t 78 mode55 = %t
diff --git a/scilab/modules/statistics/tests/unit_tests/cdfgam.dia.ref b/scilab/modules/statistics/tests/unit_tests/cdfgam.dia.ref
deleted file mode 100644
index e66bd0e..0000000
--- a/scilab/modules/statistics/tests/unit_tests/cdfgam.dia.ref
+++ /dev/null
@@ -1,127 +0,0 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2010 - DIGITEO - Michael Baudin
4// Copyright (C) 2011 - DIGITEO - Michael Baudin
5//
6// This file is distributed under the same license as the Scilab package.
7// =============================================================================
8// <-- CLI SHELL MODE -->
9// <-- ENGLISH IMPOSED -->
10// Run with test_run('statistics','cdfgam',['no_check_error_output']);
11//
12// Assessing the quality of the Normal distribution function
13// References
14// Yalta, A. T. 2008. The accuracy of statistical distributions in Microsoft®Excel 2007. Comput. Stat. Data Anal. 52, 10 (Jun. 2008), 4579-4586. DOI= http://dx.doi.org/10.1016/j.csda.2008.03.005
15// Computation of Statistical Distributions (ELV), Leo Knüsel
16// Table 5
17// Check Gamma distribution with parameters (x, alpha, beta = 1, Sigma = 1)
18//
19// Table of inputs from Yalta, 2008
20// [x shape scale P ]
21table = [
220.1 , 0.1 , 1 , 0.827552
230.2 , 0.1 , 1 , 0.879420
240.2 , 0.2 , 1 , 0.764435
250.3 , 0.2 , 1 , 0.816527
260.3 , 0.3 , 1 , 0.726957
270.4 , 0.3 , 1 , 0.776381
280.4 , 0.4 , 1 , 0.701441
290.5 , 0.4 , 1 , 0.748019
300.5 , 0.5 , 1 , 0.682689
310.6 , 0.5 , 1 , 0.726678
32];
33precision = 1.e-5;
34ntests = size(table,"r");
35for i = 1 : ntests
36 x = table(i,1);
37 shape = table(i,2);
38 scale = table(i,3);
39 expected = table(i,4);
40 // Caution: this is the rate !
41 rate = 1/scale;
42 [computed,Q]=cdfgam("PQ",x,shape,rate);
43 assert_checkalmostequal ( computed , expected , precision );
44 assert_checkalmostequal ( Q , 1 - expected , precision );
45end
46// Table of inputs computed from R-2.8.1
47// [x shape scale PDF-P CDF-P CDF-Q]
48table = [
491.000000000000000056D-01 1.000000000000000056D-01 1.000000000000000000D+00 7.554920138253073958D-01 8.275517595858505882D-01 1.724482404141494951D-01
502.000000000000000111D-01 1.000000000000000056D-01 1.000000000000000000D+00 3.663307993056703071D-01 8.794196267900568076D-01 1.205803732099432063D-01
512.000000000000000111D-01 2.000000000000000111D-01 1.000000000000000000D+00 6.462857778271943188D-01 7.644345975029189777D-01 2.355654024970809945D-01
522.999999999999999889D-01 2.000000000000000111D-01 1.000000000000000000D+00 4.227875047602157044D-01 8.165267943336527168D-01 1.834732056663473110D-01
532.999999999999999889D-01 2.999999999999999889D-01 1.000000000000000000D+00 5.752117576599179438D-01 7.269573437103662439D-01 2.730426562896338116D-01
544.000000000000000222D-01 2.999999999999999889D-01 1.000000000000000000D+00 4.255407854753925911D-01 7.763805810166358734D-01 2.236194189833642099D-01
554.000000000000000222D-01 4.000000000000000222D-01 1.000000000000000000D+00 5.236648604477927016D-01 7.014412706419403953D-01 2.985587293580597157D-01
565.000000000000000000D-01 4.000000000000000222D-01 1.000000000000000000D+00 4.144555659263016167D-01 7.480185547260104206D-01 2.519814452739895239D-01
575.000000000000000000D-01 5.000000000000000000D-01 1.000000000000000000D+00 4.839414490382866751D-01 6.826894921370858516D-01 3.173105078629140929D-01
585.999999999999999778D-01 5.000000000000000000D-01 1.000000000000000000D+00 3.997355278034666060D-01 7.266783217077018575D-01 2.733216782922981980D-01
595.000000000000000000D-01 5.000000000000000000D-01 2.000000000000000000D+00 4.393912894677223790D-01 5.204998778130465187D-01 4.795001221869534258D-01
605.000000000000000000D-01 5.000000000000000000D-01 3.000000000000000000D+00 3.899393114454822729D-01 4.362971383492270094D-01 5.637028616507729906D-01
615.000000000000000000D-01 5.000000000000000000D-01 4.000000000000000000D+00 3.520653267642995243D-01 3.829249225480261809D-01 6.170750774519737636D-01
621.000000000000000000D+00 5.000000000000000000D-01 1.000000000000000000D+00 2.075537487102973866D-01 8.427007929497148941D-01 1.572992070502851891D-01
632.000000000000000000D+00 5.000000000000000000D-01 1.000000000000000000D+00 5.399096651318804896D-02 9.544997361036415828D-01 4.550026389635838248D-02
644.000000000000000000D+00 5.000000000000000000D-01 1.000000000000000000D+00 5.166746338523012412D-03 9.953222650189527121D-01 4.677734981047261889D-03
651.000000000000000000D+01 5.000000000000000000D-01 1.000000000000000000D+00 8.099910956089122777D-06 9.999922557835689840D-01 7.744216431044085842D-06
662.000000000000000000D+01 5.000000000000000000D-01 1.000000000000000000D+00 2.600281868827196957D-10 9.999999997460371493D-01 2.539628589470869077D-10
674.000000000000000000D+01 5.000000000000000000D-01 1.000000000000000000D+00 3.789795640412981196D-19 1.000000000000000000D+00 3.744097384202895045D-19
683.000000000000000000D+02 5.000000000000000000D-01 1.000000000000000000D+00 1.67694904029982009D-132 1.000000000000000000D+00 1.67416798469182012D-132
691.000000000000000021D-02 5.000000000000000000D-01 1.000000000000000000D+00 5.585758033944684620D+00 1.124629160182848975D-01 8.875370839817151580D-01
701.000000000000000048D-04 5.000000000000000000D-01 1.000000000000000000D+00 5.641331674102550409D+01 1.128341555584961957D-02 9.887165844441503371D-01
711.000000000000000021D-08 5.000000000000000000D-01 1.000000000000000000D+00 5.641895779058606422D+03 1.128379163334249004D-04 9.998871620836665697D-01
729.999999999999999452D-21 5.000000000000000000D-01 1.000000000000000000D+00 5.641895835477570534D+09 1.128379167095512970D-10 9.999999998871620388D-01
739.999999999999999293D-41 5.000000000000000000D-01 1.000000000000000000D+00 5.641895835477568717D+19 1.128379167095512972D-20 1.000000000000000000D+00
741.00000000000000002D-100 5.000000000000000000D-01 1.000000000000000000D+00 5.641895835477541988D+49 1.128379167095513082D-50 1.000000000000000000D+00
759.99999999999999982D-201 5.000000000000000000D-01 1.000000000000000000D+00 5.641895835477511468D+99 1.12837916709551300D-100 1.000000000000000000D+00
76];
77// For the inversion of Shape, require only 8 digits, as
78// a consequence of bug #7569: http://bugzilla.scilab.org/show_bug.cgi?id=7569
79//
80// Some tests do not pass:
81// http://bugzilla.scilab.org/show_bug.cgi?id=8031
82// http://bugzilla.scilab.org/show_bug.cgi?id=8030
83//
84// Prints the number of accurate digits.
85precision = 1.e-12;
86precinverse = 1.e-8;
87ntests = size(table,"r");
88for i = 1 : ntests
89 x = table(i,1);
90 shape = table(i,2);
91 scale = table(i,3);
92 p = table(i,5);
93 q = table(i,6);
94 // Caution: this is the rate !
95 rate = 1/scale;
96 [p1,q1] = cdfgam("PQ",x,shape,rate);
97 x1 = cdfgam("X",shape,rate,p,q);
98 shape1 = cdfgam("Shape",rate,p,q,x);
99 rate1 = cdfgam("Rate",p,q,x,shape);
100 if ( %t ) then
101 assert_checkalmostequal ( p1 , p , precision );
102 assert_checkalmostequal ( q1 , q , precision );
103 assert_checkalmostequal ( x1 , x , precision );
104 assert_checkalmostequal ( shape1 , shape , precinverse );
105 assert_checkalmostequal ( rate1 , rate , precinverse );
106 end
107 if ( %f ) then
108 dp = assert_computedigits ( p1 , p );
109 dq = assert_computedigits ( q1 , q );
110 dx = assert_computedigits ( x1 , x );
111 ds = assert_computedigits ( shape1 , shape );
112 dr = assert_computedigits ( rate1 , rate );
113 mprintf("Test #%3d/%3d: Digits p1= %.1f, q1=%.1f, X= %.1f, S= %.1f, R= %.1f\n",i,ntests,dp,dq,dx,ds,dr);
114 end
115end
116// IEEE support
117// See http://bugzilla.scilab.org/show_bug.cgi?id=7296
118Shape = 0;
119Rate = 1;
120X = %inf; // Inf
121[P, Q] = cdfgam("PQ", X, Shape, Rate);
122assert_checkequal(P, 1);
123assert_checkequal(Q, 0);
124X = %nan; // NaN
125[P, Q] = cdfgam("PQ", X, Shape, Rate);
126assert_checkequal(P, %nan);
127assert_checkequal(Q, %nan);
diff --git a/scilab/modules/statistics/tests/unit_tests/cdfgam.tst b/scilab/modules/statistics/tests/unit_tests/cdfgam.tst
index 4d3896d..0fa239b 100644
--- a/scilab/modules/statistics/tests/unit_tests/cdfgam.tst
+++ b/scilab/modules/statistics/tests/unit_tests/cdfgam.tst
@@ -7,6 +7,7 @@
7// ============================================================================= 7// =============================================================================
8 8
9// <-- CLI SHELL MODE --> 9// <-- CLI SHELL MODE -->
10// <-- NO CHECK REF -->
10// <-- ENGLISH IMPOSED --> 11// <-- ENGLISH IMPOSED -->
11 12
12// Run with test_run('statistics','cdfgam',['no_check_error_output']); 13// Run with test_run('statistics','cdfgam',['no_check_error_output']);
@@ -82,17 +83,13 @@ table = [
829.99999999999999982D-201 5.000000000000000000D-01 1.000000000000000000D+00 5.641895835477511468D+99 1.12837916709551300D-100 1.000000000000000000D+00 839.99999999999999982D-201 5.000000000000000000D-01 1.000000000000000000D+00 5.641895835477511468D+99 1.12837916709551300D-100 1.000000000000000000D+00
83]; 84];
84 85
85// For the inversion of Shape, require only 8 digits, as
86// a consequence of bug #7569: http://bugzilla.scilab.org/show_bug.cgi?id=7569
87//
88// Some tests do not pass: 86// Some tests do not pass:
89// http://bugzilla.scilab.org/show_bug.cgi?id=8031 87// http://bugzilla.scilab.org/8030
90// http://bugzilla.scilab.org/show_bug.cgi?id=8030
91// 88//
92// Prints the number of accurate digits. 89// Prints the number of accurate digits.
93 90
94precision = 1.e-12; 91precision = 1.e-12;
95precinverse = 1.e-8; 92precinverse = 1.e-14;
96 93
97ntests = size(table,"r"); 94ntests = size(table,"r");
98for i = 1 : ntests 95for i = 1 : ntests
@@ -125,7 +122,7 @@ for i = 1 : ntests
125end 122end
126 123
127// IEEE support 124// IEEE support
128// See http://bugzilla.scilab.org/show_bug.cgi?id=7296 125// See http://bugzilla.scilab.org/7296
129Shape = 0; 126Shape = 0;
130Rate = 1; 127Rate = 1;
131 128
diff --git a/scilab/modules/statistics/tests/unit_tests/histc.tst b/scilab/modules/statistics/tests/unit_tests/histc.tst
index 1880096..57e6c7c 100644
--- a/scilab/modules/statistics/tests/unit_tests/histc.tst
+++ b/scilab/modules/statistics/tests/unit_tests/histc.tst
@@ -64,7 +64,8 @@ assert_checkequal(size(j),[1,5]);
64assert_checkequal(size(b),[1,5]); 64assert_checkequal(size(b),[1,5]);
65assert_checkequal(size(i),[2,9]); 65assert_checkequal(size(i),[2,9]);
66// Texts 66// Texts
67t = matrix(asciimat(grand(20,1,"uin",ascii("a"), ascii("z"))), 2, 10); 67t = grand(20,1,"uin",ascii("a"), ascii("z"));
68t = matrix(strsplit(ascii(t)), 2, 10);
68[h,j,b,i] = histc(t, ["e" "i" "o" "u"]); 69[h,j,b,i] = histc(t, ["e" "i" "o" "u"]);
69assert_checkequal(size(h),[1,3]); 70assert_checkequal(size(h),[1,3]);
70assert_checkequal(size(j),[1,3]); 71assert_checkequal(size(j),[1,3]);
@@ -386,7 +387,7 @@ t = [
386[h,j,b,i] = histc(t); 387[h,j,b,i] = histc(t);
387assert_checkequal(h, [3 3 2 3 1 5 1 7 6 4 2 4 2 4 8 5]); 388assert_checkequal(h, [3 3 2 3 1 5 1 7 6 4 2 4 2 4 8 5]);
388assert_checkequal(j, [0 0 0]); 389assert_checkequal(j, [0 0 0]);
389assert_checkequal(b, asciimat((97:112)')'); 390assert_checkequal(b, strsplit("a":"p")');
390iref = [ 391iref = [
3913 14 8 9 2 9 6 9 16 12 16 4 6 9 12 3923 14 8 9 2 9 6 9 16 12 16 4 6 9 12
3922 13 5 15 15 6 16 15 8 6 8 8 3 11 15 3932 13 5 15 15 6 16 15 8 6 8 8 3 11 15
@@ -440,6 +441,7 @@ jref = [37 0 7];
440assert_checkequal(h, href/N); 441assert_checkequal(h, href/N);
441assert_checkequal(j, jref/N); 442assert_checkequal(j, jref/N);
442[h,j,b,i] = histc(t2, [bref ""], "discrete,countsNorm,normWith: empty"); 443[h,j,b,i] = histc(t2, [bref ""], "discrete,countsNorm,normWith: empty");
444
443assert_checkequal(h, href/N); 445assert_checkequal(h, href/N);
444assert_checkequal(j, jref/N); 446assert_checkequal(j, jref/N);
445[h,j,b,i] = histc(t2, [bref ""], "discrete,countsNorm,normWith: out"); 447[h,j,b,i] = histc(t2, [bref ""], "discrete,countsNorm,normWith: out");