COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### geometric distribution #2

• Follow

```U may right wayne i still need ur help ... p(1 - p)^[m-1]  how to put in matlab i am news in the matlab
i try to calculate a throughput using this model lapid (discarding technique).
```
 0

```"amri " <amri9897@gmail.com> wrote in message <hjgs96\$1n\$1@fred.mathworks.com>...
> U may right wayne i still need ur help ... p(1 - p)^[m-1]  how to put in matlab i am news in the matlab
> i try to calculate a throughput using this model lapid (discarding technique).

Hi Amri, if you have the Statistics Toolbox, there are a number of utilities for generating data that follow a geometric distribution (georand() ) and finding all the necessary quantities related to the geometric distribution (geocdf, geopdf,geoinv).

If not, then you can calculate the geometric pmf and cdfs easily for yourself. It depends on how you define the random variable, X. If X is the number of "failures" before a "success" then

x = 0:10;  %just an example
p = 0.5; % this is the only parameter
y = p.*(1-p).^x; % PMF
% The CDF is
F = 1-(1-p).^(x+1);

If you define the random variable, X,  as the trial on which the 1st success occurs:

x = 1:10;  %just an example
p = 0.5;
y = p.*(1-p).^(x-1);
% CDF
F = 1-(1-p).^x;

Hope that helps,
Wayne
```
 0

```Hi wayne following i was tried that code. It is right

clc;clear;
p = 0.5; % this is the only parameter
for x = 0:10; %just an example
y = p.*(1-p).^x; % PMF
end
% The CDF is
F = 1-(1-p).^(x+1)

"Wayne King" <wmkingty@gmail.com> wrote in message <hjhccq\$69h\$1@fred.mathworks.com>...
> "amri " <amri9897@gmail.com> wrote in message <hjgs96\$1n\$1@fred.mathworks.com>...
> > U may right wayne i still need ur help ... p(1 - p)^[m-1]  how to put in matlab i am news in the matlab
> > i try to calculate a throughput using this model lapid (discarding technique).
>
> Hi Amri, if you have the Statistics Toolbox, there are a number of utilities for generating data that follow a geometric distribution (georand() ) and finding all the necessary quantities related to the geometric distribution (geocdf, geopdf,geoinv).
>
> If not, then you can calculate the geometric pmf and cdfs easily for yourself. It depends on how you define the random variable, X. If X is the number of "failures" before a "success" then
>
> x = 0:10;  %just an example
> p = 0.5; % this is the only parameter
> y = p.*(1-p).^x; % PMF
> % The CDF is
> F = 1-(1-p).^(x+1);
>
> If you define the random variable, X,  as the trial on which the 1st success occurs:
>
> x = 1:10;  %just an example
> p = 0.5;
> y = p.*(1-p).^(x-1);
> % CDF
> F = 1-(1-p).^x;
>
> Hope that helps,
> Wayne
```
 0

```"amri " <amri9897@gmail.com> wrote in message <hjl9c7\$l2q\$1@fred.mathworks.com>...
> Hi wayne following i was tried that code. It is right
>
> clc;clear;
> p = 0.5; % this is the only parameter
> for x = 0:10; %just an example
>     y = p.*(1-p).^x; % PMF
> end
> % The CDF is
> F = 1-(1-p).^(x+1)
>
>
>
> "Wayne King" <wmkingty@gmail.com> wrote in message <hjhccq\$69h\$1@fred.mathworks.com>...
> > "amri " <amri9897@gmail.com> wrote in message <hjgs96\$1n\$1@fred.mathworks.com>...
> > > U may right wayne i still need ur help ... p(1 - p)^[m-1]  how to put in matlab i am news in the matlab
> > > i try to calculate a throughput using this model lapid (discarding technique).
> >
> > Hi Amri, if you have the Statistics Toolbox, there are a number of utilities for generating data that follow a geometric distribution (georand() ) and finding all the necessary quantities related to the geometric distribution (geocdf, geopdf,geoinv).
> >
> > If not, then you can calculate the geometric pmf and cdfs easily for yourself. It depends on how you define the random variable, X. If X is the number of "failures" before a "success" then
> >
> > x = 0:10;  %just an example
> > p = 0.5; % this is the only parameter
> > y = p.*(1-p).^x; % PMF
> > % The CDF is
> > F = 1-(1-p).^(x+1);
> >
> > If you define the random variable, X,  as the trial on which the 1st success occurs:
> >
> > x = 1:10;  %just an example
> > p = 0.5;
> > y = p.*(1-p).^(x-1);
> > % CDF
> > F = 1-(1-p).^x;
> >
> > Hope that helps,
> > Wayne

Hi Amri, you don't need a for loop. You can just copy and paste the code I gave you.
Wayne
```
 0

3 Replies
438 Views

Similiar Articles:

7/23/2012 6:52:22 AM