Gaussian distribution.HELP!

Status
Not open for further replies.

malaylah

Junior Member level 1
Joined
Feb 27, 2005
Messages
19
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,452
I am using matlab to generate a set of gaussian distribution values, where mean is zero and variance is 1. If I want to change my varian to 0.5, what should I do? is it just multiply the output with o.5?

for variance = 1,

k=randn(1,5);

for variance = 0.5,

k=0.5*randn(1,5);

Am I right?
 

Here you'll find a good description of Gaussian or Normal distribution:
h**p://en.wikipedia.org/wiki/Normal_distribution

Other way of writing the formula:



According to that description your suggestion k=0.5*rand(1.5) is not right.
If you change the standard deviation (variance=standard_deviation^2) then
you must recalculate the formula again. By the way Excel has a function for
Gaussian or Normal distribution: NORMDIST. So you can also try it.
 

The relation between random variable X follows normal dist with any µ and σ and the random variable Z that follows normal dist with mean =0 and std dev = 1 is

Z= (X-µ)/σ

in other words X = σZ+ µ

Accordingly u have to multiply by the std dev (NOT variance)

so the correct answer is
for variance = 0.5,

k=sqrt(0.5)*randn(1,5);
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…