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">
15
<refname>sample</refname>
16
<refpurpose> Sampling with replacement</refpurpose>
19
<title>Calling Sequence</title>
20
<synopsis>s = sample(n,X,orient)</synopsis>
23
<title>Arguments</title>
28
<para>positive integer (size of sample)</para>
34
<para>matrix. Samples will be extracted from this matrix.</para>
40
<para>Optional parameter. Admissible values are 1, 2, 'r' or 'c'</para>
46
<para>vector or matrix containing sample</para>
52
<title>Description</title>
54
This function gives a vector (or matrix) nx1. It contains
55
a random sample of n extractions, with replacement, from
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 .
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
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.
79
<title>Examples</title>
80
<programlisting role="example"><![CDATA[
15
<refname>sample</refname>
16
<refpurpose> Sampling with replacement</refpurpose>
19
<title>Calling Sequence</title>
20
<synopsis>s = sample(n,X,orient)</synopsis>
23
<title>Arguments</title>
28
<para>positive integer (size of sample)</para>
34
<para>matrix. Samples will be extracted from this matrix.</para>
40
<para>Optional parameter. Admissible values are 1, 2, 'r' or 'c'</para>
46
<para>vector or matrix containing sample</para>
52
<title>Description</title>
54
This function gives a vector (or matrix) nx1. It contains
55
a random sample of n extractions, with replacement, from
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 .
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
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.
79
<title>Examples</title>
80
<programlisting role="example"><![CDATA[
81
81
X=['a' 'dd' 'arreu'; 'ber' 'car' 'zon']
85
85
]]></programlisting>
87
<refsection role="see also">
88
<title>See Also</title>
89
<simplelist type="inline">
91
<link linkend="samplef">samplef</link>
94
<link linkend="samwr">samwr</link>
87
<refsection role="see also">
88
<title>See Also</title>
89
<simplelist type="inline">
91
<link linkend="samplef">samplef</link>
94
<link linkend="samwr">samwr</link>