In this episode of The Effective Statistician, I explore how GAMS—the General Algebraic Modeling System—can solve complex optimization problems and transform how you approach modeling.
I talk with Steve Dirkse, an expert who explains how GAMS simplifies challenges in logistics, healthcare, and beyond. Unlike generalized additive models, GAMS uses an algebraic modeling language to handle intricate systems with ease.
Together, we uncover how you can start using this powerful tool, access its resources, and apply it to real-world scenarios. Join me as we dive into this fascinating topic and uncover how GAMS can make a difference in your work!
Key Points:
- GAMS Overview
- Distinction
- Applications
- System Components
- Examples
- Mathematical Functions
- Convexity
- Getting Started
- Documentation and Training
- Final Advice
GAMS opens up a world of possibilities for solving complex optimization problems, from logistics and healthcare to business and beyond. Whether you’re a statistician, data scientist, or simply someone tackling intricate systems, this episode offers valuable insights and practical advice to get started with this powerful tool.
If you found this discussion helpful, take a moment to listen to the full episode and dive deeper into how GAMS can transform your work. Don’t forget to share this episode with your friends and colleagues who could benefit from these insights. Together, let’s spread the knowledge and make optimization more effective for everyone!
Join me for a free webinar, How to Be an Effective Statistician!
Thursday, February 5th, at 5 PM CET!
Learn how to boost your efficiency, manage your workload, and improve your work-life balance with practical tips you can apply immediately.
I’ll share proven strategies from the book How to Be an Effective Statistician to help you thrive in your career and make a bigger impact.
Don’t miss this opportunity to enhance your skills and grow as a statistician. Register now and invite your colleagues to join!
I want to register!Never miss an episode!
Join thousends of your peers and subscribe to get our latest updates by email!
Get the





Learn on demand
Click on the button to see our Teachble Inc. cources.
Featured courses
Click on the button to see our Teachble Inc. cources.
Steve Dirkse
President at GAMS Development Corp
Dr. Steven Dirkse received his PhD in Computer Science from UW-Madison in 1994. After a year of teaching math and CS at Calvin College, he joined the staff at GAMS Development in 1995, becoming Director of Optimization in 2003 and President in 2016. His primary focus has been in software development, notably solvers and solver links, data utilities, multi-threading, and quality control and performance testing. He has also consulted on optimization projects with several GAMS clients during this time.
Steve has published in many leading journals, gives lectures at conferences, and is an active member of the community: e.g., he is a past Director and Secretary/Treasurer of the INFORMS Computing Society. As part of his thesis research he developed the PATH solver for Mixed Complementarity Problems (MCP), a robust, large-scale solver that was a great leap forward in solving MCP. For the work on the PATH solver he was awarded the Beale-Orchard-Hayes Prize in 1997.

Transcript
What Are GAMS and How Can You Leverage Them?
Alexander: [00:00:00] Welcome to another episode of the Effective Statistician. Today, we are talking with Steve Dirkser. Is that pronounced correctly?
Steve: That’s about perfect, yes.
Alexander: Yeah, about and a very, very interesting way of modeling optimization and things like that. And that is called GAMS, or G A M S. And I have used. This acronym before, but it was about general additive models. But for you use the acronym actually in a different way. So what is, what is that?
Steve: GAMS. Yeah. General Algebraic Modeling System. Okay. We’re the first of its kind. Algebraic modeling language, not the last one first and best, we’d like to say.
Alexander: Okay, very good. How have you stepped over [00:01:00] this kind of model the first time, Steve? Stepped over? Yeah. How I came across that model?
Steve: Oh, accidentally. It seems like so many of my my valued colleagues and friends got into this business accidentally. We’re all maybe computer scientists, mathematicians, engineers.
But it’s fascinating to work on these kinds of problems, to apply technology, to solve problems of tremendous interest to society, to business, to governments. So I stumbled into it in grad school. And I’m eternally grateful for that.
Alexander: Okay. And great. Yeah. So whereas this general additive models are kind of a linear type of models that look into probability distributions and how they fit together.
Let’s talk a little bit about the your GAMs. What are the different components of it?
Steve: Yeah, sure. It starts with [00:02:00] a a modeling system that we built it. I always compare it to say, if you’re going to write a program in C, you, you write your program in the C language or, or Fortran, whatever else, Python, and then you have a, a compiler that will read that input and then do the thing that you’ve directed it to do.
That is somewhat akin to how GAMS operates. There’s a language, you write your model in that language. And then models built and then solved. Different thing about GAMS is, we only build the model, and then we partner with a large number of third party solvers. Many different people from all over to actually solve these models. We resell solver technology.
Alexander: Okay. Okay. And when I think about what, what would be the simplest form of a GAMS?
Steve: Oh, simple model. Yeah. What’s a simple LP? Wow. Can’t think of any simple ones [00:03:00] right now. Every time a package is delivered by UPS or FedEx, they solve A large, but perhaps a simple model to tell them these packages should go on these trucks.
You can only fit so many things on each truck. It’s got to be delivered in the right time. That all gets put together to to make a schedule and a plan for delivering all these packages.
Alexander: Okay. So it is, you can basically have all kinds of different algebraic formulations like well, you have, you know, is that certain variable depends on another variable in, let’s say quadratic term or an additive term, and you can put all these kinds of different equations.
Exactly. Yeah.
Steve: Yeah. Maybe, maybe a simple example is instead of. Filling the Amazon trucks. The classic knapsack problem. You have a knapsack or a backpack and you have a number of items [00:04:00] to put in it. Each one has a particular value, but they also have a particular size. What items did you put in your backpack to maximize the value without overloading the backpack?
That’s some simple algebra. That’s one example of a simpler problem. Yeah. You could, so basically if you have, for example you could have different utilities for for treatment. Yeah. And you want to optimize all these different utilities. Yeah. Then that could be, for example, something like this.
Yes. My advisor and many others have done a lot of work in cancer therapy. So you have all these different if you you’re treating a cancer, you have all these different beams that you can target towards the, the cancer cells. They’re all going to do some damage to the healthy tissue, which ones, which beams should you turn on and at what intensity [00:05:00] to.
Maximize the radiation delivered to the target and minimize the damage to the to the good cells, especially the most important cells. brain, spine, things like that.
Alexander: Yeah.
Steve: Yeah.
Alexander: Yeah. So whenever you have a complex system that you can describe with some kind of algebraic terms, is there, is there any kind of restriction?
Can you have only kind of, you know like exponential terms and, or can you also have logarithmic terms and all kinds of, you know, sums and whatsoever?
Steve: Yeah. Those kinds of restrictions are. You can have as many sums as you like, and size is usually not a problem. So logarithms, exponentials, sines, cosines, all these things.
You can do all those sorts of things. But well now I have to use a complex, maybe a technical term. Convexity. If you imagine pouring water into a bowl, it finds the bottom of the [00:06:00] bowl. That’s easy, that’s convex. But now if you have pouring water in the mountains, well it, you know, it goes like this.
Finds the lowest spot, but there might be another, even lower spot. And so when you have like a cosine function or, or other kinds, you’re not guaranteed that your, your local minimum is your global minimum. So the solvers can struggle with that, or we need stronger solver technology. We can formulate that, but sometimes we don’t like to.
So we have a problem with a particular form.
Alexander: Yeah. Yeah. How do you, how do you recognize that? Complexity, convexity assumption is violated.
Steve: You can get a proof that it’s not convex. You can get a constructive proof. You can build this point. This is what this proves. It’s not convex, but to prove that it is convex typically people do not do that.
Rather, they have a constructive proof of convexity. They say, if you build it [00:07:00] only out of these components and you only do these things. It will necessarily be convex. That’s one of the more recent movements in in the nonlinear part of all this, how to it’s called cone programming. When you use cones, they are by nature convex.
And so we know that the, we’re going to get a convex problem and the solvers love it. These can be processed very, very quickly and powerfully.
Alexander: But what, what’s a cone?
Steve: Oh, well, an ice cream cone. I mean, it’s, it’s 10 degrees Celsius here, so I’m not thinking about ice cream, but an ice cream cone is a, is a form of cone.
It it contains all its lines. So you have the tippy point at the bottom of the cone and any line that you draw or that you write from that point is also in the cone and it’s convex.
Alexander: And so that is a multidimensional cone, so to say, yes, it can, you can have, you know, as many parameters as you like and the parameter space.
[00:08:00] Yeah.
Steve: Yes, exactly. And they take some non ice cream cone shapes. That was the simplest example.
Alexander: Yeah. Yeah. Yeah. That’s pretty cool. So no, what would be for me as a first step, if I know would like to, you know, create such a I have a problem, let’s say some kind of optimization problem that I want to solve and I would like to use.
Gaps for that. What would be the first steps that I would need to take?
Steve: Would say you, hopefully you’re somebody who is intimately related with the problem. You understand the data you get. If I give you a weird data set, you’re gonna say, Ooh, that’s not gonna have a solution, or that’s gonna be easier.
This is, you know, some things about the problem that’s gonna help tremendously. And then at first you, you have an important choice to make. You can use what I might call classic GAMS, you write in the GAMS language, or you could use our newer product, [00:09:00] GAMSpy. Now this is something, it’s been out about a year, perhaps, and essentially you write in Python.
You don’t write in GAMS. So it’s, it’s Pythonic. And if you’re a Python person, that means a lot to you. The thought processes are a little bit GAMS like, which is what makes it such a powerful modeling paradigm, but you do it all in Python, syntax build environment, editor, everything.
Alexander: And can I download all the, all the software that I need just from your homepage?
Steve: Yes. Everything is available. Free download some free licenses of different sizes available for different amounts of time. So of course at some point you will wind up paying to use it, but we have a great academic program. Models of unlimited size with GAMSPI renewable at absolutely no cost.
So that’s pretty powerful. It’s really easy to get started. [00:10:00] So we’re pretty free about letting people access things.
Alexander: Awesome. So we’ll, I’ll put a link to your homepage in it and there you can then under The manual button downloads get, get all these kinds of different software tools. I think there’s also a lot of documentation and trainings that you provide, isn’t it?
Steve: Yes. Extensive documentation. And you can never have enough YouTube videos, no matter how many you have, people want more, but we have several. Quite a, quite a few. Yes.
Alexander: Is there any specific YouTube video you would recommend starting with? Say again? Is, is there any recommend recommended YouTube videos that you would start with as a first one to get into?
Steve: No, I can’t really, I have to say, I haven’t been spending a lot of time with the starter videos myself, so I can’t point you to any one in particular. And it all depends on where you’re starting from. We [00:11:00] have users. If you’re going with the Python track, you want something Pythonic. If you’re going more classic GAMS, you want something like that.
GAMS users are very eclectic. So there’s. It’s hard to target a very large segment with any one video.
Alexander: Okay. Okay. Very good. So we have talked about all these kinds of different parts of the model that you can basically need to, you know, make sure you understand the problem, all the different components of the problem and how they relate to each other.
So all the different variables that you have in the problem. Like you mentioned kind of the number of trucks and some number of boxes or, you know, the different values of these and have a system so that you can find a convex. Version of the problem so that you can solve and, you know, find some minimal point of also optimal point in [00:12:00] it.
And there’s software available that you can first test for free. And, you know, apply it to your model and the academic space. It’s even, you know, endless free if I understand it correctly. Yeah. So there’s a lot of. opportunity for solving complex problems in, you know, in our field. It is really about solving the mathematical problems.
It’s not about fitting data in here, isn’t it?
Steve: Fundamentally, it’s more about solving a well posed or whatever posed problem. In a real application, I mean, if you sit down with a problem, A large group of people in the whole group just needs to make it work and deliver some good answers to a an actual problem, not the model, but to a real situation.
It is about data fitting. Sometimes any large project I’ve done. You are never delivered. Christine data. [00:13:00] Anybody that tells you that is a liar or has never done a project before, so you have to clean it up. You have to maybe throw outliners. You have to do some massaging to get started. That’s almost always the case.
So data fitting, in some sense, is a precursor to to modeling work, and we have a lot of tools that make that possible. But data fitting, That is not really what GAMS is all about.
Alexander: Okay. So if you, you basically model basically using statistical modeling techniques, you model all your different functions, and then you find within these functions, you find an optimum parameter.
Yeah, you could say that. Okay. Okay. Yeah. And so for that, of course, you know, we can rely on all the classical things that we have, like logistic regression, linear regression transform our data as we like so that we can fit the different models [00:14:00] and then the model out outputs. So basically the functions that you get from the models go into camps.
Is that my correct understanding?
Steve: I guess you don’t so much build functions. It’s more usually I think of it as you, maybe you estimate parameters, for example, in economics, where a lot of our models are coming from, you build you might decide I’m using a constant elasticity of substitution function.
You know what it looks like but you need some, some substitution parameters and some elasticities to go in there. What should those be? Your, your training, your prior experience will tell you. where to start guessing about the elasticities. But there’s a wide choice. And so you have to make some choices there.
Where you get those numbers is it is art as well as science. Often it’s not the form of the function that’s up for grabs, but it’s the parameters or the actual data that goes into the function.
Alexander: Yeah. Yeah. Of course you, you estimate the [00:15:00] parameters of, of, of the function and you assume that the function has a certain kind of form, mathematical form.
Yeah.
Steve: Yeah. And also I should say, it’s not as if one can’t work with non convex problems. People do it all the time and sometimes they don’t even know it, but if in the best projects, the most solid on on the most solid ground, people know. That hey, I’ve got a convex function. I built it this way.
It’s more work, but you get a more Powerful results sometime. It’s a choice. Okay.
Alexander: Thanks so much. That was an awesome discussion about GAMs, which are not the additive models, just for, for the re to repeat that as I’m talking to lots of statisticians and data scientists. Yeah. But I think it’s an awesome way.
And so please have a look into the show notes to find all the links. To the [00:16:00] documentation, to the homepage, to the download page and yeah, have a go with it. Is there any kind of final advice that you would give Steve to the listener?
Steve: Would say just engage and have fun. That’s one of the things that keeps me involved.
It’s there’s, it’s a, it’s a challenge, but when models work and you see that solution coming up and you see the quadratic convergence taking place I always love it and it gives me a charge. It seems weird, but it brings joy to my day. So enjoy it. Enjoy the ride.
Alexander: Thanks so much.
Steve: Thank you.
Join The Effective Statistician LinkedIn group
This group was set up to help each other to become more effective statisticians. We’ll run challenges in this group, e.g. around writing abstracts for conferences or other projects. I’ll also post into this group further content.
I want to help the community of statisticians, data scientists, programmers and other quantitative scientists to be more influential, innovative, and effective. I believe that as a community we can help our research, our regulatory and payer systems, and ultimately physicians and patients take better decisions based on better evidence.
I work to achieve a future in which everyone can access the right evidence in the right format at the right time to make sound decisions.
When my kids are sick, I want to have good evidence to discuss with the physician about the different therapy choices.
When my mother is sick, I want her to understand the evidence and being able to understand it.
When I get sick, I want to find evidence that I can trust and that helps me to have meaningful discussions with my healthcare professionals.
I want to live in a world, where the media reports correctly about medical evidence and in which society distinguishes between fake evidence and real evidence.
Let’s work together to achieve this.
