Proof of ratio distribution normal and uniform

Click For Summary

Homework Help Overview

The discussion revolves around finding the distribution of the random variable Z, defined as the ratio of a standard normal variable X to a uniform variable Y over the interval [0,1]. Participants explore the cumulative distribution function and its derivation, referencing the concept of the slash distribution without providing a proof.

Discussion Character

  • Exploratory, Mathematical reasoning, Assumption checking

Approaches and Questions Raised

  • Participants discuss various integral formulations for the cumulative distribution function of Z, questioning the correct setup and boundaries. There are attempts to clarify the notation used for Z and t, along with discussions on the independence of X and Y. Some participants express confusion about the derivation process and the implications of interchanging integrals and derivatives.

Discussion Status

The conversation is ongoing, with participants providing insights and corrections to each other's approaches. Some guidance has been offered regarding the proper setup of integrals and the importance of the order of operations in differentiation, but no consensus has been reached on the final form of the distribution.

Contextual Notes

There are mentions of limitations in language comprehension among participants, which may affect the clarity of the discussion. Additionally, the assignment constraints specify that the distribution function must be derived without external references or solutions.

  • #31
That might be overkill: I'd try -100 to 100 first with say 0.1 increment and then increase it slowly to see if the both retain the same shape.

You know that if things are way off at the start that something is up.
 
Physics news on Phys.org
  • #32
Code:
%Assigement with restricted values (1)

x=normrnd(0,1,1,150e4); %generate standard normal numbers
y=1+(1-0.5).*rand(1,150e4); %generate uniform numbers in interval [0,1]
z=x./y; %desired new variable
hist(z);

%Tryings to verify that the experssion meet with (1)in
%means of histogram

%for postivie values
t=rand(1,150e4);
t=1./t;
%negative values
t_neg=rand(1,150e4);
t=[-1./t_neg t];
%getting z by the exponenatial expression and plotting it's
%histogram
Z_exp=(1/sqrt(2*pi)).*((1-exp(-(t.^2)/2))./t.^2);
%%%%OR%%%%%%
% t=-1000:0.0001:1000;
% Z=(1/sqrt(2*pi)).*((1-exp(-(t.^2)./2))./t.^2);
figure()
hist(Z_exp);
%Using the formula from wikipedia Slash PDF
Z=normpdf(0,0,1)-normpdf(t,0,1);
Z=Z./t.^2;
figure()
hist(Z);

so i am trying to get the histogram that is like the histogram(bell shape) i am getting from the first section of the code.
and what i get is :

1. from the second section (with the exponent) it isn't looks so.
2. the third section it is like the second one exactly, but when I'm changing the command from "Z=normpdf(0,0,1)-normpdf(t,0,1);"
to
"Z=normcdf(0,0,1)-normcdf(t,0,1);"
i'm getting the bell shape with "heavy\thick" tails.

so my conclusion so far is:
the exponential expression that i derived with your help is exact(hist graph) to the third section when using "normpdf".
and the third section is a bell shape when i use "bell shape".
and my aim is to be able to get the bell shape from the second expression.(the exponential term)

*from Wikipedia
PDF: \frac{\Phi(0)-\Phi(t)}{t^{2}}
 
  • #33
wuid said:
and my aim is to be able to get the bell shape from the second expression.(the exponential term)
This is the MATLAB code I used to plot it. Notice that it scales the theoretical distribution by the number of samples per bin (of the histogram) so that the two graphs are equally scaled.

Code:
N=1e5				% Number of samples
rand('uniform')
y=rand(1,N);			% uniform distribution
rand('normal')
x=rand(1,N);			% standard normal distribution
z=x./y;
z(abs(z)>10) = [];		% Limit range
hist(z,101)			% 101 bin histogram covering span -10 to +10
t=[-10:0.02:10];		% parameter for theoretical distribution
t( abs(t)<1e-6 ) = [];		% avoid pesky NANs
N_bin=N*20/101;			% samples per bin of histogram
z1=N_bin/sqrt(2*pi)*(1-exp(-t.*t/2))./(t.*t);
hold				% hold histogram plot
plot(t,z1,'g')			% and overlay theoretical distribution
 
  • #34
WOW fantastic , thank's
i will check it more carefully to understand it.
 
  • #35
uart said:
Yeah, I did it a slightly easier way too.

Starting with the expression we had before (the one with the double integral):
\frac{d}{dt} \left\{ \int^{1}_{0} \int^{yt}_{-\infty}f(x) f(y) dxdy \right\}

Substitute f(y) = 1, since it's the uniform distribution. Then just reverse the order of the outer integral and the derivative so that you can apply the fundamental theorem of calculus directly to the inner derivative-integral combination.

\int^{1}_{0} \, \frac{d}{dt} \left\{ \int^{yt}_{-\infty}f(x) dx \right\}\,\, dy
Hint: y is a constant with respect to the derivative, so you can replace \frac{d}{dt} with y \, \frac{d}{d(yt)}.

You end up with a very easy integral.

In your first equation you are guilty of a very serious error (more of sloppiness than misunderstanding): never, never use the same f for two different distributions. You should either use subscripts, like this f_X(x)\text{ and } f_Y(y) or use different letters, such as f(x) \text{ and } g(y). Believe me, using the same symbol for two different things in the same calculation leads to serious errors eventually.

RGV
 

Similar threads

Replies
9
Views
2K
Replies
8
Views
2K
Replies
6
Views
1K
Replies
7
Views
1K
Replies
20
Views
2K
Replies
4
Views
1K
Replies
11
Views
3K
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K