Borrar filtros
Borrar filtros

Evaluate a distribution programmatically

4 visualizaciones (últimos 30 días)
ryan muddiman
ryan muddiman el 29 de Sept. de 2018
Respondida: Star Strider el 29 de Sept. de 2018
In the distribution fitter app there is an option to evaluate a fitted distribution for a range of values. I would like to know how to do this programmatically? I can use fitdist to fit the data easily but dont know how to evaluate the probability.

Respuesta aceptada

Star Strider
Star Strider el 29 de Sept. de 2018
The fitdist (link) function will fit a distribution to data, producing a probability distribution object:
pd = fitdist(x,distname)
You can then calculate the probabilities with it using the Plot Standard Normal Distribution cdf (link) or Plot the pdf of a Standard Normal Distribution (link) functions:
data = 5 + 2*randn(1, 100); % Create Data
pd = fitdist(data(:), 'Normal');
x = linspace(-2, 12);
Npdf = pdf(pd, x);
Ncdf = cdf(pd, x);
figure
plot(x, Npdf, x, Ncdf)
grid

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by