Solved

# Sample Average Approximation in AIMMS

• 3 replies
• 42 views

+1
• Enthusiast

I have a stochastic optimization model wherein two-stage SP is not applicable. As such, I want to utilize sample average approximation for my solution to consider at least 100 scenarios with equal probabilities then arriving at one single solution. Is this kind of methodology default in AIMMS? Or are there things that I should do first before doing so?

icon

Best answer by Marcel Hunting 8 April 2024, 10:50

View original

### 3 replies

Userlevel 5
+4

Hi @mdlapitan. You have to add a set for the scenarios. Assume this set has an index 'sc’, and that you have a constraint like

Constraint c1 {
IndexDomain: i;
Definition: sum( j, q(i,j) * x(i,j) ) <= p(i);
}

Here p and q are parameters, and x is a variable. You then have to change this constraint into

Constraint c1 {
IndexDomain: (sc,i);
Definition: sum( j, q2(sc,i,j) * x(i,j) ) <= p2(sc,i);
}

So the parameters p and q get an extra index in their stochastic variant (p2 and q2). You then have to generate the data for p2 and q2, e.g., using distribution functions.

Note: it could be that you only need scenarios for q. In that case you only have to use q2 and do not need p2.

+1

Thank you @Marcel Hunting! As a follow-up, after changing my formulation based on what you have shown, do I solve/run it normally? Like in a way, I would assume that my new run now will consider all scenarios I have generated. Or are there some settings that I need to change before running again the model?

Userlevel 5
+4

Hi @mdlapitan. You can solve it as normal; no need to change some settings.