I need to compute :
Sum (from n=1 to N) [dgamma(x,n)*(1-dgamma(k,n))]
Sorry for the form I don't managed to do something esthetic.
Have you got an idea ? I have tried this in vain :
% Try 1
N = 100;
S = 0;
for n = 1:N
S = S + (dgamma(x,n)*(1-dgamma(k,n)));
end
% Try 2
N = 100;
syms n m
S = symsum(dgamma(x,n)*(1-dgamma(k,n)),n,1,N);

2 commentaires

Michael Haderlein
Michael Haderlein le 30 Jan 2015
Your question is a bit unclear:
What is dgamma (function or array)? If it's an array, will N be the length of dgamma? What is x and k?
Edwin FOURRIER
Edwin FOURRIER le 1 Fév 2015
Sorry for this, dgamma is the gamma density function of variables x and k (support) and parameter n.

Connectez-vous pour commenter.

 Réponse acceptée

Star Strider
Star Strider le 30 Jan 2015
Modifié(e) : Star Strider le 1 Fév 2015

0 votes

See the documentation on the Gamma Distribution.

2 commentaires

Edwin FOURRIER
Edwin FOURRIER le 4 Fév 2015
Thank you very much. I had never suspected this problem !
Star Strider
Star Strider le 4 Fév 2015
My pleasure!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Startup and Shutdown dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by