2

I am quite a beginner and I am sorry if my question seems trivial, but I hope somebody will help me.

Let's assume I have a quantity Q which is function of n inputs Xi:

Q = f(X1, X2, ... Xn)

Now, let's assume that some of these inputs are distributed according to a Gaussian. Thus, for example, X1, X2 and X3 are randomly distributed with a well define mean value and standard deviation, while X4 ... Xn are instead assumed to be constant.

I know how to generate randomly the populations X1, X2 and X3 on Matlab, with a command that should implement implicitly a Monte Carlo approach:

pop_X1 = X1_nom + randn(N,1) * X1_dev; 
pop_X2 = X2_nom + randn(N,1) * X2_dev; 
pop_X3 = X3_nom + randn(N,1) * X3_dev;

However, how do I generate Q taking into account all these input populations variations? Can I simply apply the function f aligning the vectors of X1, X2 and X3 previously generated?

Thanks!!

Paolo

Paul
  • 57
  • 1
  • 6
  • 1
    The answer depends on the function `f`. If it's vectorized (capably of accepting vector inputs and producing the corresponding vector output), then yes – Luis Mendo Feb 20 '15 at 10:39

1 Answers1

0

"Can I simply apply the function f aligning the vectors of X1, X2 and X3 previously generated ?"

Yes, you can.


Edit

From a mathematical point of view, it's perfectly equivalent. You can do it safely.

From a programatical point of view, there is a difference. Drawing arrays of values from Gaussian distributions and applying a function to these arrays is not the same than drawing points accordingly to a custom distribution.

So, if you try both methods, you will never get the same exact drawings but the statistical properties of the final dataset should be exactly the same.

Ratbert
  • 5,463
  • 2
  • 18
  • 37
  • Thank you! My only concern was from the mathematical standpoint: will Matlab automatically get that the resulting function is basically a result of some randomly Gaussian distributed variables? That is, will it be able to remember this aspect while computing the distribution of f and its variance? – Paul Feb 20 '15 at 20:17