Can you give an example of (1) the param statement that you want to use in AMPL for the correlation coefficients, and (2) the data file that you want to read to supply values for this param? (It's not clear to me whether this information was in your previous email.)
It may be that the "table" feature, which is intended for pulling data from relational databases, is not well suited to your correlation data, and that instead you should use a "data" statement in conjunction with the AMPL text data format (
http://ampl.com/BOOK/CHAPTERS/12-data.pdf) or else AMPL's unformatted "read" command (
http://ampl.com/BOOK/CHAPTERS/12-data.pdf#page=21).
Bob Fourer
am...@googlegroups.com
=======
From:
am...@googlegroups.com [mailto:
am...@googlegroups.com] On Behalf Of yasmine zakari
Sent: Wednesday, April 27, 2016 12:27 PM
To:
am...@googlegroups.com
Subject: Re: [AMPL 11894] Correlation matrix / Risk minimizing objective function
Thank you very much for your help.
However I still have a problem about the way I can use these coefficients in the objective function. I tried to do this but I can't find a way to implement efficiently the correlation matrix ( that varies yearly) as a table ( I only have raw data).
pid = project specific id ,
a = province,
t = technology ,
p = PERIODS, the start of an investment period as well as the date when a power plant starts running,
h = study hour - unique timepoint considered, and
p = investment period.
set PROJECT_VINTAGE_HOURS := { (pid, a, t, p, h) in AVAILABLE_HOURS: can_build_new[t] };
var DispatchGen {(pid, a, t, p, h) in PROJECT_VINTAGE_HOURS} >= 0;
minimize Variance_Fuel_cost;
+ ( sum { (pid, a, t, p, h) in PROJECT_VINTAGE_HOURS} DispatchGen[pid, a, t, p, h] * DispatchGen[pid, a, t, p, h] * variance_fuel_cost_hourly[pid, a, t, p, h] )
# + 2 * ( sum { t in PROJECT_VINTAGE_HOURS, t2 in PROJECT_VINTAGE_HOURS: t <> t2 }
# DispatchGen[pid, a, t, p, h] * DispatchGen[pid, a, t2, p, h] * covariance_fuel[t,t2]
# * sqrt( cv_fuel_cost[pid, a, t] * fuel_cost_hourly[pid, a, t, p, h] * fuel_cost_hourly[pid, a, t, p, h]) * sqrt( cv_fuel_cost[pid, a , t] * fuel_cost_hourly[pid, a, t2, p, h] * fuel_cost_hourly[pid, a, t2, p, h]) ) )