Given 2 independent uniform random variables X,Y = U [0,1], consider the random variables Z = g (X,Y) for g (x,y) = sqrt (-2ln(x) ). cos(2piy)..This is the condition.So I need to go for matlab program as the analytic method is tough
1 - 10,000 uniformly distributed random samples for X and Y
2 - For each sample of X and Y, compute Z= g(X,Y)
3 - Draw a histogram over the resulting samples in Z
4 - Estimate the moments mZ for n = 1,2....6.
|
|
0
|
|
|
|
Reply
|
DSPtree
|
5/5/2010 6:37:26 PM |
|
DSPtree <paulscot45@yahoo.com> wrote in message <2024364947.79076.1273099076053.JavaMail.root@gallium.mathforum.org>...
> Given 2 independent uniform random variables X,Y = U [0,1], consider the random variables Z = g (X,Y) for g (x,y) = sqrt (-2ln(x) ). cos(2piy)..This is the condition.So I need to go for matlab program as the analytic method is tough
>
> 1 - 10,000 uniformly distributed random samples for X and Y
> 2 - For each sample of X and Y, compute Z= g(X,Y)
> 3 - Draw a histogram over the resulting samples in Z
> 4 - Estimate the moments mZ for n = 1,2....6.
Surely you have tried something? If not, why not?
John
|
|
0
|
|
|
|
Reply
|
John
|
5/5/2010 11:01:07 PM
|
|
DSPtree wrote:
> Given 2 independent uniform random variables X,Y = U [0,1], consider the random variables Z = g (X,Y) for g (x,y) = sqrt (-2ln(x) ). cos(2piy)..This is the condition.So I need to go for matlab program as the analytic method is tough
>
> 1 - 10,000 uniformly distributed random samples for X and Y
> 2 - For each sample of X and Y, compute Z= g(X,Y)
> 3 - Draw a histogram over the resulting samples in Z
> 4 - Estimate the moments mZ for n = 1,2....6.
Okay, go ahead, we give you permission to write such a program. If you
should happen to come up with a _specific_ Matlab question, then if you
indicate what you are having trouble with, we may be able to assist you.
|
|
0
|
|
|
|
Reply
|
Walter
|
5/5/2010 11:16:49 PM
|
|
clear all;
n=10000;
x=randn(1,n);
y=randn(1,n);
subplot(221);bar(x);subplot(222);bar(y);
z=sqrt(-2*log(x))*cos(2*pi*y');
t=hist(z,100);
subplot(212);plot(t);
This is what i have done till now. But I am not sure whether i could take z like that and plot it.
|
|
0
|
|
|
|
Reply
|
DSPtree
|
5/6/2010 5:54:37 AM
|
|
the plot shows a normal distribution i guess. shall i have to take some arbitary mean and sigma . this output looks little weird.
|
|
0
|
|
|
|
Reply
|
DSPtree
|
5/6/2010 5:59:14 AM
|
|
On 5/6/2010 5:54 AM, DSPtree wrote:
> clear all;
> n=10000;
> x=randn(1,n);
> y=randn(1,n);
> subplot(221);bar(x);subplot(222);bar(y);
> z=sqrt(-2*log(x))*cos(2*pi*y');
> t=hist(z,100);
> subplot(212);plot(t);
Consider the following:
1) "Given 2 independent uniform random variables X,Y"
Check your code, and type "help rand" and "help randn"
2) "For each sample of X and Y, compute Z= g(X,Y)"
Type "help times", and "help mtimes", and then check your code. In
particular, what should the size of z be, and what is it? What does the
transpose on y do (hint: that's why your code does not give you an error
that would help you figure out where you're going wrong)?
3) "Draw a histogram over the resulting samples in Z"
What does "plot(t)" do? It does not create a histogram.
Hope this helps.
|
|
0
|
|
|
|
Reply
|
Peter
|
5/6/2010 1:14:29 PM
|
|
Thank you so much for the help.
x=randn(1,10000);
y=randn(1,10000);
z=sqrt(-2*log(x)).*cos(2*pi*y);
hist(z,100);
I have made it shorter again.But still the shape of 'z' doesn't look familiar. So I guess I still have something wrong with this small program..
Well I m just a starter in matlab. expecting support.
|
|
0
|
|
|
|
Reply
|
DSPtree
|
5/6/2010 4:05:39 PM
|
|
|
6 Replies
408 Views
(page loaded in 0.156 seconds)
Similiar Articles: uniform random variable - comp.soft-sys.matlabGiven 2 independent uniform random variables X,Y = U [0,1], consider the random variables Z = g (X,Y) for g (x,y) = sqrt (-2ln(x) ). cos(2piy)..This i... Generating a uniform random rotation matrix - comp.soft-sys.matlab ...Hi, I'm wondering what is the best way to generate uniform random rotation ... how to generate random number ... Simulation: Drawing one pseudo-random uniform variable ... plot function with 3 variables - comp.soft-sys.matlabuniform random variable - comp.soft-sys.matlab Given 2 independent uniform random variables X,Y = U [0,1 ... cos(2*pi*y'); t=hist(z,100); subplot(212);plot(t ... Statistical calculations on generated variables in simulation ...Generating a uniform random rotation matrix - comp.soft-sys.matlab ... Statistical calculations on generated variables in simulation ... Simulation of correlated normal ... How to generate random number given density function? - comp.soft ...uniform random variable - comp.soft-sys.matlab How to generate random number given density function? - comp.soft ... genrate uniform random variable from a set - comp.soft ... random numbers from beta distribution - comp.soft-sys.matlab ...uniform random variable - comp.soft-sys.matlab random numbers from beta distribution - comp.soft-sys.matlab ... Thus, start with a uniform random number, call it U. Rand ... Generate noise with specific crest factor - comp.dsp> >> >> assuming you have a uniform pseudo-random variable generated by the >> computer, you should be able to pass this through a deterministic >> function to send that ... How to generate vector of random numbers in any interval (e.g. [-1 ...... Wikipedia, the free encyclopedia... of the vector (X 1, …, X n ... in practice used to generate a random variable of arbitrary shape f g(X) ... instance uniform) random ... Pseudorandom Noise Generator.... - comp.lang.vhdl... dsp related question :) I need to generate noise with ... ... But I'd really like to have a generator so I can ... assuming you have a uniform pseudo-random variable ... Monte Carlo speed - Compound Poisson - comp.soft-sys.matlab ...Here we're interested in generating Compound Poisson random variables - that is, random ... Poisson variates should approach the speed with which you can generate uniform ... Uniform distribution (continuous) - Wikipedia, the free encyclopediaHowever, there is an exact method, the Box–Muller transformation, which uses the inverse transform to convert two independent uniform random variables into two ... Uniform distribution (discrete) - Wikipedia, the free encyclopediaAnother way of saying "discrete uniform distribution" would be "a known, finite number of equally spaced outcomes equally likely to happen." If a random variable has any ... 7/13/2012 4:41:09 AM
|