how to cope with big numbers out of the capability of matlab
Mostra commenti meno recenti
Dear Fellows,
I would like to calculate the probability mass function for the generalize binomial distribution. Basically I just need to add a extra parameter in the usual pmf function of binomial distribution. I attach the code here.
if true
% n=100;
p=0.5;
x=1:100;
nthetas=1.6 %the value of nthetas is starting from 1
C=x.*(100-x);
pmf_=binopdf(x,100,0.5).*(nthetas.^C); %add the dispense parameter to a usual binomial distribution pmf
z=sum(pmf_); %normalized constant
pmf=pmf_/z;
end
There is no problem when theta is equal to 1.2. But when it gets bigger, for example 1.6 as in the code. The probability gets too big to calculate and ends up as Inf. Do you know how to deal with this problem?
Thanks!
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Univariate Discrete Distributions in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!