Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Simulation Question

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 10-21-2009 01:04 AM
(1203 views)

Suppose a one unit line is divided randomly in two pieces. How can I use simulation to find E(the short piece divided by the long piece)?

Thank You!

Thank You!

3 REPLIES 3

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

You can't find E(the short piece divided by the long piece) via simulation, if I am understanding you properly, that E is Expected value.

You can find the mean of the randomly generated numbers.

You can find the mean of the randomly generated numbers.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

I love "A-ha" moments. I prepared the following, and thought it a neat approach, but then the "A-ha" occurred shortly before posting. I offer the following in quotes, and give the "A-ha" afterwards.

"I'm curious as to why you can't find this. If X is a random value from the univariate distribution on [0,1] and Y is 1-X, then I would think that the formula (via a Taylor's series expansion) could be applied:

E(X/Y) = E(X)/E(Y) * [1 + (V(Y)/(E(Y)^2) - (cov(X,Y)/E(X)*E(Y))]

where E(a) is the expected value of a, V(a) is the variance of a, and cov(a,b) is the covariance between a and b. By using the sample values for each run of the simulation, approximate values of E(X/Y) could be calculated, and then averaged across all runs. It seems like a perfect bootstrap opportunity. I must be missing something here."

Well, I missed a key something. The OP wants the short divided by the long. Consequently, X and Y as I tried to define them do not meet this definition. Sometimes X>Y, sometimes Y>X, so they do NOT define the short and the long pieces. I suppose that if you think about this hard enough, you see that the ratio would follow some kind of Cauchy distribution, implying that the expectation doesn't exist. One could simulate as much as you want, but the thing you end up calculating? I don't know what to call it.

Cool.

Steve Denham

"I'm curious as to why you can't find this. If X is a random value from the univariate distribution on [0,1] and Y is 1-X, then I would think that the formula (via a Taylor's series expansion) could be applied:

E(X/Y) = E(X)/E(Y) * [1 + (V(Y)/(E(Y)^2) - (cov(X,Y)/E(X)*E(Y))]

where E(a) is the expected value of a, V(a) is the variance of a, and cov(a,b) is the covariance between a and b. By using the sample values for each run of the simulation, approximate values of E(X/Y) could be calculated, and then averaged across all runs. It seems like a perfect bootstrap opportunity. I must be missing something here."

Well, I missed a key something. The OP wants the short divided by the long. Consequently, X and Y as I tried to define them do not meet this definition. Sometimes X>Y, sometimes Y>X, so they do NOT define the short and the long pieces. I suppose that if you think about this hard enough, you see that the ratio would follow some kind of Cauchy distribution, implying that the expectation doesn't exist. One could simulate as much as you want, but the thing you end up calculating? I don't know what to call it.

Cool.

Steve Denham

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Steve

I agree with your comments.

My point is that E(X), E(Y),*etc*. *etc*. are quantities that cannot be computed via simulation. E(X), E(Y) and the other moments are integrals, and SAS doesn't do integrals. You cannot evaluate integrals via simulation. You can however obtain an ESTIMATE of E(X), or E(Y), or E(the short piece divided by the long piece) via simulation.

I agree with your comments.

My point is that E(X), E(Y),

**Don't miss out on SAS Innovate - Register now for the FREE Livestream!**

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.