I would like to numerically calculate the probability of an event involving a random vector. Specifically:
NProbability[(t + e > (t + u)/(t + v)), {t, e, u, v} \[Distributed]
MultinormalDistribution[{0, 0, 0, 0}, {{1/2, 0, 0, 0}, {0, 1/2, 0, 0}, {0, 0, 1/2, 0}, {0, 0, 0, 1/2}}]]
When entering the above code, the output tells me that
"Increasing the value of the GlobalAdaptive option MaxErrorIncreases might lead to a convergent numerical integration"
However, NProbability does not seem to allow me higher MaxErrorIncreases (e.g. Method -> {GlobalAdaptive, MaxErrorIncreases -> 10000}
is not accepted as valid input).
Answer
direct simulation, of course I suppose this is doing the same as NProbability
without the convergence check..
n = 10^6;
Count[RandomVariate[
MultinormalDistribution[{0, 0, 0,
0}, {{1/2, 0, 0, 0}, {0, 1/2, 0, 0}, {0, 0, 1/2, 0}, {0, 0, 0,
1/2}}], n], {t_, e_, u_, v_} /; (t + e > (t + u)/(t + v))]/n //
N
0.408513
p vs log10(n):
Comments
Post a Comment