Dear all,
In my project, Monte Carlo simulation is applied. But I have to control the sum of the observations as a constant while using a rnd command. For example, I want to generate an X~N(40, theta2) and set the observation number at 100. The sum then can be estimated as 4000. But using
can only ensure the sum close to 4000 but cannot make sure exactly equal to 4000. Does anyone knows how to reach this goal?
In my project, Monte Carlo simulation is applied. But I have to control the sum of the observations as a constant while using a rnd command. For example, I want to generate an X~N(40, theta2) and set the observation number at 100. The sum then can be estimated as 4000. But using
Code:
gen x= 40+invnormal(uniform())
Comment