mathematical-optimization

Parallel many dimensional optimization

落花浮王杯 提交于 2019-12-03 16:44:45
问题 I am building a script that generates input data [parameters] for another program to calculate. I would like to optimize the resulting data. Previously I have been using the numpy powell optimization. The psuedo code looks something like this. def value(param): run_program(param) #Parse output return value scipy.optimize.fmin_powell(value,param) This works great; however, it is incredibly slow as each iteration of the program can take days to run. What I would like to do is coarse grain

Stochastic Optimization in Python

混江龙づ霸主 提交于 2019-12-03 14:41:00
I am trying to combine cvxopt (an optimization solver) and PyMC (a sampler) to solve convex stochastic optimization problems . For reference, installing both packages with pip is straightforward: pip install cvxopt pip install pymc Both packages work independently perfectly well. Here is an example of how to solve an LP problem with cvxopt : # Testing that cvxopt works from cvxopt import matrix, solvers # Example from http://cvxopt.org/userguide/coneprog.html#linear-programming c = matrix([-4., -5.]) G = matrix([[2., 1., -1., 0.], [1., 2., 0., -1.]]) h = matrix([3., 3., 0., 0.]) sol = solvers

Java Library? - Simplex / Linear Programming / Optimization [closed]

拈花ヽ惹草 提交于 2019-12-03 09:31:31
I'm looking for an optimization library. My two requirements are that it does not use JNI and that it does not have license restrictions preventing it from being used on multiple computers commercially. The only one I've found that meets these requirements is Choco, but it is unusably buggy. Since I couldn't find any optimization software in Java I wrote my own implementation of the Simplex Method and submitted it to Apache Commons Math library: https://issues.apache.org/jira/browse/MATH-246 http://ojalgo.org/generated/org/ojalgo/optimisation/linear/LinearSolver.html Recently JOptimizer , free

What is the R equivalent of Matlab's fminunc function?

坚强是说给别人听的谎言 提交于 2019-12-03 09:22:59
问题 In order to compute the optimal theta e.g. in logistic regression, I have to create a costFunction (the function to be minimized) which is then passed to fminunc in order to obtain the optimal theta. Also, if the gradient of costFunction can be computed, I set the 'GradObj' option to 'on' using options = optimset('GradObj','on'); and code the costFunction so that it returns, as a second output argument, the gradient value g of X. Then I give [theta, cost] = fminunc(@(t)(costFunction(t, X, y))

Setting up a linear optimizer with an “or” constraint

耗尽温柔 提交于 2019-12-03 09:10:26
I have a big linear optimizer I'm running and need some help setting up the constraints to get what I want. It's hard for me to express it in words exactly (hence the vague post-title), so I've written an example, details: Select a total of 5 items, maximizing value and keeping the cost under 5k. Each item has 2 "types". They are either labeled type1 = A, B, C, D, or E, and either type2 = X or Y. 4 items must be type X, 1 must be type Y The below example works great, but I want to add two more constraints and I'm not really sure how to do it. The two other constraints: I want every

sum of absolute values constraint in semi definite programming

风流意气都作罢 提交于 2019-12-03 08:26:06
I want to further my real world semi definite programming optimization problem with a constraint on sum of absolute values. For example: abs(x1) + abs(x2) + abs(x3) <= 10. I have searched internet and documentation but could not find a way to represent this. I am using python and cvxopt module. Your constraint is equivalent to the following eight constraints: x1 + x2 + x3 <= 10 x1 + x2 - x3 <= 10 x1 - x2 + x3 <= 10 x1 - x2 - x3 <= 10 -x1 + x2 + x3 <= 10 -x1 + x2 - x3 <= 10 -x1 - x2 + x3 <= 10 -x1 - x2 - x3 <= 10 I haven't used cvxopt , so I don't know if there is an easier way to handle your

QP solver for Java [closed]

与世无争的帅哥 提交于 2019-12-03 07:44:09
I'm looking for a good easy to use Java based Quadratic Programming (QP) solver. Googling around I came across ojAlgo ( http://ojalgo.org ). However, I was wondering if there are any other/better alternatives. Have a look at Apache Commons Math . I haven't used ojalgo, and I really can't say I've used Commons Lang enough to be able to provide you with a lot of details, but it did do what I needed. Description from their website: Commons Math is a library of lightweight, self-contained mathematics and statistics components addressing the most common problems not available in the Java

constrained nonlinear optimization in Microsoft Solver foundation vs Matlab fmincon

百般思念 提交于 2019-12-03 07:30:03
问题 can anyone show me examples or reviews for constrained nonlinear optimization in Microsoft Solver foundation 3.0? How's it compared to Matlab's fmincon? Or is there any better .net library for constrained nonlinear optimization? thanks, 回答1: IMPORTANT UPDATE on Feb 25, 2012: MSF 3.1 now supports nonlinear optimization with bounded variables via its NelderMeadSolver solver: http://msdn.microsoft.com/en-us/library/hh404037(v=vs.93).aspx For general linear constraints, Microsoft solver

Linear programming library for .NET / C# [closed]

☆樱花仙子☆ 提交于 2019-12-03 06:50:50
I need to solve an under-determined linear system of equations and constraints, then find the particular solution that minimises a cost function. This needs to be done in purely portable managed code that will run in .NET and Mono. What freely available libraries are there that I can use to implement this? All of the optimisation algorithms provided by free libraries I have found only support interval constraints on single variables, e.g. 0 < x < 1 , not constraints like x + 2y < 4 . I have also found that often the linear equations solvers only support linear systems with one solution. The

Choosing the initial simplex in the Nelder-Mead optimization algorithm

前提是你 提交于 2019-12-03 03:46:02
What's the best way to initialize a simplex for use in a Nelder-Mead simplex search from a user's 'guess' vertex? I'm not sure if there is a best way to choose the initial simplex in the Nelder-Mead method, but the following is what is done in common practice. The construction of the initial simplex S is obtained from generating n+1 vertices x0,..,xn around what you call a user's "guess" vertex xin in a N dimensional space. The most frequent choice is x0=xin and the remaining n vertices are then generated so that xj=x0+hj*ej where ej is the unit vector of the j -th coordinate axis in R^n and