Triangular distribution created using makedist function is the input argument for the random function to create data to use to create a histogram. The minimum and mode values of the histogram are equal. Is this result to be expected??

2 visualizaciones (últimos 30 días)
I created a triangular distribution "pd" using the makedist function. The parameters of the triangular pd function are as follows: minimum value = 6, most likely value = 9, maximum value = 20, and n = 200. Then I use the random function with the triangular pd the input argument; i.e., random(myTriangularDist,N,1) to create the data to display in a histogram. Then I use the histogram function to create a histogram of the data. The minimum and the mode of the distribution displayed in the histogram is consistently exactly the same (to 4 decimal places). The result is the same if I change n to 5000. Is this result normal? Also, the median does not approach my most likely value of 9 after I increase n from 200 to 5000. The median remains approximately 11. Is it normal for the median not to approach 9 initially specified as the "most likely value" as n is increased? I would appreciate any comments.

Respuesta aceptada

John
John el 2 de Nov. de 2016
Editada: John el 2 de Nov. de 2016
I used the round function to round each of the the numbers in my random number vector to the nearest integer. Now I am getting completely different results. The minimum, mode, median, mean, and maximum values for the distribution displayed in the histogram are now much closer to results one would expect from the input parameters used to create the triangular distribution pd.

Más respuestas (0)

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by