I have a function $g(x,Z)$, where $Z$ has a normal distribution, and $x$ is NOT a random variable (I have a range of pre-specified values to evaluate), and I want to generate a plot of the expectation value $E[g(x)]$, or $E[g](x)$.
In order to use Monte Carlo simulation to generate this plot with $n=1000$ draws of $Z$, must I resample $Z$ anew for every value of $x$ that I plan to evaluate? Or can I rely on the same $n=1000$ sample of $Z$ values for every value of $x$?
Thank you!
You can consider that $g(x,Z)$ is a set of trajectories, where each trajectory is the curve associated with the function $g(\cdot, z)$, where $z$ is a sample of $Z$. The expected value $E[g](x)$ is just the mean of all these trajectories when evaluated on $x$. Using this point of view, we can say that we have $n = 1000$ trajectories, and we want to take the average on our values of $x$. In this scenario, we can use the same $n$ simulations to compute the average for each $x$. This has the advantage of being really efficient compared to take $n=1000$ simulations for each value of $x$. However, if our simulations are somehow skewed, all our estimates will be skewed as well, which could be a reason not to use the same simulations for each $x$.
At the end of the day, I think that as long as you have enough simulations, there's no problem in reusing them (for this particular case).