6.5 Fitting a Distribution to Data - Histfit, Probplot
One of the functions introduced in this video is histfit, which has the following syntax:
histfit(data, nbins, dist).
At 1:11 - 1:42, I write histfit(x, 20, 'exponential'). The rationale for using 20 bins is that by default, the number of bins is the square root of the number of elements in x, rounded up. Since we simulate 400 observations, bins is a natural choice.
To allow histfit to automatically determine the number of bins we can use the default argument, [], for the number of bins:
histfit(x, [], 'exponential')