Link to home
Start Free TrialLog in
Avatar of michael306
michael306

asked on

Matlab-Guassian Function

Hello Experts,
   I have a random data been generated and i would like to know any sites which explain built in functions of Matlab to read my randomly generated data (rand) for one pattern and obtain similar patterns using Guassian Function.Any Help is greatly appreciated.
Thanks
Michael
Avatar of tigerjade
tigerjade

In matlab, there is a function called "randn" which generated random number following Guassian distribution.

Don't know if this answers your question.
Not sure if this will directly apply, but here is a link to the random number chapter in the Matlab text book that I learned from:

http://www.mathworks.com/moler/random.pdf

On a side note, Cleve Moler wrote this book, and taught my class. If you don't know, he is the founder of Matlab.

-Brian
Avatar of michael306

ASKER

Hi expert Brian,
   It was great site, but i already have a randomly generated data as mentioned and would like to generate rest of the patterns by applying normal distribution to the first data and get 10 more similar patterns based on mean, std values.I hope it makes sense.
Michael
How about if you try to compute the mean and variance of your data and take them as the parameters for the new Gaussian random numbers? Gaussian distribution are fully determined by mean and variance. If you data size is large enough, the empirical mean and variance should be quite accurate.

-tj
Hey Tj,
    I could have done that, but mine is a raw data.Also its quite big.I can send you the data or can u show me some examples on how we apply guassian at each point for a given wave.
Thanks
Best Regard's
michael
Hi, mike:
   I'm not quite sure if I grasped your idea.
   suppose you have a group of data saved in an array called x.
   Then x is a implementation of a random process. But we can asume that x is stationary, and are composed of i.i.d random variable.
   we can use mu=mean(x) in matlab to compute the mean value of x (approximately). And sigma2 = var(x) to compute the variance. Then using y = sqrt(sigma2) * randn(size(x)) + mu. We can generate a random vector, y, which has the same length, mean and variance of x. At the same time, y follows Gaussian distribution.
   However, if there is some deterministic signal in x, you may have to first figure out the deterministic component in x and then substract it from x.
   
   Is the generate y you wanted? Or you want something else?

-tj
Hello Tj,
   You were very close to what i was asking.Let me make it simple for eg:
.150     .150     .250     .425     .250     .3     .6     .475     .325     .250     .225     .275     .2     .775     .775     .3    
.175     .2     .275     .475     .275     .325     .625     .525     .350     .275     .175     .225     .750     .750     .325     .225  
.2     .175     .325     .525     .3     .325     .650     .475     .375     .4     .225     .250     .725     .725     .250     .225    
.250     .150     .350     .550     .325     .275     .6     .525     .425     .225     .175     .250     .7     .7     .225     .175        

As you can see from .150 to .3 first row has 4 different classes and each class has 4 attributes or characteristics. Now we have to apply guassian at each point, that to vertically .150, .175, .2, .250 .And try to generate similar patterns.
I hope it makes sense.
Thanks
Michael














 

Hi, Mike:
   I looked at the data and felt that they are multiples of 0.025. So, it's more like that these data are generated using randint and multiplied by 0.025 (a function in communication toolbox) than simply rand or randn functions.
   I don't think it is closely related to Guassian, because , as you know, Gaussian variable should be defined as any real number instead of just discrete integers. The possible values of Gaussian random variable are from minus infinity to positive infinity. This is also not your case.
   Just FYI, you can also go to www.matlab.com and search randint to find its help file.
-tj
Hi tj,
   well i did not realize that there was so much information to be checked(data) before working on problem.Any suggestions on getting guassian data for 4 different patterns.Mean while i will go thru the site.I do not have access to communication tool box too.
Regard's
michael
Hi, mike:
   Actually, you can implement randint by your own with available function, just like following way:
   x = rand(1,1) % generate a number between 0 and 1.
   x = x .* 10;  % suppose we want to generate random integer between 0 to 10.
   x = round(x); % round x to the closet integer.

   Though this way, x follows uniform distribution. If you substite rand by randn, x then follows some modified version of Gaussin distribution.
   However, you can use hist command to view the histogram of your data. If they follows Guassian distribution, the shape should be quite close to a bell. However, I tried your 4 groups of data. Obviously, they are not. (You can use a randn to generate some data and compare the histograms).

-tj
Hi tj,
  As you have seen the data, the idea was to have four different shapes and also to exactly know what would be those points each time i generated them.I tried as you mentioned rand it is working good but i need to capture the points indivually say y1, y2, y3..etc and plot each of y1 with y2, y1 with y3 etc which i am unable to get it thru rand.
Can you generate four different patterns on the same lines of the data above, which follows guassian distribution at each point to.
Regard's
michael
ASKER CERTIFIED SOLUTION
Avatar of tigerjade
tigerjade

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
michael306:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.