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:
pdf of nakagami m-distribution

Subject: pdf of nakagami m-distribution

From: Jiana

Date: 14 Nov, 2012 14:13:09

Message: 1 of 5

please I need a help in writing a code for pdf of nakagami m-distribution in its theoretically and in a simulation way ...and if it is possible to derive it from Rayleigh distribution.



I wrote this code for the theoretical pdf that i took it from Wikipedia
http://en.wikipedia.org/wiki/Nakagami-m_distribution

clear all
close all
%nakagami
x=0:0.01:7;
m=1;
shape=1;
f1=2*(m^m)*(x.^(2*m-1));
x2=round(m);
f2=(factorial(x2-1))*(shape^m);
f3=-(m/shape)*(x.^2);
pdf_theoretical=f1*f2.*exp(f3);
plot(x,pdf_theoretical)

I had good results but i want to compare it by a simulated one that I didn't know how to write it.
thanks in advance.

 

Subject: pdf of nakagami m-distribution

From: Torsten

Date: 14 Nov, 2012 14:34:12

Message: 2 of 5

"Jiana" wrote in message <k808tl$85q$1@newscl01ah.mathworks.com>...
> please I need a help in writing a code for pdf of nakagami m-distribution in its theoretically and in a simulation way ...and if it is possible to derive it from Rayleigh distribution.
>
>
>
> I wrote this code for the theoretical pdf that i took it from Wikipedia
> http://en.wikipedia.org/wiki/Nakagami-m_distribution
>
> clear all
> close all
> %nakagami
> x=0:0.01:7;
> m=1;
> shape=1;
> f1=2*(m^m)*(x.^(2*m-1));
> x2=round(m);
> f2=(factorial(x2-1))*(shape^m);
> f3=-(m/shape)*(x.^2);
> pdf_theoretical=f1*f2.*exp(f3);
> plot(x,pdf_theoretical)
>
> I had good results but i want to compare it by a simulated one that I didn't know how to write it.
> thanks in advance.
>
>

As the Wikipedia article says, you will have to generate random numbers of a
Gamma distribution Gamma(k,theta) with k=m and theta=shape/m.
Then the square roots of these random numbers follow a
Nakagami-m-distribution.

help gamrnd

Best wishes
Torsten.

Subject: pdf of nakagami m-distribution

From: Steven_Lord

Date: 14 Nov, 2012 14:38:24

Message: 3 of 5



"Jiana " <jiana087@yahoo.com> wrote in message
news:k808tl$85q$1@newscl01ah.mathworks.com...
> please I need a help in writing a code for pdf of nakagami m-distribution
> in its theoretically and in a simulation way ...and if it is possible to
> derive it from Rayleigh distribution.

If you're not doing this as part of a class assignment, and you have
Statistics Toolbox, consider using the functions for that distribution from
that toolbox instead of creating your own.

http://www.mathworks.com/help/stats/nakagami-distribution-1.html

If you are doing this as part of a class assignment, and you have Statistics
Toolbox, use those functions to check your work.

*snip*

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Subject: pdf of nakagami m-distribution

From: Jiana

Date: 14 Nov, 2012 14:54:20

Message: 4 of 5

"Torsten" wrote in message <k80a54$d5g$1@newscl01ah.mathworks.com>...
> "Jiana" wrote in message <k808tl$85q$1@newscl01ah.mathworks.com>...
> > please I need a help in writing a code for pdf of nakagami m-distribution in its theoretically and in a simulation way ...and if it is possible to derive it from Rayleigh distribution.
> >
> >
> >
> > I wrote this code for the theoretical pdf that i took it from Wikipedia
> > http://en.wikipedia.org/wiki/Nakagami-m_distribution
> >
> > clear all
> > close all
> > %nakagami
> > x=0:0.01:7;
> > m=1;
> > shape=1;
> > f1=2*(m^m)*(x.^(2*m-1));
> > x2=round(m);
> > f2=(factorial(x2-1))*(shape^m);
> > f3=-(m/shape)*(x.^2);
> > pdf_theoretical=f1*f2.*exp(f3);
> > plot(x,pdf_theoretical)
> >
> > I had good results but i want to compare it by a simulated one that I didn't know how to write it.
> > thanks in advance.
> >
> >
>
> As the Wikipedia article says, you will have to generate random numbers of a
> Gamma distribution Gamma(k,theta) with k=m and theta=shape/m.
> Then the square roots of these random numbers follow a
> Nakagami-m-distribution.
>
> help gamrnd
>
> Best wishes
> Torsten.



Thanks for your reply , I'll try this way also
but I think if I did like that I think it'd be like theoretical , I'd a simulation like generating random variables with nakagami distribution and computing the pdf for it , I kno that I can derive it from Rayleigh when m=1 but I couldn't have it .

Subject: pdf of nakagami m-distribution

From: vimal

Date: 17 Sep, 2013 04:38:06

Message: 5 of 5

you suppose to divide f2 instead of multiplying


"Jiana" wrote in message <k808tl$85q$1@newscl01ah.mathworks.com>...
> please I need a help in writing a code for pdf of nakagami m-distribution in its theoretically and in a simulation way ...and if it is possible to derive it from Rayleigh distribution.
>
>
>
> I wrote this code for the theoretical pdf that i took it from Wikipedia
> http://en.wikipedia.org/wiki/Nakagami-m_distribution
>
> clear all
> close all
> %nakagami
> x=0:0.01:7;
> m=1;
> shape=1;
> f1=2*(m^m)*(x.^(2*m-1));
> x2=round(m);
> f2=(factorial(x2-1))*(shape^m);
> f3=-(m/shape)*(x.^2);
> pdf_theoretical=f1*f2.*exp(f3);
> plot(x,pdf_theoretical)
>
> I had good results but i want to compare it by a simulated one that I didn't know how to write it.
> thanks in advance.
>
>

Tags for this Thread

No tags are associated with 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