Hi, I have a given probability density function, which is
0.001257 *x^4 Exp[-0.285714 *x]
and I need to generate 15 random numbers according to this distribution. Here is what I have done:
dist = ProbabilityDistribution[ 0.001257*x^4 Exp[-0.285714*x], {x, 0, 60}]
Plot[PDF[dist, x], {x, 0, 60}]
sample = RandomVariate[dist, 15]
{5.75881, 4.74259, 6.97658, 5.52833, 7.34263, 6.76362, 4.92664, 2.58222, 4.65696, 6.4487, 7.30355, 7.25276, 7.00075, 4.12756, 4.41973}
Show[Histogram[sample, 100, "ProbabilityDensity"], Plot[PDF[dist, x], {x, 0, 60}, PlotStyle -> PointSize[Medium]]]
I think this is pretty straightforward, and I followed several examples that aim at doing the same, but my results are weird. I get a sequence of 15 numbers between 0 and 8, and I don't understand why. All in all, I think I am not getting right how to generate random variates from a custom distribution in the first place. Would you help me?