Programmer Guide/Command Reference/EVAL/hist: Difference between revisions
From STX Wiki
< Programmer Guide | Command Reference | EVAL
Jump to navigationJump to search
No edit summary |
No edit summary |
||
Line 9: | Line 9: | ||
:;<var>x</var>: a vector or a matrix | :;<var>x</var>: a vector or a matrix | ||
:;<var>us, os, n</var>: Every pair <code>{''us''+d*i, ''us''+d*(i+1)} (with: d=(''os''-''us'')/n, i=0..n-1)</code> defines a class. All three arguments are scalars. | :;<var>us, os, n</var>: Every pair <code>{''us''+d*i, ''us''+d*(i+1)} (with: d=(''os''-''us'')/n, i=0..n-1)</code> defines a class. All three arguments are scalars. | ||
:;<var>uv, ov</var>: Every pair <code>{''uv''[i], ''ov''[i]} (with i=0..nrow(''uv'')-1)</code> defines a class. Both arguments must be vectors with same length. | :;<var>uv, ov</var>: Every pair <code>{''uv''[i], ''ov''[i]} (with: i=0..nrow(''uv'')-1)</code> defines a class. Both arguments must be vectors with same length. | ||
:;<var>rv</var>: Every pair <code>{''rv''[i], ''rv''[i+1]} (with i=0..nrow(''rv'')-2)</code> defines a class. The argument must be vector. | :;<var>rv</var>: Every pair <code>{''rv''[i], ''rv''[i+1]} (with: i=0..nrow(''rv'')-2)</code> defines a class. The argument must be vector. | ||
:;<var>rm</var>: Every pair <code>{''rm''[i,0], ''rm''[i,1]} (with i=0..nrow(''rm'')-1)</code> defines a class. The argument must be matrix with 2 columns. | :;<var>rm</var>: Every pair <code>{''rm''[i,0], ''rm''[i,1]} (with: i=0..nrow(''rm'')-1)</code> defines a class. The argument must be matrix with 2 columns. | ||
;Result: The result ''r'' is a scalar or a vector. Each element ''r''<sub>i</sub> is the number of elements of ''x'' belonging to class i. An element ''x''<sub>j,k</sub> belongs to a class i if <code>xmin<sub>i</sub> <= ''x''<sub>j,k</sub> < xmax<sub>i</sub></code>. | ;Result: The result ''r'' is a scalar or a vector. Each element ''r''<sub>i</sub> is the number of elements of ''x'' belonging to class i. An element ''x''<sub>j,k</sub> belongs to a class i if <code>xmin<sub>i</sub> <= ''x''<sub>j,k</sub> < xmax<sub>i</sub></code>. | ||
Revision as of 12:40, 8 April 2011
Calculate the absolute frequency of the values of vector x in arbitrary classes. Depending on the number of extents, the result of the function is a vector or a scalar.
- Usage
hist(x, us, os, n)
hist(x, uv, ov)
hist(x, rv)
hist(hist(x, rm)
- x
- a vector or a matrix
- us, os, n
- Every pair
{us+d*i, us+d*(i+1)} (with: d=(os-us)/n, i=0..n-1)
defines a class. All three arguments are scalars. - uv, ov
- Every pair
{uv[i], ov[i]} (with: i=0..nrow(uv)-1)
defines a class. Both arguments must be vectors with same length. - rv
- Every pair
{rv[i], rv[i+1]} (with: i=0..nrow(rv)-2)
defines a class. The argument must be vector. - rm
- Every pair
{rm[i,0], rm[i,1]} (with: i=0..nrow(rm)-1)
defines a class. The argument must be matrix with 2 columns.
- Result
- The result r is a scalar or a vector. Each element ri is the number of elements of x belonging to class i. An element xj,k belongs to a class i if
xmini <= xj,k < xmaxi
.