<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<!DOCTYPE MAN SYSTEM "../../manrev.dtd">
<MAN>
  <LANGUAGE>eng</LANGUAGE>
  <TITLE>sample</TITLE>
  <TYPE>Scilab Function  </TYPE>
  <DATE>18-Sep-2003</DATE>
  <SHORT_DESCRIPTION name="sample">  Sampling with replacement</SHORT_DESCRIPTION>

  <CALLING_SEQUENCE>
  <CALLING_SEQUENCE_ITEM>s = sample(n,X,orient)</CALLING_SEQUENCE_ITEM>
  </CALLING_SEQUENCE>

  <PARAM>
  <PARAM_INDENT>

    <PARAM_ITEM>
    <PARAM_NAME>n</PARAM_NAME>
    <PARAM_DESCRIPTION>
       <SP>: positive integer (size of sample)</SP>
    </PARAM_DESCRIPTION>
    </PARAM_ITEM>

    <PARAM_ITEM>
    <PARAM_NAME>X</PARAM_NAME>
    <PARAM_DESCRIPTION>
       <SP>: matrix. Samples will be extracted from this matrix.</SP>
    </PARAM_DESCRIPTION>
    </PARAM_ITEM>

    <PARAM_ITEM>
    <PARAM_NAME>orient</PARAM_NAME>
    <PARAM_DESCRIPTION>
       <SP>: Optional parameter. Admissible values are 1, 2, 'r' or 'c'</SP>
    </PARAM_DESCRIPTION>
    </PARAM_ITEM>

    <PARAM_ITEM>
    <PARAM_NAME>s</PARAM_NAME>
    <PARAM_DESCRIPTION>
       <SP>: vector or matrix containing sample</SP>
    </PARAM_DESCRIPTION>
    </PARAM_ITEM>
  </PARAM_INDENT>
  </PARAM>
 
  <DESCRIPTION>
<P>
     This function gives a  vector (or matrix) nx1. It contains
     a random  sample of n extractions,  with replacement, from
     the matrix X.
</P>
 <P>
     s=sample(n,X)  (or s=sample(n,X,'*'))  returns a  vector s
     whose  values are  a random  sample  of n  values from  X,
     extracted with replacement, from X .
</P>
 <P>

     s=sample(n,X,'r')   (or,   equivalently,  s=sample(n,X,1))
     returns  a matrix  of type  size(X,'r')xn.  It  contains a
     random sample of n  rows, extracted with replacement, from
     the rows of X.
</P>
 <P>

     s=sample(n,X,'c')   (or,   equivalently,  s=sample(n,X,2))
     returns  a matrix  of type  nxsize(X,'c').  It  contains a
     random  sample of  n columns,  extracted  with replacement
     from the columns of X.
</P>

 </DESCRIPTION>

  <EXAMPLE><![CDATA[
X=['a' 'dd' 'arreu'; 'ber' 'car' 'zon']
s=sample(25,X)
s=sample(25,X,'r')
s=sample(25,X,'c')
  ]]></EXAMPLE>

  <SEE_ALSO>
    <SEE_ALSO_ITEM> <LINK>samplef</LINK> </SEE_ALSO_ITEM>
    <SEE_ALSO_ITEM> <LINK>samwr</LINK> </SEE_ALSO_ITEM>
  </SEE_ALSO>


  <AUTHOR>
    Carlos Klimann
  </AUTHOR>
</MAN>
