Hi everyone,
Thanks very much for your help in advance!
I am trying to write an optimization problem based on simulation. Specifically, I have an unknown variable that is the variance of a normal distribution I would like to solve by maximizing some objective function. This objection function involves a sample mean of some complicated expression, where this sample mean is calculated based on a series (1000) of random draws from the normal distribution.
So I declare a variable, which is the variance first:
var theta_y >= 0.00001;
Then I declare a series of random draws as:
var state_y {SIM};
where SIM is just a set of length 1000 (for example) meaning the number of draws.
Then I add the following constraint after the objective function:
subject to Random_State {j in SIM}: state_y[j] = Normal(0, theta_y);
However, this gives me the following warning:
Warning:
line 63 offset 2090
variable argument to random function Normal
context: subject to Random_State {j in SIM}: state_y[j] = Normal(0, >>> theta_y) <<< ;
And I cannot solve this optimization problem
Thanks again very much for your help!
All the best,
Jun