DSPRelated.com
Forums

randn command

Started by Rene Bartar July 4, 2004
This command generates a normaly distributed random
number with zero mean and variance equals to 1. How do
I modify the variance of the command?

thanks
Rene Bartar

__________________________________________________________________________
Acabe com aquelas janelinhas que pulam na sua tela.
AntiPop-up UOL - gris!
http://antipopup.uol.com.br/




You have to do following transformation:
x = sigma*x' + mu;
the new random variable x' will have the required mean and variance.
 
Warm Regards,
Manish
----- Original Message -----
From: Rene Bartar
To: matlab
Sent: Monday, July 05, 2004 2:29 AM
Subject: [matlab] randn command

This command generates a normaly distributed random
number with zero mean and variance equals to 1. How do
I modify the variance of the command?

thanks
Rene Bartar



Multiply it's results by the variance that you want.

--- Rene Bartar <> wrote:
> This command generates a normaly distributed random
> number with zero mean and variance equals to 1. How
> do
> I modify the variance of the command?
>
> thanks
> Rene Bartar
__________________________________________________________________________
> Acabe com aquelas janelinhas que pulam na sua tela.
> AntiPop-up UOL - gris!
> http://antipopup.uol.com.br/ >
>

=====
Juan I. Arvelo, Jr., Ph.D.
Johns Hopkins University
11100 Johns Hopkins Rd.
Laurel, MD 20723
240.228.4293
__________________________________


Rene,
You first run randn()command to obtain the random sequency with zero mean and variance = 1, then multiply this sequence by the square root of the variance, which gives the desired output.

Rene Bartar <r...@bol.com.br> wrote:
This command generates a normaly distributed random
number with zero mean and variance equals to 1. How do
I modify the variance of the command?

thanks
Rene Bartar

__________________________________________________________________________
Acabe com aquelas janelinhas que pulam na sua tela.
AntiPop-up UOL - gris!
http://antipopup.uol.com.br/


_____________________________________
Note: If you do a simple "reply" with your email client, only the author of this message will receive your answer.  You need to do a "reply all" if you want your answer to be distributed to the entire group.

_____________________________________
About this discussion group:

To Join:  m...@yahoogroups.com

To Post:  m...@yahoogroups.com

To Leave: m...@yahoogroups.com

Archives: http://www.yahoogroups.com/group/matlab

More DSP-Related Groups: http://www.dsprelated.com/groups.php3



A small correction, the result of the randn command should be multiplied by
the square root of the desired variance (i.e. multiply with the standard
deviation).
-Deepak

-
To know that we know what we know, and that we do not know what we do not
know, that is true knowledge.

- Confucius (551-479 B.C.).
-
----- Original Message -----
From: "Juan I. Arvelo, Jr., Ph.D." <>
To: "Rene Bartar" <>; "matlab" <>
Sent: Monday, July 05, 2004 8:05 PM
Subject: Re: [matlab] randn command > Multiply it's results by the variance that you want.
>
> --- Rene Bartar <> wrote:
> > This command generates a normaly distributed random
> > number with zero mean and variance equals to 1. How
> > do
> > I modify the variance of the command?
> >
> > thanks
> > Rene Bartar
> >
> >
> __________________________________________________________________________
> > Acabe com aquelas janelinhas que pulam na sua tela.
> > AntiPop-up UOL - gris!
> > http://antipopup.uol.com.br/
> >
> >
> >
> >
>
> =====
> Juan I. Arvelo, Jr., Ph.D.
> Johns Hopkins University
> 11100 Johns Hopkins Rd.
> Laurel, MD 20723
> 240.228.4293 >
> __________________________________ >
>
> _____________________________________
> Note: If you do a simple "reply" with your email client, only the author
of this message will receive your answer. You need to do a "reply all" if
you want your answer to be distributed to the entire group.
>
> _____________________________________
> About this discussion group:
>
> To Join:
>
> To Post:
>
> To Leave:
>
> Archives: http://www.yahoogroups.com/group/matlab
>
> More DSP-Related Groups: http://www.dsprelated.com/groups.php3
> Yahoo! Groups Links