search for: rposnorm

Displaying 1 result from an estimated 1 matches for "rposnorm".

Did you mean: r8_snorm
2008 Aug 25
8
Two envelopes problem
...follows a gamma distributin, r=0.5 env <- generateenv(r=.5, rgamma, n=1e6, shape=1, rate=1/20) mean(env[,1]) # you keep the randomly assigned first envelope mean(env[,2]) # you always switch and keep the second # example, a positive 'normal' distribution # First write your won function: rposnorm <- function (n, ...) { return(abs(rnorm(n, ...))) } env <- generateenv(r=2, rposnorm, n=1e6, mean=20, sd=10) mean(env[,1]) # you keep the randomly assigned first envelope mean(env[,2]) # you always switch and keep the second # example, exponential approximated as an integer rintexp <- f...