Definite Sum of density functions

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 Comments

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?
Sorry for this, dgamma is the gamma density function of variables x and k (support) and parameter n.

Sign in to comment.

 Accepted Answer

Star Strider
Star Strider on 30 Jan 2015
Edited: Star Strider on 1 Feb 2015
See the documentation on the Gamma Distribution.

2 Comments

Thank you very much. I had never suspected this problem !
My pleasure!

Sign in to comment.

More Answers (0)

Categories

Community Treasure Hunt

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

Start Hunting!