function h = histpd(x, xmin, xmax, nbins)
% Estimate of 1-dimensional probability distribution.

ndata = length(x);
bins = linspace(xmin, xmax, nbins);
binwidth = (xmax - xmin)/nbins;
num = hist(x, bins);
num = num/(ndata*binwidth);
h = bar(bins, num, 0.6);


% "Complex and Chaotic Nonlinear Dynamics. 
% Advances in Economics and Finance, 
% Mathematics and Statistics" 
% T.Vialar, Springer 2009.
% Copyright(c) 