Proof of ratio distribution normal and uniform

Click For Summary
SUMMARY

The forum discussion centers on finding the distribution of the random variable Z = X/Y, where X is a standard normal variable and Y is uniformly distributed over [0,1]. Participants explore various integral formulations, including F_Z(t) = ∫₀¹ ∫₀^(yt) f(x,y) dx dy, and discuss the implications of the "slash distribution" as referenced in Wikipedia. Key insights include the importance of interchanging the order of integration and differentiation to simplify the problem, and the necessity of verifying analytic results through simulation in R or MATLAB.

PREREQUISITES
  • Understanding of standard normal distribution and uniform distribution
  • Familiarity with cumulative distribution functions (CDFs)
  • Knowledge of double integrals and their applications in probability
  • Experience with statistical software such as R or MATLAB for simulations
NEXT STEPS
  • Learn about the properties and applications of the slash distribution
  • Study the process of interchanging integration and differentiation in probability
  • Explore the use of R for statistical simulations and histogram generation
  • Investigate the implications of outliers in distributions similar to the Cauchy distribution
USEFUL FOR

Statisticians, data scientists, and mathematicians interested in probability theory, particularly those working with distributions derived from ratios of random variables.

  • #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
20
Views
2K
Replies
7
Views
1K
Replies
4
Views
1K
Replies
11
Views
3K
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K