Let R1, R2, R3, and R4 be four random numbers. Set X1 = max(R1,R2), X2 = min(R1,R2), X3 = max(R3,R4), and X4 = min(R3,R4).
On Thursday, March 15, 2012 5:21:01 AM UTC-5, deltaquattro wrote: > Hi, all, > > I've been given a computer codes with some input variables X1,...Xn and some outputs Y1,...Ym. I want to use a Monte Carlo code to compute the distributions of the Ys, given some distributions for the Xs. The Xs are geometrical parameters of an industrial design, and as a first approximation they are considered independent. Unfortunately the code doesn't run when X1<X2 or X3<X4, so I need to impose the two constraints X1>=X2 and X3>=X4. > How can I do it? I'd prefer a solution which is valid for general distributions, but I can also accept one which works when the Xs are normally distributed. > > Some ideas which sprung to my mind: > 1. My Monte Carlo code allows to define a linear correlation matrix for the input variables: I don't see how this helps, but maybe you do :) > 2. I let the Monte Carlo code to generate freely the sample runs, and whenever a run has X1<X2 or X3<X4, I discard it. However, I'm worried that this "rejection process" may distort the distributions of the Xs. Also, I guess I'll need to perform four times as many Monte Carlo runs as usual, to have the same level of statistical convergence. > 3. I change my Monte Carlo variables: instead than X1 and X3, I use Z1 = |X1-X2| and Z2=|X3-X4|. This way, X1 = X2 + Z1 >= X2, and X3 = X4 + Z2 >= X4. However, while I was able to make some reasonable assumptions on the distributions of the original variables, now I have no idea which distributions I should use for Z1 and Z2...Thanks, > > Best Regards, > > deltaquattro > > ps apologies for the double posts, but I'm not sure which ng is more suitable for this thread, and I'm not able to create a crosspost with Google Groups.