Large Scale Aggregation Example
Teaching a course about GAMS modeling as USDA. A large real-world aggregation step cannot be ommitted! Here is an example how we can do many things in one step:Even though the raw data was too large to...
View ArticleSimple Data Set to show equivalence of RAS algorithm and Entropy model
For the matrix balancing problem it is well known that the RAS algorithm and an Entropy model give the same results. Here is a small example with the data taken from...
View ArticleGRAS (Generalized RAS) Example
$ontext Generalized RAS method THEO JUNIUS & JAN OOSTERHAVEN The Solution of Updating or Regionalizing a Matrix with both Positive and Negative Entries Economic Systems Research,...
View ArticleSQL2GMS and Stored Procedures
Yes, that works. See:The stored procedure should return a result set which SQL2GMS will then store in the GDX file.
View ArticleRAS Algorithm Refinement
In the post http://yetanothermathprogrammingconsultant.blogspot.com/2013/06/simple-data-set-to-show-equivalence-of.html a simple RAS algorithm was shown. A slightly better way is to use a convergence...
View ArticleCreating sparse data
To test certain modeling constructs it may be useful to generate some random data. In GAMS this is usually done through something like: a(i,j,k) = uniform(-100,100);When we want to have a sparse data...
View ArticleNeural Networks in GAMS
I was running some neural networks with a back propagation algorithm using a rather simple optimization tool (gradient descent). This actually ran pretty decent. Now lets if we can formulate something...
View ArticleGAMS = Nixon
From: http://www.amazon.com/Practical-Financial-Optimization-Library-Finance/dp/1405133716
View ArticleCalling R from GAMS to produce high quality graphs
Here is a small demo script that shows how we can call R from GAMS to produce graphs using ggplot.* name of the R script to execute$set rscript my_script.R* include file with data$include...
View ArticleAggregation: database vs GAMS
The following aggregation code in GAMS aggregates PRODUCTION and AREA HARVESTED from a relatively large data set from FAO (2.2 million records). Afterwards we recalculate YIELDS, as aggregating yields...
View ArticleQP is convex or not?
I have a QP problem that is rejected (not convex) or solved depending on the solver or method:SolverObjectiveGurobi1.01022764e+02 (23 iterations, 0.16 seconds)Cplex*** CPLEX Error 5002: Q in %s is not...
View ArticleSpeeding up SMAX
The following GAMS code was very slow:ACCRLRLY(B,BA,Y,U)$SUM((H,T,UR), XSB7(B,BA,"NP",H,Y,T,U,UR)) = ACRLRLY(BA,Y, U) * SMAX((H,T,UR), XSB7(B,BA,"NP",H,Y,T,U,UR));Note that...
View ArticleDuopoly Example
This example is taken from the book “Complementarity Modeling in Energy Markets.”We have two firms i producing q(i). The total production Qtot is then defined by adding up these two quantities. Because...
View ArticleGAMSification
The book “Complementarity Modeling in Energy Markets” has a number of interesting GAMS models in the back. Some of these models are presented in scalar format, i.e. bypassing the indexing facilities....
View ArticleMicroeconomic Principles
Another model illustrating tables 3.3 and 3.4 from “Complementarity Modeling in Energy Markets”.$ontext Example from chapter 3: "Some Microeconomic Principles" Reference: Steven A. Gabriel,...
View Article4D Interpolation
For a engineering design application we were offered a 4D lookup table that predicts Of course rather than “lookup” it is often better to do interpolation, so values in between are accepted. This still...
View Article2D Interpolation With SOS2 variables
Using SOS2 variables to implement a 1D interpolation scheme is fairly easy (see: http://yetanothermathprogrammingconsultant.blogspot.com/2009/06/gams-piecewise-linear-functions-with.html). However, a...
View ArticleCplex solution pool
I am working on a fairly complex but small MIP model, where we want to find a large number of non-dominated, feasible solutions (Pareto solutions). In one of the models we have developed for this, we...
View ArticlePindyck
Robert Pindyck in “CLIMATE CHANGE POLICY: WHAT DO THE MODELS TELL US?”:ABSTRACT: Very little. ….One of the problems with these long range models is the use a discount rate. This rate can have large...
View Article