Why is my generated weibull distribution generating only NaN numbers?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Gabs
el 23 de Sept. de 2015
Respondida: the cyclist
el 23 de Sept. de 2015
I am fitting a Weibull distribution to a set of data "x" (10000 x 1). I want the distribution to have the same size. I am trying the following code
XLim = get(gca,'XLim');
XLim = XLim + [-1 1] * 0.01 * diff(XLim);
XGrid = linspace(XLim(1),XLim(2),10000);
f_Weibull = fitdist(x, 'weibull');
f = pdf(f_Weibull,XGrid)';
However, somehow my PDF ends up being only NaN numbers, how can I solve this?
P.S.: using R2013a
0 comentarios
Respuesta aceptada
the cyclist
el 23 de Sept. de 2015
This code ran just fine for me, in 2015b:
rng 'default'
x = wblrnd(1.5,1.3,10000,1);
XLim = get(gca,'XLim');
XLim = XLim + [-1 1] * 0.01 * diff(XLim);
XGrid = linspace(XLim(1),XLim(2),10000);
f_Weibull = fitdist(x, 'weibull');
f = pdf(f_Weibull,XGrid)'
figure
histogram(f)
How does it look for you?
0 comentarios
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!