bins
Creates bins for the probability density function, pdf.
Syntax
bins(vec_expr, num_bins)
Argument
- vec_expr
- The vector which is being used to create the bins.
- num_bins
- The number of bins, or intervals, to create.
Example
Curve Math Vectors | Result |
---|---|
x = bins(c1.y, 10)
|
Given c1, a curve is created which is the probability density curve of c1. |
Comments
The bins function returns the x 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 midpoints of each bin.
The bins are created by taking the range (max - min) of the values vector and dividing it into num_bins sections. The upper boundary of each bin is also the lower boundary for the next bin. The lower boundary for the first bin is the minimum value of the range. The final upper boundary is the maximum value of the range.