File: bincommand.htm

package info (click to toggle)
extrema 4.3.6-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 19,212 kB
  • ctags: 6,452
  • sloc: cpp: 86,428; sh: 8,229; makefile: 814
file content (65 lines) | stat: -rw-r--r-- 2,836 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<HTML>
<HEAD>
<TITLE>BIN command</TITLE>
</HEAD>

<BODY BGCOLOR="#FFFFFF" TEXT="#000000">

<P><font size="+3" color="green"><B>BIN command</B></font></P>

<TABLE border="1" cols="2" frame="box" rules="all" width="572">
<TR>
<TD width="15%" valign="top"><B>Syntax</B>:</TD>
<TD width="85%" valign="top"><CODE>
BIN x xbin xcount<br />
BIN\NBINS x xbin xcount n { xmin xmax }</CODE>
</TD></TR>
<TR>
<TD width="15%" valign="top"><B>Qualifiers</B>:</TD>
<TD width="85%" valign="top"><CODE>
\WEIGHTS, \EDGES, \NBINS, \DISCARD, \EMPTY, \AVERAGE, \LAGRANGE</CODE>
</TD></TR>
<TR>
<TD width="15%" valign="top"><B>Defaults</B>:</TD>
<TD width="85%" valign="top"><CODE>
\-WEIGHTS, \-EDGES, \-NBINS, \-DISCARD, \-EMPTY, \-AVERAGE, \LAGRANGE, xmin = min(x), xmax = max(x)</CODE>
</TD></TR>
</TABLE>
<P>
 The <CODE>BIN</CODE> command sorts an input vector,
 <CODE>x</CODE>, into a grid of bins and accumulates
 the counts per bin into an output vector,
 <CODE>xcount</CODE>. Each element of <CODE>x</CODE> is considered only once, so elements
 are never counted as being in more than one bin. By default, the bins are
 defined by their centers, given in vector <CODE>xbin</CODE>, which must be strictly
 monotonically increasing. If <CODE><i>n</i> =
 <a href="../Functions/VariableCharacteristics/len.htm">LEN</a>(xbin)</CODE>,
 define the bin ranges, <CODE><i>r<sub>i</sub></i></CODE></P>
<P>
 <CODE><i>r</i><sub>1</sub> = xbin[1] - (xbin[2] - xbin[1])/2</CODE></P>
<P>
 <CODE><i>r<sub>i</sub></i> = xbin[<i>i</i>] - (xbin[<i>i</i>] - xbin[<i>i</i>-1])/2</CODE>&nbsp; for&nbsp;
 <CODE><i>i</i> = 2, 3, ..., <i>n</i></CODE></P>
<P>
 <CODE><i>r</i><sub><i>n</i>+1</sub> = xbin[<i>n</i>] + (xbin[<i>n</i>] - xbin[<i>n</i>-1])/2</CODE></P>
<P>
 For each
 <CODE><i>i</i> = 1, 2, ..., LEN(x)</CODE>, if <CODE><i>r<sub>j</sub></i> &le; x[<i>i</i>]
 &lt; <i>r<sub>j+1</sub></i></CODE>&nbsp; for some
 <CODE><i>j</i> = 1, 2, ..., <i>n</i></CODE>&nbsp; then
 <CODE>xcount[<i>j</i>]</CODE> is
 incremented by <CODE>1</CODE>, or by the weight,
 <CODE>w[<i>i</i>]</CODE>. By default, events below <CODE><i>r</i><sub>1</sub></CODE> will be placed in
 the first bin, and events above <CODE><i>r</i><sub><i>n</i>+1</sub></CODE> will be placed in
 the last bin. If the <CODE>\DISCARD</CODE> qualifier is used, events outside this
 range will be discarded.</P>
<P>
<a href="weights.htm"><font size="+1" color="olive">Weights</font></a><br />
<a href="nbins.htm"><font size="+1" color="olive">Number of bins</font></a><br />
<a href="lagrange.htm"><font size="+1" color="olive">Lagrange</font></a><br />
<a href="average.htm"><font size="+1" color="olive">Average</font></a><br />
<a href="empty.htm"><font size="+1" color="olive">Count only if empty</font></a><br />
<a href="edges.htm"><font size="+1" color="olive">Edge defined bins</font></a>
</P>
</BODY>
</HTML>