How to code a function of the Probability mass function of the Poisson binomial distribution
조회 수: 2 (최근 30일)
이전 댓글 표시
Hello,
I want to use a function that computes the Probability mass function of the Poisson binomial distribution \Pr(K=k)=\sum \limits {{A\in F{k}}}\prod \limits {{i\in A}}p{i}\prod \limits {{j\in A^{c}}}(1-p{j}) https://en.wikipedia.org/wiki/Poisson_binomial_distribution
But how do I implement this sum over subsets of {1,..,n} that contain k elements
Thank you, Daniel
댓글 수: 0
채택된 답변
Peng Liu
2016년 10월 6일
You may use nchoosek. F_k is nothing but a k-element subset of {1,2,3,...,n}. The sum is over all possible F_k, which can be generated using F_k = nchoosek(1:n,k) (where each row of F_k is a k-element subset)
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!