~ubuntu-branches/ubuntu/raring/scilab/raring-proposed

« back to all changes in this revision

Viewing changes to modules/statistics/help/en_US/sampling/sample.xml

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2012-08-30 14:42:38 UTC
  • mfrom: (1.4.7)
  • Revision ID: package-import@ubuntu.com-20120830144238-c1y2og7dbm7m9nig
Tags: 5.4.0-beta-3-1~exp1
* New upstream release
* Update the scirenderer dep
* Get ride of libjhdf5-java dependency

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 *
12
12
 -->
13
13
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:lang="en" xml:id="sample">
14
 
  <refnamediv>
15
 
    <refname>sample</refname>
16
 
    <refpurpose>  Sampling with replacement</refpurpose>
17
 
  </refnamediv>
18
 
  <refsynopsisdiv>
19
 
    <title>Calling Sequence</title>
20
 
    <synopsis>s = sample(n,X,orient)</synopsis>
21
 
  </refsynopsisdiv>
22
 
  <refsection>
23
 
    <title>Arguments</title>
24
 
    <variablelist>
25
 
      <varlistentry>
26
 
        <term>n</term>
27
 
        <listitem>
28
 
          <para>positive integer (size of sample)</para>
29
 
        </listitem>
30
 
      </varlistentry>
31
 
      <varlistentry>
32
 
        <term>X</term>
33
 
        <listitem>
34
 
          <para>matrix. Samples will be extracted from this matrix.</para>
35
 
        </listitem>
36
 
      </varlistentry>
37
 
      <varlistentry>
38
 
        <term>orient</term>
39
 
        <listitem>
40
 
          <para>Optional parameter. Admissible values are 1, 2, 'r' or 'c'</para>
41
 
        </listitem>
42
 
      </varlistentry>
43
 
      <varlistentry>
44
 
        <term>s</term>
45
 
        <listitem>
46
 
          <para>vector or matrix containing sample</para>
47
 
        </listitem>
48
 
      </varlistentry>
49
 
    </variablelist>
50
 
  </refsection>
51
 
  <refsection>
52
 
    <title>Description</title>
53
 
    <para>
54
 
      This function gives a  vector (or matrix) nx1. It contains
55
 
      a random  sample of n extractions,  with replacement, from
56
 
      the matrix X.
57
 
    </para>
58
 
    <para>
59
 
      s=sample(n,X)  (or s=sample(n,X,'*'))  returns a  vector s
60
 
      whose  values are  a random  sample  of n  values from  X,
61
 
      extracted with replacement, from X .
62
 
    </para>
63
 
    <para>
64
 
      
65
 
      s=sample(n,X,'r')   (or,   equivalently,  s=sample(n,X,1))
66
 
      returns  a matrix  of type  size(X,'r')xn.  It  contains a
67
 
      random sample of n  rows, extracted with replacement, from
68
 
      the rows of X.
69
 
    </para>
70
 
    <para>
71
 
      
72
 
      s=sample(n,X,'c')   (or,   equivalently,  s=sample(n,X,2))
73
 
      returns  a matrix  of type  nxsize(X,'c').  It  contains a
74
 
      random  sample of  n columns,  extracted  with replacement
75
 
      from the columns of X.
76
 
    </para>
77
 
  </refsection>
78
 
  <refsection>
79
 
    <title>Examples</title>
80
 
    <programlisting role="example"><![CDATA[ 
 
14
    <refnamediv>
 
15
        <refname>sample</refname>
 
16
        <refpurpose>  Sampling with replacement</refpurpose>
 
17
    </refnamediv>
 
18
    <refsynopsisdiv>
 
19
        <title>Calling Sequence</title>
 
20
        <synopsis>s = sample(n,X,orient)</synopsis>
 
21
    </refsynopsisdiv>
 
22
    <refsection>
 
23
        <title>Arguments</title>
 
24
        <variablelist>
 
25
            <varlistentry>
 
26
                <term>n</term>
 
27
                <listitem>
 
28
                    <para>positive integer (size of sample)</para>
 
29
                </listitem>
 
30
            </varlistentry>
 
31
            <varlistentry>
 
32
                <term>X</term>
 
33
                <listitem>
 
34
                    <para>matrix. Samples will be extracted from this matrix.</para>
 
35
                </listitem>
 
36
            </varlistentry>
 
37
            <varlistentry>
 
38
                <term>orient</term>
 
39
                <listitem>
 
40
                    <para>Optional parameter. Admissible values are 1, 2, 'r' or 'c'</para>
 
41
                </listitem>
 
42
            </varlistentry>
 
43
            <varlistentry>
 
44
                <term>s</term>
 
45
                <listitem>
 
46
                    <para>vector or matrix containing sample</para>
 
47
                </listitem>
 
48
            </varlistentry>
 
49
        </variablelist>
 
50
    </refsection>
 
51
    <refsection>
 
52
        <title>Description</title>
 
53
        <para>
 
54
            This function gives a  vector (or matrix) nx1. It contains
 
55
            a random  sample of n extractions,  with replacement, from
 
56
            the matrix X.
 
57
        </para>
 
58
        <para>
 
59
            s=sample(n,X)  (or s=sample(n,X,'*'))  returns a  vector s
 
60
            whose  values are  a random  sample  of n  values from  X,
 
61
            extracted with replacement, from X .
 
62
        </para>
 
63
        <para>
 
64
            
 
65
            s=sample(n,X,'r')   (or,   equivalently,  s=sample(n,X,1))
 
66
            returns  a matrix  of type  size(X,'r')xn.  It  contains a
 
67
            random sample of n  rows, extracted with replacement, from
 
68
            the rows of X.
 
69
        </para>
 
70
        <para>
 
71
            
 
72
            s=sample(n,X,'c')   (or,   equivalently,  s=sample(n,X,2))
 
73
            returns  a matrix  of type  nxsize(X,'c').  It  contains a
 
74
            random  sample of  n columns,  extracted  with replacement
 
75
            from the columns of X.
 
76
        </para>
 
77
    </refsection>
 
78
    <refsection>
 
79
        <title>Examples</title>
 
80
        <programlisting role="example"><![CDATA[ 
81
81
X=['a' 'dd' 'arreu'; 'ber' 'car' 'zon']
82
82
s=sample(25,X)
83
83
s=sample(25,X,'r')
84
84
s=sample(25,X,'c')
85
85
 ]]></programlisting>
86
 
  </refsection>
87
 
  <refsection role="see also">
88
 
    <title>See Also</title>
89
 
    <simplelist type="inline">
90
 
      <member>
91
 
        <link linkend="samplef">samplef</link>
92
 
      </member>
93
 
      <member>
94
 
        <link linkend="samwr">samwr</link>
95
 
      </member>
96
 
    </simplelist>
97
 
  </refsection>
 
86
    </refsection>
 
87
    <refsection role="see also">
 
88
        <title>See Also</title>
 
89
        <simplelist type="inline">
 
90
            <member>
 
91
                <link linkend="samplef">samplef</link>
 
92
            </member>
 
93
            <member>
 
94
                <link linkend="samwr">samwr</link>
 
95
            </member>
 
96
        </simplelist>
 
97
    </refsection>
98
98
</refentry>