<< covar Descriptive Statistics median >>

Ajuda do Scilab >> Estatística > Descriptive Statistics > histc

histc

computes an histogram

Syntax

h = histc(n, data)
h = histc(x, data)
h = histc(.., normalization)

Arguments

n

positive integer (number of classes)

x

increasing vector defining the classes (x may have at least 2 components)

data

vector (data to be analysed)

h

  • If normalization is %T: Probability densities on the bins defined by n or x, such that the bins areas are proportionnal to their populations.

  • If normalization is %F: Numbers of elements in the bins.

normalization

scalar boolean (default = %T), setting the type of output (see h).

Description

This function computes a histogram of the data vector using the classes x. When the number n of classes is provided instead of x, the classes are chosen equally spaced and x(1) = min(data) < x(2) = x(1) + dx < ... < x(n+1) = max(data) with dx = (x(n+1)-x(1))/n.

The classes are defined by C1 = [x(1), x(2)] and Ci = ( x(i), x(i+1)] for i >= 2. Noting Nmax the total number of data (Nmax = length(data)) and Ni the number of data components falling in Ci, the value of the histogram for x in Ci is equal to Ni/(Nmax (x(i+1)-x(i))) when "normalized" is selected and else, simply equal to Ni. When normalization occurs the histogram verifies:

\int_{x(1)}^{x(n+1)}h(x)\,\mathrm{d}x=1

when x(1)<=min(data) and max(data) <= x(n+1)

Examples

See also

History

VersãoDescrição
5.5.0 Introduction

Report an issue
<< covar Descriptive Statistics median >>