Warning: variable argument to random function Normal (simulation based optimization)

16 views
Skip to first unread message

Jun Zhao

unread,
Sep 20, 2024, 12:35:16 PMSep 20
to AMPL Modeling Language
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

AMPL Google Group

unread,
Sep 23, 2024, 1:11:24 PMSep 23
to AMPL Modeling Language
Your question has been moved to our new user forum at discuss.ampl.com, and a response has been posted there. To see the response, use this link:

https://discuss.ampl.com/t/ampl-25055-warning-variable-argument-to-random-function-normal-simulation-based-optimization/1216/2

To reply, click the red "Reply" button that follows the response. (Do not send an email reply to this message.)


--
Robert Fourer

We're switching to a new, enhanced user forum.
Join it now at discuss.ampl.com.
{#HS:2713412697-128469#}
Reply all
Reply to author
Forward
0 new messages