HyperMath

PDF

PDF

Previous topic Next topic No expanding text in this topic  

PDF

Previous topic Next topic JavaScript is required for expanding text JavaScript is required for the print function  

Returns a count of the number of items in each bin of a histogram, as when plotting a probability density function.

Syntax

y = PDF(v,n)

Arguments

Name

Description

 

v

A real vector of values used in a histogram.

 

n

A positive integer representing the number of bins.

Output

Name

Description

 

y

A vector whose elements are the number of items in each bin of a histogram. Its length equal the number of bins n.

Example

Count the number of integers from 1 to 100 in each of 5 bins.

 

Syntax

 

Y = PDF([1:100],5)

 

Result

 

y =  20  20  20  20  20

Comments

The PDF function returns the y vector for creating a probability density plot, based on the given values and the number of bins. The resultant vector has a number of elements equal to the number of bins. The elements of the result are the number of items in each bin. The bins are created by taking the range (max - min) of the values vector and dividing it into n sections.

See Also:

Bins