How to use binomial expansion to produce correct results?
Show older comments
Hi, I'm working on numerical problems where I need to calculate the cumulative distribution function values using summation. Furthermore, my code utilizes binomial expansion like the following
I wrote a function to compute CDF values using bionomial expansion
function results = sum_testing(mu,z,n)
for i = 1:n+1
t= nchoosek(n,i-1);
results(i) = t.*(-1).^((n-i+1)).*exp(-u*(z).*(n-i+1))
end
My problem is that, for large n's (n>100), the CDF values are very large (1e+60). How can I modify the above code to produce accurate results (using bionomial expansion)?
3 Comments
Torsten
on 3 Mar 2023
Why do you compute each single summand of this series ?
Muna Tageldin
on 3 Mar 2023
Accepted Answer
More Answers (0)
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!