Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Probability of N trials

Subject: Probability of N trials

From: Theresa

Date: 2 Jun, 2011 20:46:05

Message: 1 of 7

Hello, I have a question about plotting this type of probability function:
          N (N
P_FA= ∑ n) ((P_fa)^n) * (1 - P_fa )^(N-n)
         n=M
                                                           (N
I know it's a little difficult to read, but the n) is supposed to be like a binomial pdf and I need to plot the probability of the function.

Does anyone know how I would go about coding this into Matlab? Any help would be greatly appreciated! Thanks!

Subject: Probability of N trials

From: Roger Stafford

Date: 2 Jun, 2011 21:21:04

Message: 2 of 7

"Theresa" wrote in message <is8sqc$n6f$1@newscl01ah.mathworks.com>...
> Hello, I have a question about plotting this type of probability function:
> N (N
> P_FA= ∑ n) ((P_fa)^n) * (1 - P_fa )^(N-n)
> n=M
> (N
> I know it's a little difficult to read, but the n) is supposed to be like a binomial pdf and I need to plot the probability of the function.
>
> Does anyone know how I would go about coding this into Matlab? Any help would be greatly appreciated! Thanks!
- - - - - - - - -
  What variable are you plotting this against? Is it M? If so, you need to do a backwards 'cumsum' on these terms.

Roger Stafford

Subject: Probability of N trials

From: Theresa

Date: 2 Jun, 2011 22:10:05

Message: 3 of 7

Hi Roger,

I'm actually plotting it against a similar function:

         N (N
P_D= ∑ n) ((P_d)^n) * (1 - P_d )^(N-n)
       n=M

Let me know if that changes what I should do. Thanks for the help!

> - - - - - - - - -
> What variable are you plotting this against? Is it M? If so, you need to do a backwards 'cumsum' on these terms.
>
> Roger Stafford

Subject: Probability of N trials

From: Roger Stafford

Date: 2 Jun, 2011 23:25:20

Message: 4 of 7

"Theresa" wrote in message <is91nt$7a4$1@newscl01ah.mathworks.com>...
> Hi Roger,
>
> I'm actually plotting it against a similar function:
>
> N (N
> P_D= ∑ n) ((P_d)^n) * (1 - P_d )^(N-n)
> n=M
>
> Let me know if that changes what I should do. Thanks for the help!
- - - - - - - - - -
  What I need to know is, what quantity in your expression is it that varies so as to make it a multi-valued expression? Is it the lower summation limit M, the value N, or the quantity 'P_fa' (hopefully not more than one of these)?

Roger Stafford

Subject: Probability of N trials

From: Theresa

Date: 3 Jun, 2011 16:31:05

Message: 5 of 7

Sorry about that! I'm plotting it for N=8 and M=3,4,5, and 6 when P_FA = 1 x 10^-6
Let me know if that was the right information. Thanks again so much!

> - - - - - - - - - -
> What I need to know is, what quantity in your expression is it that varies so as to make it a multi-valued expression? Is it the lower summation limit M, the value N, or the quantity 'P_fa' (hopefully not more than one of these)?
>
> Roger Stafford

Subject: Probability of N trials

From: Roger Stafford

Date: 3 Jun, 2011 19:09:03

Message: 6 of 7

"Theresa" wrote in message <isb289$o6t$1@newscl01ah.mathworks.com>...
> Sorry about that! I'm plotting it for N=8 and M=3,4,5, and 6 when P_FA = 1 x 10^-6
> Let me know if that was the right information. Thanks again so much!
- - - - - - - - - -
  The easiest solution (though possibly not the fastest) is to use 'binocdf' in the Statistics Toolbox:

 P_FA = binocdf(N-M,N,1-P_fa);

You can make M a vector in this call, as with your M = [3 4 5 6]. Actually any of binocdf's parameters may be an array of values if they are all the same size. See the documentation at:

 http://www.mathworks.com/help/toolbox/stats/binocdf.html

Roger Stafford

Subject: Probability of N trials

From: Theresa

Date: 3 Jun, 2011 19:48:05

Message: 7 of 7

Ok, I'll try that out! Thanks again, Roger! I appreciate it.

> - - - - - - - - - -
> The easiest solution (though possibly not the fastest) is to use 'binocdf' in the Statistics Toolbox:
>
> P_FA = binocdf(N-M,N,1-P_fa);
>
> You can make M a vector in this call, as with your M = [3 4 5 6]. Actually any of binocdf's parameters may be an array of values if they are all the same size. See the documentation at:
>
> http://www.mathworks.com/help/toolbox/stats/binocdf.html
>
> Roger Stafford

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us