I am trying to simulate a random variable, for a Monte Carlo simulation, which is equal to another Normal random variable, superimposed with a zero mean gaussian random variable as specified below --

$$X_m = A_1 + B_1 \times R_0 + \epsilon_{me}$$

Here, $$R_0$$ is a gaussian random variable with the parameters, $$f_{R_0} \sim \mathcal{N}\left(\mu_{R_0},\sigma_{R_0}\right)$$ and $$f_{\epsilon_{me}} \sim \mathcal{N}\left(0,\sigma_{me}\right)$$. Also, $$A_1$$ and $$B_1$$ are deterministic integers.

Let's just presume that $$X_m$$ represents a physical phenomenon that must not be negative. However, while generating samples of $$X_m$$ I am encountering certain values which are negative.

My question is, how should I deal with the negative values? A few possibilities come in my mind --

1. Resampling $$X_m$$ until a positive value is encountered, using it for simulation but considering all values while counting the total number of samples. This should ensure that the probability density function (pdf) of the sampled random variable integrates to 1.
2. Truncating the distribution at 0 -- This can be done by setting the negatively sampled values equal to zero. This should increase the pdf at zero and eventually the distribution should integrate to one.

I hope I am clear on what I'm trying to do. Which is a better and mathematically sound method?

• "Mathematical" validity doesn't apply here. When you're making a model, what matters is what best reflects what you're modeling. You can have a model that's perfectly mathematically valid but has nothing to do with what you're modeling. – Acccumulation Dec 10 '18 at 5:13
• I am not sure whether that is correct. Consider things only from a numerical perspective, MCS requires that the integration be carried over a pdf which integrates to one, isn't it? – Shihab Khan Dec 10 '18 at 6:48

Truncating the distribution is not generally a good idea, for the reason you mentioned.

Resampling is a classical method. For example, let us assume we want to generate points uniformly distributed in a circle of ray 1.
A classical way is to generate points inside the square of length 1 containing the circle, and to discard all values outside the circle.
It is clear that no points inside the circle will get any advantage : no bias is introduced.

More generally, if $$f(x)$$ is the distribution before resampling, $$g(x) = \lambda f(x) I(x)$$ is the distribution after resampling, where $$I(x)$$ insure that $$x$$ belongs to the wanted set ($$I(x) = 0$$ outside the set, $$1$$ inside) and where $$\lambda$$ is a term insuring that integration of $$g(x)$$ is equal to $$1$$, i.e. insuring that $$g(x)$$ is a distribution.
$$\lambda$$ correspond to the ratio of the number of elements generated before resampling over the number of elements after resampling.
You don't need to calculate $$\lambda$$ explicitly in the generation process.

In such a practical process, you don't have to worry about the fact that integration of the obtained distribution is equal to $$1$$: it is insured by the process itself.

• If I understood your answer correctly, if I have $N$ values of $X_m$, out of which $n$ are rejected due to physical unfeasibility, I need to find the evaluate the function who's expectation i'm estimating for $N-n$ values and divide their sum with $N-n$. That is because the $N-n$ values have been generated randomly and don't have any bias. Is it? – Shihab Khan Dec 12 '18 at 9:44
• It is right. Such resampling is classic. Moreover, in your simulation process, you can generate N values with this method: just generate another value each time a value is rejected – Damien Dec 12 '18 at 11:05