1 | dev.pr(Jst.t = 0.64, Jst.rat = 0.5776972)
|
Jst.t |
|
Jst.rat |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (Jst.t = 0.64, Jst.rat = 0.5776972)
{
U <- runif(1, 0, 1)
if (U < Jst.rat) {
E <- rexp(1, 1)
X <- Jst.t + 8 * E/(pi^2)
}
else {
repeat {
E <- rexp(2, 1)
if (E[1]^2 <= 2 * E[2]/Jst.t) {
X <- Jst.t/(1 + Jst.t * E[1])^2
break
}
}
}
list(X = X, U = U, E = E)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.