The rJava Nightmare

I like R. I like Java. I hate the rJava package, or more precisely I hate installing or updating it. Something (often multiple somethings) always goes wrong. I forget that for some reason I need to invoke root privileges when installing it. It needs a C++ library that I could swear I have, except I …

More

Selecting the Least Qualifying Index

Something along the following lines cropped up recently, regarding a discrete optimization model. Suppose that we have a collection of binary variables $x_i \in B, \, i \in 1,\dots,N$ in an optimization model, where $B=\{0, 1\}$. The values of the $x_i$ will of course be dictated by the combination of the constraints and objective function. …

More

Alternative Versions of R

Fair warning: most of this post is specific to Linux users, and in fact to users of Debian-based distributions (e.g., Debian, Ubuntu or Mint). The first section, however, may be of interest to R users on any platform. An alternative to “official” R By “official” R, I mean the version of R issued by the …

More

Decision Analytics and Teacher Qualifications

Disclaimers: This a post about statistics versus decision analytics, not a prescription for improving the educational system in the United States (or anywhere else, for that matter). tl;dr. The genesis of today’s post is a blog entry I read on Spartan Ideas titled “Is Michigan Turning Away Good Teachers?” (Spartan Ideas is a “metablog”, curated …

More

Feelings of Rejection

This is a quick (?) recap of an answer I posted on a support forum earlier today. I will couch it in terms somewhat specific to CPLEX, but with minor tweaks it should apply to other mixed-integer programming solvers as well. It is possible to “warm start” CPLEX (and, I’m pretty sure, at least some …

More

Model Credibility

Someone asked an interesting question on a support forum recently. The gist was: “How do I confirm that my model is correct?” On the occasions that I taught simulation modeling, this was a standard topic. Looking back, I don’t recall spending nearly as much time on it when teaching optimization, which was a mistake on …

More

Optimization Pro and Con

A tweet by Nate Brixius (@natebrix) led me to read the article “The Natural Order and Divine Order of Optimization” published by the Wisconsin Institute for Discovery, a rebuttal/counterpoint to a New York Times Magazine article titled “A Sucker is Optimized Every Minute“. The former sings the praises of optimization (somewhat) and the latter vilifies …

More

An SSH Glitch

Something weird happened with SSH today, and I’m documenting it here in case it happens again. I was minding my own business, doing some coding, on a project that is under version control using Git. After committing some changes, I was ready to push them up to the remote (a GitLab server here at Michigan …

More

Formulating Optimization Models

Periodically, on OR Exchange and other forums, I encounter what are surely homework problems involving the construction of optimization models. “The Acme Anvil Corporation makes two types of anvils, blue ones and red ones. Blue anvil use 185 kg. of steel and have a gross revenue of $325 each; red anvils …” Really? Does anyone …

More

Partitioning with Binary Variables

Armed with the contents of my last two posts (“The Geometry of a Linear Program“, “Branching Partitions the Feasible Region“), I think I’m ready to get to the question that motivated all this. Let me quickly enumerate a few key take-aways from those posts: The branch and bound method for solving an integer linear program …

More

Thunar Slow-down Fixed

My laptop is not exactly a screamer, but it’s adequate for my purposes. I run Linux Mint 17 on it (Xfce desktop), which uses Thunar as its file manager. Not too long ago, I installed the RabbitVCS version control tools, including several plugins for Thunar needed to integrate the two. Lately, Thunar has been incredibly …

More

Parsing Months in R

As part of a recent analytics project, I needed to convert strings containing (English) names of months to the corresponding cardinal values (1 for January, …, 12 for December). The strings came from a CSV file, and were translated by R to a factor when the file was read. The factor had more than 12 …

More

Making Math Fun

I was a math major from undergrad to doctorate, so obviously I think math is fun. Equally obvious to me (especially after teaching a variety of mathematical topics to college students), not everyone shares that opinion, which is too bad. Recently, though, I came across an organization devoted to making math fun for small children, …

More

HDMI Audio in Mythbuntu

My adventure replacing my old Mythbuntu box with a new one continues. It’s been working for a while now, in terms of waking when it should, recording and replaying shows. Yesterday’s immediate concern was sound. The PC hooks to my TV via an HDMI cable. While both live TV and recordings viewed through MythTV worked …

More

RStudio Git Support

 One of the assignments in the R Programming MOOC (offered by Johns Hopkins University on Coursera) requires the student to set up and utilize a (free) Git version control repository on GitHub. I use Git (on other sites) for other things, so I thought this would be no big deal. I created an account on …

More

Updating Adobe Flash

Within the past week, give or take, Firefox started blocking the Adobe Shockwave plugin from running in web pages, due to a security problem with it. I could (and did, when I trusted the site) override the warning, but in general bypassing security is a bad idea. Even when the site is trusted, you have …

More

Mythbuntu and USB WiFi

I’m in the (slow, painful) process of configuring a new PC to act as a video recorder. This post contains some notes on how I got it connected to my home WiFi network. First, a note to self/strong suggestion to others: before screwing with anything that is likely to cause reboots, go into Applications > …

More

Linearize That!

For whatever reason, I’ve seen a bunch of questions posted on various fora boiling down to “How do I linearize <insert grossly nonlinear function>?” Whether by coincidence or due to some virtual viral epidemic, I’ve seen three or four in the past week that involved logarithms. So, without further ado, here is the quick solution: …

More

Java Gotchas

I was writing what should have been (and, in the end, was) a very simple Java program yesterday. It wound up taking considerably longer than it should have, due to my tripping over two “gotchas”, which I will document here for my own benefit (the next time I trip over them). Issue 1: Importing from …

More

The Reciprocal Normal Distribution

A recent question on OR-Exchange dealt with the reciprocal normal distribution. Specifically, if k is a constant and X is a Gaussian random variable, the distribution of Y=k/X is reciprocal normal. The poster had questions about approximating the distribution of Y with a Gaussian (normal) distribution. This gave me a reason (excuse?) to tackle something …

More

Multiple Children – Again!

I thought I had exhausted this topic, but no such luck … As noted in a previous post (“When the OctoMom Solves MILPs“), CPLEX (and I believe most other integer programming solvers) are have a design limitation of at most two child nodes per parent node in the search tree. Personally, I don’t consider that limitation a …

More

OR in an OB World

Not infrequently, I am asked about my academic specialty. When I reply “operations research”, as I usually do, I’m often met with a polite but blank stare. This happened to me a couple of times at a recent party. If the questioner inquires further, I’ll try to give an example or two of what OR …

More

A Musical Random Walk

I just read a blog post here at MSU about The Infinite Jukebox, a web tool that will analyze a song (either one you upload or one from their library) and map out links between segments of the song that have approximately the same beat. You then see a visualization of the song as a …

More

Scheduling Instability

Fellow OR blogger Laura McLay recently wrote a post “in defense of model simplicity“, which is definitely worth the read. It contains a slew of links to related material. As I read it, though, my contrarian nature had me thinking “yes … as long as the model is not too simple”. A recent piece in …

More

Mythbuntu: The Upgrade from Hell

I foolishly let Mythbuntu update to version 14.04 overnight a few days ago. The installer ran into problems (which I could not decipher) regarding updating the MythTV database. I let it upload two separate bug reports and did my best to soldier on. When the installation was finally over, the back end would not load, …

More

Fewer Zeros

A question I saw online not too long ago caused me a flashback to my days teaching linear programming (LP) to masters students. The poster had developed an optimization model — I can’t recall if it was an LP, a quadratic program (QP) or a mixed-integer program (MIP) — and had no problem solving it. …

More

Updated Benders Example

Two years ago, I posted an example of how to implement Benders decomposition in CPLEX using the Java API. At the time, I believe the current version of CPLEX was 12.4; as of this writing, it is 12.6.0.1. Around version 12.5, IBM refactored the Java API for CPLEX and, in the process, made one or …

More

New Linux Laptop

Earlier this month I decided to get a netbook, and of course I wanted to run Linux (preferably Linux Mint) on it. After shopping around, I settled on an Acer Aspire V5-131. I won’t say it was my dream machine — it has a conventional hard drive, whereas I would have preferred a solid-state drive …

More

Mint on a Stick

Due to a research project in which I’m currently engaged (and, trust me, you do not want to know the details), I find myself needing to wander into a public computer lab on our campus (where Windows rules the machines) and run a “virtual” Linux machine (because I’ll be talking to a Linux server and, …

More

NetBeans 8 Update Bugs

An update to the NetBeans IDE (8.0 patch 2) this morning seems to have introduced some problems that I was fortunately able to work around. I’ll document them here in case anyone else runs into them. For some context, when I opened NetBeans, it correctly showed three projects in the project navigator, the main project …

More

Reproducibility and Java Collections

I’ve been immersed in Java coding for a research project, and I keep tripping over unintentional randomness in the execution of my code. Coincidentally, I happened to read a blog post today titled “Some myths of reproducible computational research“, by C. Titus Brown, a faculty member (one of those hybrid species: Computer Science and Biology) atMichigan …

More

A Java Slider/Text Combo

A few years back I was coding (in Java, of course) the <shudder>GUI</shudder> for a research program. I needed to provide controls that would let a user specify priorities (0-100) scale for various things. Two possibilities occurred to me, with pretty much diametrically opposed strengths and weaknesses. Sliders have a few virtues. Grabbing and yanking …

More

Modeling an On/Off Span

I may be ruining a perfectly good homework problem by posting this. :-) Occasionally someone needs to incorporate in an integer programming model the notion of something changing state for a predefined span of time. The typical characterization I’ve seen is as follows: we have a sequence of binary variables xi∈{0,1},i∈{1,…,N} that indicate the state …

More

The Definition of “Open”

Before I climb up on my soapbox, I probably should make a couple of disclaimers to put what follows in perspective. I am a heavy user of open source software, and in particular of products from the Mozilla Project. My primary email client is Thunderbird. My first web browser was Netscape Navigator (which predates the …

More

CP Optimizer, Java and NetBeans

After years of coding CPLEX applications in Java, I’ve just started working with CP Optimizer (the IBM/ILOG constraint programming solver) … and it did not take me long to run into problems. As with CPLEX, you access CP Optimizer from Java through the Concert API. As always, I am using the NetBeans IDE to do …

More

Ridge Regression Revisited

I’ve been neglecting the blog a bit lately, partly because I haven’t had much to say and partly because I’ve been a bit busy with other things. One of the things keeping me occupied is the excellent Statistical Learning course offered by Stanford. (In one of those coming-full-cycle things, now that I’m retired from teaching, …

More

A Modest Terminology Proposal

I just finished shoveling snow, an exercise I will have to repeat later today and possibly tomorrow, as we enjoy the first of multiple winter storms queued up all the way from mid-Michigan (where I live) to the central Pacific, each patiently awaiting its turn to annoy me. With that in mind, I would like …

More