Hi,

as said at

https://en.wikipedia.org/wiki/Stochastic_programming

The SAA problem is a function of the considered sample and in that sense is random. For a given sample ξ 1 , ξ 2 , … , ξ N {displaystyle xi ^{1},xi ^{2},dots ,xi ^{N}} the SAA problem is of the same form as a two-stage stochastic linear programming problem with the scenarios ξ j {displaystyle xi ^{j}} ., j = 1 , … , N {displaystyle j=1,dots ,N} , each taken with the same probability p j = 1 N {displaystyle p_{j}={frac {1}{N}}} .

So your approach looks good.

Tiny example of stochastic optimization at https://www.ibm.com/developerworks/community/forums/html/topic?id=7ce856ee-be78-4258-aede-fd9c4c9e464c&ps=25

regards