Simulating rnorm() using runif()Simulating responses from a factorial experiment for power analysisHow to do simulation of Probit link?Modelling diminishing returns of investments using regression modelsWhat to do if time series data remains autocorrelated?Raw data outperforms Z-score transformed data in SVM classificationSimulating probability of choosing the right answerSimulate AR(1) process in R with specified nonzero mean and AR coefficientNon-Linear Regression using nls() for Double Slit DiffractionPredicting / conditional sampling with Vine CopulaCreating sample data set of quiz with n number of questions and set number of students using R
RegionDifference for Cylinder and Cuboid
Where is the 1/8 CR apprentice in Volo's Guide to Monsters?
Humanity loses the vast majority of its technology, information, and population in the year 2122. How long does it take to rebuild itself?
Implicit nil checks in algorithms
Citation at the bottom for subfigures in beamer frame
Happy pi day, everyone!
Provisioning profile doesn't include the application-identifier and keychain-access-groups entitlements
How could a scammer know the apps on my phone / iTunes account?
Sword in the Stone story where the sword was held in place by electromagnets
Is a lawful good "antagonist" effective?
Welcoming 2019 Pi day: How to draw the letter π?
Is Mortgage interest accrued after a December payment tax deductible?
Can hydraulic brake levers get hot when brakes overheat?
The use of "touch" and "touch on" in context
Why would a flight no longer considered airworthy be redirected like this?
Life insurance that covers only simultaneous/dual deaths
What do these Greek words say? Possibly 2nd century
What is IP squat space
Co-worker team leader wants to inject his friend's awful software into our development. What should I say to our common boss?
Is it true that real estate prices mainly go up?
Why does Deadpool say "You're welcome, Canada," after shooting Ryan Reynolds in the end credits?
Counting certain elements in lists
Why did it take so long to abandon sail after steamships were demonstrated?
My adviser wants to be the first author
Simulating rnorm() using runif()
Simulating responses from a factorial experiment for power analysisHow to do simulation of Probit link?Modelling diminishing returns of investments using regression modelsWhat to do if time series data remains autocorrelated?Raw data outperforms Z-score transformed data in SVM classificationSimulating probability of choosing the right answerSimulate AR(1) process in R with specified nonzero mean and AR coefficientNon-Linear Regression using nls() for Double Slit DiffractionPredicting / conditional sampling with Vine CopulaCreating sample data set of quiz with n number of questions and set number of students using R
$begingroup$
I am trying to 'simulate' rnorm() using only runif().
I don't know if I should do:
sqrt(-2*log(U1))*cos(U2)
or
sqrt(-2*log(U1))*sin(U2)
Where U1 is a runif(0,1) and U2 runif(0,6.28)
I do not know if I should do it using cos or sin, or is it that I need to sample from one and the other consecutively? What is the mathematical logic behind it?
r normalization
New contributor
$endgroup$
add a comment |
$begingroup$
I am trying to 'simulate' rnorm() using only runif().
I don't know if I should do:
sqrt(-2*log(U1))*cos(U2)
or
sqrt(-2*log(U1))*sin(U2)
Where U1 is a runif(0,1) and U2 runif(0,6.28)
I do not know if I should do it using cos or sin, or is it that I need to sample from one and the other consecutively? What is the mathematical logic behind it?
r normalization
New contributor
$endgroup$
$begingroup$
You will want to investigate the Probability Integral Transform.
$endgroup$
– StatsStudent
6 hours ago
$begingroup$
Because $cos(U_2)$ is the horizontal coordinate of a point uniformly distributed on the unit circle and $sin(U_2)$ is its vertical coordinate, notice that the symmetry of the circle under a switch of coordinates implies $cos(U_2)$ and $sin(U_2)$ are identically distributed. Thus, your two methods are equivalent (assuming, anyway, that you replace "6.28" by $2pi$).
$endgroup$
– whuber♦
3 hours ago
add a comment |
$begingroup$
I am trying to 'simulate' rnorm() using only runif().
I don't know if I should do:
sqrt(-2*log(U1))*cos(U2)
or
sqrt(-2*log(U1))*sin(U2)
Where U1 is a runif(0,1) and U2 runif(0,6.28)
I do not know if I should do it using cos or sin, or is it that I need to sample from one and the other consecutively? What is the mathematical logic behind it?
r normalization
New contributor
$endgroup$
I am trying to 'simulate' rnorm() using only runif().
I don't know if I should do:
sqrt(-2*log(U1))*cos(U2)
or
sqrt(-2*log(U1))*sin(U2)
Where U1 is a runif(0,1) and U2 runif(0,6.28)
I do not know if I should do it using cos or sin, or is it that I need to sample from one and the other consecutively? What is the mathematical logic behind it?
r normalization
r normalization
New contributor
New contributor
edited 4 hours ago
masoud
74
74
New contributor
asked 7 hours ago
Chicago1988Chicago1988
162
162
New contributor
New contributor
$begingroup$
You will want to investigate the Probability Integral Transform.
$endgroup$
– StatsStudent
6 hours ago
$begingroup$
Because $cos(U_2)$ is the horizontal coordinate of a point uniformly distributed on the unit circle and $sin(U_2)$ is its vertical coordinate, notice that the symmetry of the circle under a switch of coordinates implies $cos(U_2)$ and $sin(U_2)$ are identically distributed. Thus, your two methods are equivalent (assuming, anyway, that you replace "6.28" by $2pi$).
$endgroup$
– whuber♦
3 hours ago
add a comment |
$begingroup$
You will want to investigate the Probability Integral Transform.
$endgroup$
– StatsStudent
6 hours ago
$begingroup$
Because $cos(U_2)$ is the horizontal coordinate of a point uniformly distributed on the unit circle and $sin(U_2)$ is its vertical coordinate, notice that the symmetry of the circle under a switch of coordinates implies $cos(U_2)$ and $sin(U_2)$ are identically distributed. Thus, your two methods are equivalent (assuming, anyway, that you replace "6.28" by $2pi$).
$endgroup$
– whuber♦
3 hours ago
$begingroup$
You will want to investigate the Probability Integral Transform.
$endgroup$
– StatsStudent
6 hours ago
$begingroup$
You will want to investigate the Probability Integral Transform.
$endgroup$
– StatsStudent
6 hours ago
$begingroup$
Because $cos(U_2)$ is the horizontal coordinate of a point uniformly distributed on the unit circle and $sin(U_2)$ is its vertical coordinate, notice that the symmetry of the circle under a switch of coordinates implies $cos(U_2)$ and $sin(U_2)$ are identically distributed. Thus, your two methods are equivalent (assuming, anyway, that you replace "6.28" by $2pi$).
$endgroup$
– whuber♦
3 hours ago
$begingroup$
Because $cos(U_2)$ is the horizontal coordinate of a point uniformly distributed on the unit circle and $sin(U_2)$ is its vertical coordinate, notice that the symmetry of the circle under a switch of coordinates implies $cos(U_2)$ and $sin(U_2)$ are identically distributed. Thus, your two methods are equivalent (assuming, anyway, that you replace "6.28" by $2pi$).
$endgroup$
– whuber♦
3 hours ago
add a comment |
2 Answers
2
active
oldest
votes
$begingroup$
It looks like you are trying to use the Box-Muller transform.
The method is to use $U_1, U_2$ which are independently distribution Uniform(0,1). Then
$Z_0 = sqrt-2 ln(U_1)cos(2 pi U_2) $
and
$Z_1 = sqrt-2 ln(U_1) sin(2 pi U_2) $
are a pair of independent $N(0,1)$.
The derivation comes from using polar coordinates, but to be honest the exact steps escape me at the moment (see link if you are interested).
$endgroup$
add a comment |
$begingroup$
Let $N_1,N_2$ be independent $N(0,1)$ random variates. $(N_1,N_2)$ defines a point in Cartesian coordinates. We transform to polar by
$$ N_1 = R cos theta$$
$$ N_2 = R sin theta$$
This transformation is one to one and has continuous derivatives. So we can derive the joint distribution $f_R,theta(r,theta)$ by using
$$f_R,theta(r,theta) = f_N_1,N_2(n_1,n_2)|J^-1|$$
where $J$ is the Jacobian of the transformation and
$$ J^-1(r,theta )=
beginbmatrixdfrac partial n_1partial rdfrac partial n_1partial theta \dfrac partial n_2partial rdfrac partial n_2partial theta endbmatrix
= beginbmatrixcos theta & -rsin theta \sin theta & rcos theta endbmatrix$$
Hence $$ |J^-1| = r cos^2 theta + r sin^2 theta = r $$
and
$$ f_R,theta(r,theta) = r frac12pi e^-frac12(n_1^2+n_2^2) = boxedfracr2 pie^-frac12(r^2) qquad 0 leq theta leq 2 pi, 0 leq r leq infty $$
And we see $theta sim unif[0,2pi]$ (since $f_Theta(theta) = frac12pi$ ) and $R^2 sim exp(1/2)$
Hence, to simulate $Theta$ we simply take $2 pi U_2$ where $$U_2 sim unif[0,1]$$ and to simulate $R$ we can take $$-2ln U_1$$ where $U_1 sim unif[0,1]$. ( to see why find the density of $X=-ln U, U sim unif[0,1]$).
So, Box and Muller simply inverted $N_1= R cos theta$, $N_2= R sin theta$ and moved from $(R,Theta)$ to $(N_1,N_2)$ by simulating $Theta$ from $2 pi U_2$, and an independent $R$ from $ sqrt- 2 ln U_1$
explicitly
$$Z_0 = sqrt-2 ln(U_1)cos(2 pi U_2)$$
$$Z_1 = sqrt-2 ln(U_1) sin(2 pi U_2)$$
And that is that is the mathematical logic behind it.
p.s. As I don't know whether it is clear through the mathematical justification (I believe it is, but you may have been lost in details), note you need a pair of drawings from the uniform to get a pair of normals
$endgroup$
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
);
);
, "mathjax-editing");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "65"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Chicago1988 is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstats.stackexchange.com%2fquestions%2f397505%2fsimulating-rnorm-using-runif%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
It looks like you are trying to use the Box-Muller transform.
The method is to use $U_1, U_2$ which are independently distribution Uniform(0,1). Then
$Z_0 = sqrt-2 ln(U_1)cos(2 pi U_2) $
and
$Z_1 = sqrt-2 ln(U_1) sin(2 pi U_2) $
are a pair of independent $N(0,1)$.
The derivation comes from using polar coordinates, but to be honest the exact steps escape me at the moment (see link if you are interested).
$endgroup$
add a comment |
$begingroup$
It looks like you are trying to use the Box-Muller transform.
The method is to use $U_1, U_2$ which are independently distribution Uniform(0,1). Then
$Z_0 = sqrt-2 ln(U_1)cos(2 pi U_2) $
and
$Z_1 = sqrt-2 ln(U_1) sin(2 pi U_2) $
are a pair of independent $N(0,1)$.
The derivation comes from using polar coordinates, but to be honest the exact steps escape me at the moment (see link if you are interested).
$endgroup$
add a comment |
$begingroup$
It looks like you are trying to use the Box-Muller transform.
The method is to use $U_1, U_2$ which are independently distribution Uniform(0,1). Then
$Z_0 = sqrt-2 ln(U_1)cos(2 pi U_2) $
and
$Z_1 = sqrt-2 ln(U_1) sin(2 pi U_2) $
are a pair of independent $N(0,1)$.
The derivation comes from using polar coordinates, but to be honest the exact steps escape me at the moment (see link if you are interested).
$endgroup$
It looks like you are trying to use the Box-Muller transform.
The method is to use $U_1, U_2$ which are independently distribution Uniform(0,1). Then
$Z_0 = sqrt-2 ln(U_1)cos(2 pi U_2) $
and
$Z_1 = sqrt-2 ln(U_1) sin(2 pi U_2) $
are a pair of independent $N(0,1)$.
The derivation comes from using polar coordinates, but to be honest the exact steps escape me at the moment (see link if you are interested).
edited 3 hours ago
answered 6 hours ago
Cliff ABCliff AB
13.4k12567
13.4k12567
add a comment |
add a comment |
$begingroup$
Let $N_1,N_2$ be independent $N(0,1)$ random variates. $(N_1,N_2)$ defines a point in Cartesian coordinates. We transform to polar by
$$ N_1 = R cos theta$$
$$ N_2 = R sin theta$$
This transformation is one to one and has continuous derivatives. So we can derive the joint distribution $f_R,theta(r,theta)$ by using
$$f_R,theta(r,theta) = f_N_1,N_2(n_1,n_2)|J^-1|$$
where $J$ is the Jacobian of the transformation and
$$ J^-1(r,theta )=
beginbmatrixdfrac partial n_1partial rdfrac partial n_1partial theta \dfrac partial n_2partial rdfrac partial n_2partial theta endbmatrix
= beginbmatrixcos theta & -rsin theta \sin theta & rcos theta endbmatrix$$
Hence $$ |J^-1| = r cos^2 theta + r sin^2 theta = r $$
and
$$ f_R,theta(r,theta) = r frac12pi e^-frac12(n_1^2+n_2^2) = boxedfracr2 pie^-frac12(r^2) qquad 0 leq theta leq 2 pi, 0 leq r leq infty $$
And we see $theta sim unif[0,2pi]$ (since $f_Theta(theta) = frac12pi$ ) and $R^2 sim exp(1/2)$
Hence, to simulate $Theta$ we simply take $2 pi U_2$ where $$U_2 sim unif[0,1]$$ and to simulate $R$ we can take $$-2ln U_1$$ where $U_1 sim unif[0,1]$. ( to see why find the density of $X=-ln U, U sim unif[0,1]$).
So, Box and Muller simply inverted $N_1= R cos theta$, $N_2= R sin theta$ and moved from $(R,Theta)$ to $(N_1,N_2)$ by simulating $Theta$ from $2 pi U_2$, and an independent $R$ from $ sqrt- 2 ln U_1$
explicitly
$$Z_0 = sqrt-2 ln(U_1)cos(2 pi U_2)$$
$$Z_1 = sqrt-2 ln(U_1) sin(2 pi U_2)$$
And that is that is the mathematical logic behind it.
p.s. As I don't know whether it is clear through the mathematical justification (I believe it is, but you may have been lost in details), note you need a pair of drawings from the uniform to get a pair of normals
$endgroup$
add a comment |
$begingroup$
Let $N_1,N_2$ be independent $N(0,1)$ random variates. $(N_1,N_2)$ defines a point in Cartesian coordinates. We transform to polar by
$$ N_1 = R cos theta$$
$$ N_2 = R sin theta$$
This transformation is one to one and has continuous derivatives. So we can derive the joint distribution $f_R,theta(r,theta)$ by using
$$f_R,theta(r,theta) = f_N_1,N_2(n_1,n_2)|J^-1|$$
where $J$ is the Jacobian of the transformation and
$$ J^-1(r,theta )=
beginbmatrixdfrac partial n_1partial rdfrac partial n_1partial theta \dfrac partial n_2partial rdfrac partial n_2partial theta endbmatrix
= beginbmatrixcos theta & -rsin theta \sin theta & rcos theta endbmatrix$$
Hence $$ |J^-1| = r cos^2 theta + r sin^2 theta = r $$
and
$$ f_R,theta(r,theta) = r frac12pi e^-frac12(n_1^2+n_2^2) = boxedfracr2 pie^-frac12(r^2) qquad 0 leq theta leq 2 pi, 0 leq r leq infty $$
And we see $theta sim unif[0,2pi]$ (since $f_Theta(theta) = frac12pi$ ) and $R^2 sim exp(1/2)$
Hence, to simulate $Theta$ we simply take $2 pi U_2$ where $$U_2 sim unif[0,1]$$ and to simulate $R$ we can take $$-2ln U_1$$ where $U_1 sim unif[0,1]$. ( to see why find the density of $X=-ln U, U sim unif[0,1]$).
So, Box and Muller simply inverted $N_1= R cos theta$, $N_2= R sin theta$ and moved from $(R,Theta)$ to $(N_1,N_2)$ by simulating $Theta$ from $2 pi U_2$, and an independent $R$ from $ sqrt- 2 ln U_1$
explicitly
$$Z_0 = sqrt-2 ln(U_1)cos(2 pi U_2)$$
$$Z_1 = sqrt-2 ln(U_1) sin(2 pi U_2)$$
And that is that is the mathematical logic behind it.
p.s. As I don't know whether it is clear through the mathematical justification (I believe it is, but you may have been lost in details), note you need a pair of drawings from the uniform to get a pair of normals
$endgroup$
add a comment |
$begingroup$
Let $N_1,N_2$ be independent $N(0,1)$ random variates. $(N_1,N_2)$ defines a point in Cartesian coordinates. We transform to polar by
$$ N_1 = R cos theta$$
$$ N_2 = R sin theta$$
This transformation is one to one and has continuous derivatives. So we can derive the joint distribution $f_R,theta(r,theta)$ by using
$$f_R,theta(r,theta) = f_N_1,N_2(n_1,n_2)|J^-1|$$
where $J$ is the Jacobian of the transformation and
$$ J^-1(r,theta )=
beginbmatrixdfrac partial n_1partial rdfrac partial n_1partial theta \dfrac partial n_2partial rdfrac partial n_2partial theta endbmatrix
= beginbmatrixcos theta & -rsin theta \sin theta & rcos theta endbmatrix$$
Hence $$ |J^-1| = r cos^2 theta + r sin^2 theta = r $$
and
$$ f_R,theta(r,theta) = r frac12pi e^-frac12(n_1^2+n_2^2) = boxedfracr2 pie^-frac12(r^2) qquad 0 leq theta leq 2 pi, 0 leq r leq infty $$
And we see $theta sim unif[0,2pi]$ (since $f_Theta(theta) = frac12pi$ ) and $R^2 sim exp(1/2)$
Hence, to simulate $Theta$ we simply take $2 pi U_2$ where $$U_2 sim unif[0,1]$$ and to simulate $R$ we can take $$-2ln U_1$$ where $U_1 sim unif[0,1]$. ( to see why find the density of $X=-ln U, U sim unif[0,1]$).
So, Box and Muller simply inverted $N_1= R cos theta$, $N_2= R sin theta$ and moved from $(R,Theta)$ to $(N_1,N_2)$ by simulating $Theta$ from $2 pi U_2$, and an independent $R$ from $ sqrt- 2 ln U_1$
explicitly
$$Z_0 = sqrt-2 ln(U_1)cos(2 pi U_2)$$
$$Z_1 = sqrt-2 ln(U_1) sin(2 pi U_2)$$
And that is that is the mathematical logic behind it.
p.s. As I don't know whether it is clear through the mathematical justification (I believe it is, but you may have been lost in details), note you need a pair of drawings from the uniform to get a pair of normals
$endgroup$
Let $N_1,N_2$ be independent $N(0,1)$ random variates. $(N_1,N_2)$ defines a point in Cartesian coordinates. We transform to polar by
$$ N_1 = R cos theta$$
$$ N_2 = R sin theta$$
This transformation is one to one and has continuous derivatives. So we can derive the joint distribution $f_R,theta(r,theta)$ by using
$$f_R,theta(r,theta) = f_N_1,N_2(n_1,n_2)|J^-1|$$
where $J$ is the Jacobian of the transformation and
$$ J^-1(r,theta )=
beginbmatrixdfrac partial n_1partial rdfrac partial n_1partial theta \dfrac partial n_2partial rdfrac partial n_2partial theta endbmatrix
= beginbmatrixcos theta & -rsin theta \sin theta & rcos theta endbmatrix$$
Hence $$ |J^-1| = r cos^2 theta + r sin^2 theta = r $$
and
$$ f_R,theta(r,theta) = r frac12pi e^-frac12(n_1^2+n_2^2) = boxedfracr2 pie^-frac12(r^2) qquad 0 leq theta leq 2 pi, 0 leq r leq infty $$
And we see $theta sim unif[0,2pi]$ (since $f_Theta(theta) = frac12pi$ ) and $R^2 sim exp(1/2)$
Hence, to simulate $Theta$ we simply take $2 pi U_2$ where $$U_2 sim unif[0,1]$$ and to simulate $R$ we can take $$-2ln U_1$$ where $U_1 sim unif[0,1]$. ( to see why find the density of $X=-ln U, U sim unif[0,1]$).
So, Box and Muller simply inverted $N_1= R cos theta$, $N_2= R sin theta$ and moved from $(R,Theta)$ to $(N_1,N_2)$ by simulating $Theta$ from $2 pi U_2$, and an independent $R$ from $ sqrt- 2 ln U_1$
explicitly
$$Z_0 = sqrt-2 ln(U_1)cos(2 pi U_2)$$
$$Z_1 = sqrt-2 ln(U_1) sin(2 pi U_2)$$
And that is that is the mathematical logic behind it.
p.s. As I don't know whether it is clear through the mathematical justification (I believe it is, but you may have been lost in details), note you need a pair of drawings from the uniform to get a pair of normals
edited 36 mins ago
answered 5 hours ago
StatsStats
49618
49618
add a comment |
add a comment |
Chicago1988 is a new contributor. Be nice, and check out our Code of Conduct.
Chicago1988 is a new contributor. Be nice, and check out our Code of Conduct.
Chicago1988 is a new contributor. Be nice, and check out our Code of Conduct.
Chicago1988 is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Cross Validated!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstats.stackexchange.com%2fquestions%2f397505%2fsimulating-rnorm-using-runif%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
$begingroup$
You will want to investigate the Probability Integral Transform.
$endgroup$
– StatsStudent
6 hours ago
$begingroup$
Because $cos(U_2)$ is the horizontal coordinate of a point uniformly distributed on the unit circle and $sin(U_2)$ is its vertical coordinate, notice that the symmetry of the circle under a switch of coordinates implies $cos(U_2)$ and $sin(U_2)$ are identically distributed. Thus, your two methods are equivalent (assuming, anyway, that you replace "6.28" by $2pi$).
$endgroup$
– whuber♦
3 hours ago