1

I'm seeking a means to find the optimal values for a set of variables in MLR. I've seen other posts which suggest using Linear Optimization. I have already fit a model and have the coefficients. Now, my goal is in order to achieve a specific DV value of Y, what is the best way to calibrate (select the optimal values) of each of the IV values? One might suggest to just increase the value of all IVs, but this comes at a cost. Hence the thought to use linear optimization.

EDIT: Let's say this is a marketing problem and let's say I have built a model that predicts a proprietary sentiment score from a set of IVs, including things like spend on advertising, number of advertisements, number of local markets in which to advertise, etc. - all continuous variables (no categorical). I have a data set consisting of 5000 data points collected over a period of time. (let's ignore any time series aspect for the time being). The MLR model says that each variable in the model is statistically significant, and I have beta weights / SE for each. for the sake of argument, let's say the model looks like this:

y^ = C + .876B1 + .435B2 + 1.23*B3, where: B1 = advertising spend B2 = num. advertisements B3 = num. local markets

Now, I want to know what is the optimal value of each variable (B1, B2, B3), such that is maximizes the sentiment score (Y^). It's not enough to know that the variables are statistically significant predictors, and one cannot simply just maximize all of them - because there is a cost to doing so, and funds are not unlimited.
Logically, one could just take the variable with the largest coefficient and "maximize that"; but in the real world, that's not how things are done - especially in marketing/advertising. I'm seeking options from what others have done to solve these kinds of problems.

I'm using Python for everything... No code to share yet, just thinking through options. If anyone has ideas to share or suggestions, I would appreciate it.

  • It's not clear what you are trying to do. What kind of model have you already fitted ? What are you trying to optimize and why ? What is your research question / or the problem you are trying to solve. And please describe the data – Robert Long Sep 27 '20 at 17:39
  • Hi Robert - I added some context to make the hypo more real. – logisticregress Sep 27 '20 at 18:24
  • @RobertLong After reading the edit, does this sound to you like a Lagrange multiplier (maybe Karush-Kuhn-Tucker) problem where the regression equation is optimized subject to cost constraints? // To the OP: if that sounds about right, you might be interested in the operations research Stack for this kind of optimization problem. Optimizing a regression equation doesn’t quite make sense, as many are hyperplanes that shoot off to $\infty$. (We could find a maximum value if, for instance, there is a quadratic term, however.) – Dave Sep 27 '20 at 18:38
  • I was inspired by this: https://stats.stackexchange.com/questions/475639/can-we-use-linear-regression-to-define-the-objective-function-in-linear-programm However, I understand what you mean about the hyperplanes. I've not come across anyone else attempting to solve what seems like it should be a common problem. – logisticregress Sep 27 '20 at 18:52

1 Answers1

0

Once you've finalized your MLR model, I would view this as the objective function within the context of an optimization problem.

I would then define appropriate constraints for B1, B2 and B3 and use linear programming (or simulation) to maximize the sentiment score accordingly.

There are quite a few Python packages to do this using linear programming - I've only just started using Python to do this and am currently experimenting with Gekko as it has easy support for using sparse matrices:

https://apmonitor.com/pdc/index.php/Main/LinearProgramming

And there are many ways to run a bounded simulation of the optimization solution space in base Python.

Would be interested to hear how you get on...

Peter
  • 11
  • 1