0
$\begingroup$

I have the following problem:

enter image description here

I am told the following information:

(1) vertex A to vertex X is described by an exponential distribution with lambda = 4;

(2) vertex A to vertex Y is described by an exponential distribution with lambda = 2.5;

(3) vertex X to vertex Y identical to vertex Y to vertex X, and it is described by an exponential distribution with lambda = 10;

(4) vertex X to vertex B is described by an exponential distribution with lambda = 3; and, finally,

(5) vertex Y to vertex B is described by an exponential distribution with lambda = 5.

Assuming I wanted to simulate this, what exactly is the idea behind this simulation process? Am I just generating (many) exponential random variables to represent each path between the vertices? If so, would this mean that I am simulating a single travel between each of the vertices for each random variable that I generate?

I would greatly appreciate it if people could please take the time to clarify this.

$\endgroup$
4
  • 1
    $\begingroup$ Simulate each of the internode travel times. Compute the resulting travel times for each possible route. Find the quickest. Repeat many times, collecting each of the pieces of information being asked about on the way (i.e. using sample averages and proportions to estimate the population quantities). You really don't need rstan for this, vanilla R is more than adequate - you can do the whole thing in a handful of lines. (Edit: it turned out my code was 6 lines, about 200 characters, answering all three questions, and included labels on all 6 summary values in the output) $\endgroup$
    – Glen_b
    Commented Mar 20, 2018 at 8:30
  • 1
    $\begingroup$ "How do I write this in R code" will very likely be off topic, as would be "what is wrong with my R code?". [Note that there is a problem, however, in the question statement, since it doesn't give units for the rate parameters. We're left to guess.] $\endgroup$
    – Glen_b
    Commented Mar 20, 2018 at 8:39
  • 1
    $\begingroup$ See the on-topic help (specifically under programming) for our site and for stackoverflow to see what sort of questions are suitable for each site and what you need to do with them. It's not clear to me that such a question would stay open at stackoverflow as it stands. If you have a specific statistical issue (and to some extent, questions about simulation algorithms may be on topic) it may be relevant here. $\endgroup$
    – Glen_b
    Commented Mar 20, 2018 at 8:43
  • $\begingroup$ Comments are not for extended discussion; this conversation has been moved to chat. $\endgroup$
    – Glen_b
    Commented Mar 20, 2018 at 11:19

1 Answer 1

0
$\begingroup$

(Moving my first comment down to an answer now that it's not a coding question.)

Repeat many times:

  1. Simulate each of the internode travel times.

  2. Compute the resulting travel times for each of the four possible routes.

  3. Find the quickest, which is then the travel time for that iteration of the simulation

... collecting each of the pieces of information being asked about on the way (i.e. using sample averages and proportions to estimate the population quantities).

$\endgroup$
1
  • $\begingroup$ Thanks. Can you please give a small example of the process? $\endgroup$ Commented Mar 23, 2018 at 1:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.