Proof of ratio distribution normal and uniform

In summary, the slasher distribution is a type of distribution where the probability of an event decreases as the distance from the event increases.
  • #1
wuid
40
0
Let X be standard normal and Y uniform [0,1]
find the distribution of Z=X/Y.

i think i managed to deal with this problem up to the integral stage:

P(X/Y< t ) = P(X<Y*t )

thought of :
1.
[itex]F_{z}(t)[/itex] = [itex]\int^{1}_{0}[/itex][itex]\int^{yt}_{0}f(x,y)dxdy[/itex]

2.

[itex]F_{z}(t)[/itex] = [itex]\int^{yt}_{0}f(x)dx[/itex]

maybe is neither one of them :) , but '1' is the first i thought of...
*saw in Wikipedia that this problem define the slash distribution, but without proof.
 
Physics news on Phys.org
  • #2
wuid said:
Let X be standard normal and Y uniform [0,1]
find the distribution of Z=X/Y.

i think i managed to deal with this problem up to the integral stage:

P(X/Y< t ) = P(X<Y*t )

thought of :
1.
[itex]F_{z}(t)[/itex] = [itex]\int^{1}_{0}[/itex][itex]\int^{yt}_{0}f(x,y)dxdy[/itex]

2.

[itex]F_{z}(t)[/itex] = [itex]\int^{yt}_{0}f(x)dx[/itex]

maybe is neither one of them :) , but '1' is the first i thought of...
*saw in Wikipedia that this problem define the slash distribution, but without proof.

What on Earth is z (you wrote Fz)? There is no 'z' anywhere in your integrals. Anyway, [itex]P(X < tY) = \int_0^1 \int_{-\infty}^{yt} f(x,y) \, dx \: dy[/itex]. But, it is more informative to get the density [itex]g(t) = \frac{d}{dt} P(X < Yt).[/itex]

RGV
 
  • #3
the assignment is to find the distribution function, so i suppose to integrate the normal density function (X) with this boundaries ?

X,Y are independent forgot to mention.

for the Z and t i thought i can write it Z is the R.V and 't' is just for notation it can be also small 'z' more acceptable.
 
  • #4
wuid said:
for the Z and t i thought i can write it Z is the R.V and 't' is just for notation it can be also small 'z' more acceptable.
You could have used small z for t, but I understood what you wrote, [itex]F_Z(t)[/itex] is the cumulative density function for random variable "Z" as a function of parameter "t".

The integral you had in "1." is correct, but as Ray said, what you really want is the density [itex]\frac{d}{dt} F_Z(t) [/itex]. This is important, because at some point in the derivation you should find you can interchange the order of the integral and the derivative, leaving it a very easy integral.

*saw in Wikipedia that this problem define the slash distribution, but without proof.
TBH I hadn't heard of the 'slash' distribution before. I just goggled it however and it is precisely the distribution that I previously obtained. So it's a yes on that one. :smile:
 
  • #5
uart said:
This is important, because at some point in the derivation you should find you can interchange the order of the integral and the derivative, leaving it a very easy integral.

sorry but my English is limited , didn't understand this line.
should i take the derivative of f(x,y) ? and then ?
 
  • #6
wuid said:
sorry but my English is limited , didn't understand this line.
should i take the derivative of f(x,y) ? and then ?

Maybe the term derivation was confusing there. Read it as,

This is important, because at some point in the simplification you should find you can interchange the order of the integral and the derivative, leaving it a very easy integral.

You want to find,
[tex]\frac{d}{dt} \left\{ \int^{1}_{0} \int^{yt}_{-\infty}f(x,y)dxdy \right\}[/tex]
 
Last edited:
  • #7
uart said:
You want to find,
[tex]\frac{d}{dt} \left\{ \int^{1}_{0} \int^{yt}_{0}f(x,y)dxdy \right\}[/tex]

EDIT:
changing the order of integration in the double integral, you should get:
[tex]
\int_{0}^{t}{dx \, \int_{\frac{x}{t}}^{1}{f(x, y) \, dy}}
[/tex]
This is a parametric integral with a variable upper bound:
[tex]
I(t) = \int_{0}^{t}{dx \, G(x; t)}, \ G(x; t) = \int_{\frac{x}{t}}^{1}{f(x, y) \, dy}
[/tex]
To find the total derivative w.r.t. t, we apply the formula:
[tex]
I'(t) = G(x = t; t) \cdot 1 + \int_{0}^{1}{dx \, \frac{\partial G}{\partial t}(x, t)}
[/tex]
But,
[tex]
G(x = t; t) = \int_{1}^{1}{f(t, y) \, dy} = 0
[/tex]
and
[tex]
\frac{\partial G(x; t)}{\partial t} = f(x, y = \frac{x}{t}) \cdot (-1) \cdot \left(-\frac{x}{t^2}\right) = \frac{x}{t^2} \, f(x; \frac{x}{t})
[/tex]
Then, the derivative is:
[tex]
I'(t) = \frac{1}{t^2} \, \int_{0}^{1}{dx \, f(x, \frac{x}{t})}
[/tex]
 
Last edited:
  • #8
sorry for being infant , but

[itex]\frac{d}{dt}[/itex][itex]\int^{1}_{0}\Phi(yt)-\Phi(0)dy[/itex]

is that close to what you meant ?
 
  • #9
No, no, no. The x integral goes from -infinity to yt, because X ranges over the whole real line.

RGV
 
  • #10
did wrote to me ?

so :

[itex]\frac{d}{dt}[/itex][itex]\int^{1}_{0}\Phi(yt)dy[/itex] ?

ahhhh
 
  • #11
wuid said:
sorry but my English is limited , didn't understand this line.
should i take the derivative of f(x,y) ? and then ?

Ray Vickson said:
No, no, no. The x integral goes from -infinity to yt, because X ranges over the whole real line.

RGV
Yes of course, that is what I had Ray. But then I just cut and pasted the OP to save time and missed their error :redface:.

Indiscriminate cut and pasted corrected. :)
 
  • #12
wuid said:
did wrote to me ?

so :

[itex]\frac{d}{dt}[/itex][itex]\int^{1}_{0}\Phi(yt)dy[/itex] ?

ahhhh
Reverse the order of the derivative and outer integral on the double integral.

I wrote f(x,y) = f(x) f(y) (using the independence property). Personally I like to write the inner integral explicitly using a notation like "normal_cdf(yt)", and then interchange the order of the outer integral and the derivative, but as Dickfore points out, you don't really have to do it that way.
 
Last edited:
  • #13
didn't quiet understood what Dickfore did , so tried changing variables in the attached file
seems to me pretty close but something is missing(besides the boundaries of the p.d.f) or i didn't calculate right ,
 

Attachments

  • IMG_1772.jpg
    IMG_1772.jpg
    23.7 KB · Views: 515
  • #14
wuid said:
didn't quiet understood what Dickfore
Yeah, I did it a slightly easier way too.

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

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.

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

You end up with a very easy integral.
 
Last edited:
  • #15
think i managed to do it, in two ways , could you confirm please
 

Attachments

  • Q_4.pdf
    1.1 MB · Views: 428
Last edited:
  • #16
Hey wuid.

Just as a check, you should get something like R and simulate say a hundred thousands samples from a normal and a uniform and see if you get roughly the same PDF that you yourself calculated: this is one of the better ways of verifying analytic results when it comes to distributions and probabilistic results.
 
  • #17
wuid said:
think i managed to do it, in two ways , could you confirm please
Yes the second way is how I did it. You made a mistake in the last line. When you substituted [itex]z=y^2/2[/itex] you should have ended up with an exponential term of [itex]e^{-t^2 z}[/itex] instead of the [itex]e^{-t^2 z/2}[/itex] which you have written.
 
  • #18
Opciones Binarias Trading | 24option Brokers

24option fue fundada en 2010 y est regulada por FSC (cyprus). 24option es una plataforma de comercio binario (opciones binarias) nica y en lnea.
 
  • #19
chiro said:
Hey wuid.

Just as a check, you should get something like R and simulate say a hundred thousands samples from a normal and a uniform and see if you get roughly the same PDF that you yourself calculated: this is one of the better ways of verifying analytic results when it comes to distributions and probabilistic results.

what you mean get something like R ?

by simulating what you suggest (using Matlab)

1. generating number for X using x=randn(10^6,1);
2. generating number for Y using y=rand(10^6,1);
3. dividing X by Y
4. what should i do next , where to save the the results ?
 
  • #20
uart said:
Yes the second way is how I did it. You made a mistake in the last line. When you substituted [itex]z=y^2/2[/itex] you should have ended up with an exponential term of [itex]e^{-t^2 z}[/itex] instead of the [itex]e^{-t^2 z/2}[/itex] which you have written.

o.k! yes i know i did some silly mistakes was doing this h.w in work...

what do you think on the first page , the method of changing variables ?
 
  • #21
wuid said:
what you mean get something like R ?

by simulating what you suggest (using Matlab)

1. generating number for X using x=randn(10^6,1);
2. generating number for Y using y=rand(10^6,1);
3. dividing X by Y
4. what should i do next , where to save the the results ?

Just plot the histogram corresponding to the X/Y vector generated (using ./ in MATLAB). In R you can just use hist(vector) to generate the histogram, but you will have to use whatever command or routine for MATLAB that does the same thing.

Then plot the result as well as the analytic PDF you obtained and compare the two: if they are way off then you know something is wrong, and if not, you have some confirmation in the accuracy of your solution.
 
  • #22
chiro, still don't understand what is "R" ? this is some kind of program ?
 
  • #23
wuid said:
chiro, still don't understand what is "R" ? this is some kind of program ?

R is a very popular statistical software package that is open source and has a tonne of packages available for all kinds of analysis.

http://www.r-project.org/
 
  • #24
wuid said:
chiro, still don't understand what is "R" ? this is some kind of program ?
Yeah, it's a freeware stats program. http://www.r-project.org/
 
  • #25
uart , you have anything on the second method ?
 
  • #26
wuid said:
uart , you have anything on the second method ?
Yeah, that looks ok too.

chiro said:
Hey wuid.
Just as a check, you should get something like R and simulate say a hundred thousands samples from a normal and a uniform and see if you get roughly the same PDF that you yourself calculated: this is one of the better ways of verifying analytic results when it comes to distributions and probabilistic results.

It's a slightly tricky distribution to handle numerically. It's similar to Cauchy distribution, in that it's got too much area in the tails for any of the moments (apart from the zeroth of course) to converge. So you're always going to get loads of "outliers" when trying to collect sample data. This can easily be understood in terms of the divide by zeros (or near zeros) from the uniform distribution. So no matter how many data points you calculate, you'd still probably have to sanitize the data before constructing the distribution/histogram.
 
  • #27
Yes true, but the point is to verify the characteristics of the distribution and you can still do some simulation (even if it involves restricting domains or cleaning up the results).
 
  • #28
chiro said:
Yes true, but the point is to verify the characteristics of the distribution and you can still do some simulation (even if it involves restricting domains or cleaning up the results).

Hi ,

so for simulating the ratio between the normal and uniform - getting the histogram for z=x./y (with restricted values - which is good idea) now I'm getting the bell shape as i expected. now i want to test the formula i derived with your (anyone who helped me) help. it's the formula with the exponent with 't' variable , so my question is how to generate values for 't' ?

* thank you all for helping me!
 
  • #29
wuid said:
Hi ,

so for simulating the ratio between the normal and uniform - getting the histogram for z=x./y (with restricted values - which is good idea) now I'm getting the bell shape as i expected. now i want to test the formula i derived with your (anyone who helped me) help. it's the formula with the exponent with 't' variable , so my question is how to generate values for 't' ?

* thank you all for helping me!

Are you using R or MATLAB?

If you are using MATLAB just generate a vector with tonnes of x-values with small increments and apply your f(x) to the vector to generate a new vector evaluated at each point, and plot both the histogram and the analytic vector on the same (or different) graphs and compare.
 
  • #30
Where X ranges from let's say -1000:0.01:1000 ?
 
Last edited:
  • #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.
 
  • #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: [itex]\frac{\Phi(0)-\Phi(t)}{t^{2}}[/itex]
 
  • #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):
[tex]\frac{d}{dt} \left\{ \int^{1}_{0} \int^{yt}_{-\infty}f(x) f(y) dxdy \right\}[/tex]

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.

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

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 [itex]f_X(x)\text{ and } f_Y(y)[/itex] or use different letters, such as [itex] f(x) \text{ and } g(y).[/itex] Believe me, using the same symbol for two different things in the same calculation leads to serious errors eventually.

RGV
 

FAQ: Proof of ratio distribution normal and uniform

1. What is a proof of ratio distribution?

A proof of ratio distribution is a mathematical method used to determine the likelihood of a certain ratio occurring within a given set of data. It is commonly used in statistics and probability to analyze data and make predictions.

2. How does a normal distribution differ from a uniform distribution?

A normal distribution, also known as a Gaussian distribution, is a type of probability distribution in which the data is symmetrically distributed around a mean value. A uniform distribution, on the other hand, is a probability distribution in which all values have an equal chance of occurring. In other words, a normal distribution has a bell-shaped curve while a uniform distribution has a flat, rectangular shape.

3. What is the significance of a normal distribution in statistics?

A normal distribution is significant in statistics because it is a common pattern that many real-world data sets follow. It allows for easy interpretation and prediction of data, and many statistical tests and models are based on the assumption of normality.

4. How is the proof of ratio distribution used in hypothesis testing?

In hypothesis testing, the proof of ratio distribution is used to calculate the probability of obtaining a certain ratio or difference between two groups or variables. This helps determine the significance of the results and whether they can be attributed to chance or if there is a true difference between the groups.

5. Can the proof of ratio distribution be applied to non-numerical data?

Yes, the proof of ratio distribution can be applied to non-numerical data as long as it can be converted into a numerical form. For example, categorical data can be assigned numerical values and then analyzed using the proof of ratio distribution.

Back
Top