Practical Large-Scale Modeling: Sparsity
Yet Another Math Programming Consultant
by
6d ago
Presentation at USDA-ERS Model Summit 2024 ..read more
Visit website
Inflation is a difficult concept for many
Yet Another Math Programming Consultant
by
3w ago
Last friday, 6/28, new PCE (Personal Consumption Expenditures Price Index) data were released. The year-on-year inflation numbers decreased from 2.7% last month to 2.6% [1]:  Let's see how the popular press reports this [2]: The headline is just very wrong. Inflation was 2.6% but it did not rise by 2.6%. The PCE-based inflation number did actually decrease from 2.7% a month earlier.  I see lots of mistakes in reporting and in posts about inflation and price indices. This is a good (or rather bad) example. Background There are a few different quantities here. Here is a su ..read more
Visit website
Another very small but very difficult global NLP model
Yet Another Math Programming Consultant
by
2M ago
The goal of this exercise is to fill a square area \([0,250]\times[0,100]\) with 25 circles. The model can choose the \(x\) and \(y\) coordinates of the center of each circle and the radius. So we have as variables \(\color{darkred}x_i\), \(\color{darkred}y_i\), and \(\color{darkred}r_i\). The circles placed inside the area should not overlap. The objective is to maximize the total area covered.  A solution is: The optimization model can look like:  Non-convex Quadratic Model \[\begin{align} \max&\sum_i \color{darkblue}\pi\cdot\color{darkred}r_i^2 && && ..read more
Visit website
Modeling surprises
Yet Another Math Programming Consultant
by
2M ago
Here is an example where the PuLP modeling tool goes berserk. In standard linear programming, only \(\ge\), \(=\) and \(\le\) constraints are supported. Some tools also allow \(\ne\), which for MIP models needs to be reformulated into a disjunctive constraint. Here is an attempt to do this in PuLP [1]. PuLP does not support this relational operator in its constraints, so we would expect a meaningful error message. #------------------------------------------- # funny behavior when using a != constraint # in a PuLP model #------------------------------------------- import pulp model = pul ..read more
Visit website
Rounding inside an optimization model
Yet Another Math Programming Consultant
by
2M ago
In [1], the question was asked: how can I round to two decimal places inside an optimization model? I.e., \[\color{darkred}y_{i,j} = \mathbf{round}(\color{darkred}x_{i,j},2)\] To get this off my chest first: I have never encountered a situation like this. Rounding to two decimal places is more for reporting than something we want inside model equations. Given that, let me look into this modeling problem a bit more as an exercise.  Of course, the first thing we can do is to drop the indices (as mathematicians would say: WLOG, Without Loss Of Generality). So we have as our problem: &n ..read more
Visit website
LP in statistics: The Dantzig Selector
Yet Another Math Programming Consultant
by
3M ago
Lots of statistical procedures are based on an underlying optimization problem. Least squares regression and maximum likelihood estimation are two obvious examples. In a few cases, linear programming is used. Some examples are: Least absolute deviation (LAD) regression [1] Chebyshev regression [2] Quantile regression [3] Here is another regression example that uses linear programming. We want to estimate a sparse vector \(\color{darkred}\beta\) from the linear model \(\color{darblue}y=\color{darkblue}X\color{darkred}\beta+\color{darkred}e\) where the number of observations \(n\) (rows in ..read more
Visit website
Instead of integers use binaries
Yet Another Math Programming Consultant
by
3M ago
In [1], a small model is proposed: High-Level Model \[\begin{align} \min\> & \sum_i | \color{darkblue}a_i\cdot \color{darkred}x_i| \\ & \max_i |\color{darkred}x_i| = 1 \\ & \color{darkred}x_i \in \{-1,0,1\} \end{align}\] Can we formulate this as a straight MIP?  The objective is not very complicated. We can handle this with standard formulations, similar to what is used in LAD (Least Absolute Deviation) regression [2]. The constraint is more problematic. It can be interpreted as "at least one of the \(\color{darkred}x_i\) should be nonzero". This type of counti ..read more
Visit website
Math vs Programming
Yet Another Math Programming Consultant
by
5M ago
 A programmer writes about this blog: (It is old, but I just came across this). In my previous post, I just argued the other way around. To make sure: I don't hate programmers ..read more
Visit website
Small non-convex MINLP: Pyomo vs GAMS
Yet Another Math Programming Consultant
by
5M ago
 In [1], the following Pyomo model (Python fragment) is presented: model.x = Var(name="Number of batches", domain=NonNegativeIntegers, initialize=10) model.a = Var(name="Batch Size", domain=NonNegativeIntegers, bounds=(5,20)) # Objective function def total_production(model): return model.x * model.a model.total_production = Objective(rule=total_production, sense=minimize) # Constraints # Minimum production of the two output products def first_material_constraint_rule(model): return sum(0.2 * model.a * i for i in range(1, value(model.x)+1)) >= 70 model.f ..read more
Visit website
One nonzero in set of free variables
Yet Another Math Programming Consultant
by
6M ago
In [1] the following question is posed: I have free variables \(\color{darkred}x_i\). How can I impose the constraint that at least one of the variables is nonzero: \(\color{darkred}x_i\ne 0\). Observations \(\color{darkred}x_i\ne 0\) is somewhat difficult. We need to write this as \[\begin{align}&\color{darkred}x_i\le -\color{darkblue}\epsilon \\ & \textbf{or} \\ &  \color{darkred}x_i\ge \color{darkblue}\epsilon\end{align}\] Here \(\color{darkblue}\epsilon\gt 0\) is a small constant. This "or"-type of constraint needs a binary variable (or something similar). I ..read more
Visit website

Follow Yet Another Math Programming Consultant on FeedSpot

Continue with Google
Continue with Apple
OR