Arun, f= a*f1+b*f2, ya, u guessed right! f1 na df2 have noramla distribution , but not different means and variances, and now i wanna generate a random variable with pdf of f. This is the question i asked initially! Regards, -SaiRamesh. --- wrote: > Hi Sai > A few clarifications: > Please see the 2 paras below: > 1. > >i.e. f= a*f1+b*f2; > > >where f is the pdf of the noise signal. > > >f1 and f2 are gaussian pdfs with mean 0 and > > variance > > >=1, a and b are some constants>0, > > >Now i want to generate a random variable in > matlab > > >whose pdf is f(=a*f1+b*f2). > > 2.In similar way, i want to write a function which > generates a random varibale with the desired pdf > (f_desired= a*f1+b*f2, where f1 and f2 are the given > pdfs not random numbers). > > There is some discrepancy here. Since the mean of > the two pdfs are same and variance is also same, the > only way you can have f(x) = a1*f1(x)+a2*f2(x), > where f1(x) and f2(x) are normally distributed, is > that a2+a1 =1. In other words, since both components > have same variance and mean, the resultant should be > a a normal distribution. Hence, this is a trivial > case. > > In other words, if f1(x) = > 1/sqrt(2*pi*sigma1^2)*exp(-(x-mu1)^2/(2*sigma1^2)) > and > f2(x)=1/sqrt(2*pi*sigma2^2)*exp(-(x-mu2)^2/(2*sigma2^2)), > where mu1!=mu2 and/or variances are different, the > pdf f(x)*f1(x)+a2*f2(x) should be such that total > area under the composite curve should be 1. If this > is what you are referring to, then I don't know how > to simulate the pdf for such a case(when mu1!=mu2 > and/or sigma1 != sigma2) > > regards > arun > > -----Original Message----- > From: arun d naik (WT01 - EMBEDDED & PRODUCT > ENGINEERING SOLUTIONS) > Sent: Tue 10/26/2004 16:05 > To: nammi sairamesh; tArAng > Cc: ; > Subject: RE: RE: [matlab] random variable of > desired pdf > Sai > I think had understood your requirements. > I vaguely remember that the convolution of two > guassian functions is also a guassian(but I am not > confirming this; please refer to papoulis's book). > If the two rvs are independent, the variance of the > sum of 2 rvs is given by sum of variances. hence in > your case var = a1^2*sigma1+a2^2*sigma2. > If the facts in the above 2 paras are true it can > help you to make use of randn in your case. > Hope I understood your requirements correctly and > this helps you. > regadrs > arun > -----Original Message----- > From: nammi sairamesh > [mailto:] > Sent: Mon 10/25/2004 22:04 > To: tArAng; arun d naik (WT01 - EMBEDDED & PRODUCT > ENGINEERING SOLUTIONS) > Cc: ; > Subject: Re: RE: [matlab] random variable of > desired pdf > Hi, > Thanks for your responses.! But I guess, u > misunderstood my problem! > My problem is to generate a random variable whose > is given! not the other way! > for example: we know normal distribution so with > randn > we can generate a random variable with normal > distribution! > In similar way, i want to write a function which > generates a random varibale with the desired pdf > (f_desired= a*f1+b*f2, where f1 and f2 are the > given > pdfs not random numbers). > I hope now u understood the actual problem! > Regards, > -SaiRamesh. > --- tArAng <> wrote: > > > Arun, Sairamesh, > > > > I think Arun you are correct. The resultant pdf > will > > be Gaussian by Central Limit Theorum. > > > > I think what Sairamesh is doing is adding two > > Gaussian Random Variables with different > variances ( > > var1 = a^2 and var2 = b^2). > > Correct me if I am wrong. > > > > > > Tarang > > > > > > On Mon, 25 Oct 2004 wrote : > > >Hi > > >Are the 2 rvs are independent? I assume you are > > generating a new rv by > > >linear combination of the 2 rvs. > > >When pdf of 2 independent rvs are added, the > > resultant pdf is > > >convolution of the 2 pdfs. Hence, you should be > > able to calculate closed > > >form of the resultant pdf. I guess(I may be > wrong) > > that the resultant > > >pdf also may be a guassian rv. > > >Regards > > >arun > > >-----Original Message----- > > > From: nammi sairamesh > > [mailto:] > > >Sent: Saturday, October 23, 2004 8:29 AM > > >To: > > >Subject: [matlab] random variable of desired > > >Hi, > > > I am modelling a wireless channel, I want > to > > >model the channel as mixture of two guassians > which > > is > > >suitable for my applications. > > >i.e. f= a*f1+b*f2; > > >where f is the pdf of the noise signal. > > >f1 and f2 are gaussian pdfs with mean 0 and > > variance > > >=1, a and b are some constants>0, > > >Now i want to generate a random variable in > matlab > > >whose pdf is f(=a*f1+b*f2). > > >But how to genearte a random variable with pdf > of > > f. > > >Help in this regard is highly appreciated. > > >Regards, > > >-SaiRamesh. > > > > > >_______________________________ > > > > > >_____________________________________ > > >Note: If you do a simple "reply" with your > > 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 > > >_____________________________________ > > >Note: If you do a simple "reply" with your > > 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: > === message truncated === __________________________________ |