# Error using fitdist. Distribution name 'multinomial' is unrecognized.

7 vues (au cours des 30 derniers jours)
Matlab2010 le 19 Fév 2016
I am using 2015b. I read http://uk.mathworks.com/help/stats/fitdist.html and see that it supports "multinomial"
I run
pd = makedist('Multinomial','probabilities',[1/2 1/3 1/6])
pd =
MultinomialDistribution
Probabilities:
0.5 0.33333 0.16667
Then I run
fitdist([1 10]','normal')
ans =
NormalDistribution
Normal distribution
mu = 5.5 [-51.6779, 62.6779]
sigma = 6.36396 [2.83928, 203.075]
Then I try and run
fitdist([1 10]','multinomial')
Error using fitdist (line 146)
Distribution name 'multinomial' is unrecognized.
##### 1 commentaireAfficher -1 commentaires plus anciensMasquer -1 commentaires plus anciens
Matlab2010 le 19 Fév 2016
Modifié(e) : Matlab2010 le 19 Fév 2016
Possible work around
function ksd = fitdist2(data)
data(isnan(data)) = [];
u = unique(data);
h = histcounts(data,u);
pd = makedist('Multinomial','probabilities',h./sum(h));
ksd.pd = pd;
ksd.u = u;
%sample: ksd.u(ksd.pd.random)
end

Connectez-vous pour commenter.

### Réponses (1)

the cyclist le 19 Fév 2016
I believe that this may be a documentation error. If you actually look inside the fitdist function, using
edit fitdist
you'll see that 'Multinomial' is not in the list of supported distributions. (But 'Kernel' is not there either, and actually does work.)
Weird. You might want to report to support@mathworks.
##### 0 commentairesAfficher -2 commentaires plus anciensMasquer -2 commentaires plus anciens

Connectez-vous pour commenter.

### Catégories

En savoir plus sur Multinomial Distribution dans Help Center et File Exchange

### Community Treasure Hunt

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

Start Hunting!