Questions tagged [minimization]

Minimization is a subclass of mathematical optimization where given a cost or objective function, the goal is to choose the best set of parameters that will minimize the value given by this function.

529 questions
2
votes
1 answer

How to use gekko variables as componets of an array?

I need to solve a minimization problem that involves vectors, I am using cern's root and Gekko to try solving the problem. But I kind of need to build root four-vectors/three with Gekko variables to make the operations easier. Suposse that I have…
Matthew D.
  • 311
  • 1
  • 3
  • 10
2
votes
0 answers

Minimum spanning tree, minimize sum of point distances

I have 10^6 points in 2D. Every point has to be connected, and I should minimize the sum of those distances (between points). My algorithm is this: Make a dict 'Visited', that marks if the point is visited. Find the closest point to all 10^6…
2
votes
0 answers

Gurobi says model is infeasible, yet I am able to find a solution by hand

I have the following model, which Gurobi says is infeasible, yet I am able to find a solution by hand. Please note that for num_steps of 49, the problem does have a solution. from gurobipy import Model, GRB f = Model() num_steps = 50 steps =…
2
votes
0 answers

Why are root finding algorithms generally faster than optimization/minimization for finding zeroes?

I'm having trouble finding a clear answer on this despite a number of questions both here and on the math stackexchange asking more specific questions regarding optimizers and root finders, such as this one. So far I know that any root finding…
Will
  • 170
  • 10
2
votes
2 answers

Ruby on Rails2: is there a way to minimize css and js when in production mode?

js and css files can be pretty big in order to be human readable. Is there some sort of gem that will minimize all the css and js upon running in production mode to decrease load times for the end user?
NullVoxPopuli
  • 61,906
  • 73
  • 206
  • 352
2
votes
1 answer

Data arrays must have the same length, and match time discretization in dynamic problems error in GEKKO

I want to find the value of the parameter m that minimizes my variable x subject to a system of differential equations. I have the following code from gekko import GEKKO def run_model_m(days, population, case, k_val, b_val, u0_val, sigma_val,…
user606273
  • 143
  • 6
2
votes
0 answers

Scipy optimize minimize performs only 1 iteration

I 'am trying to optimize a function which takes an input list of weights and change pixels of images with those weights and then calculates some Score (NSS Score) . Our target is to find the best input weights that give the highest NSS Score . For…
2
votes
2 answers

Match one list into another with minimum error

I have two lists, A and B. A will be at most ~1000 elements, and B will be at most ~100 elements. I want to match every element of B to an element of A, such that the sum of the absolute differences of the pairs is minimized. i.e. I want to choose…
Levi
  • 347
  • 3
  • 7
2
votes
0 answers

Good replacement for Pair class in Java for DFA minimization algorithm?

TreeSet> istovjetna = new TreeSet>(); for (Pair par : parovi) { if (!distinguishable.contains(par)) { istovjetna.add(par); …
2
votes
1 answer

Optim.jl on simple logistic regression

I know this question has been asked before, but the answer provided in Logistic regression in Julia using Optim.jl doesn't work anymore. My code looks like this.... sigmoid(x) = 1 ./ (1 .+ exp.(-x)); function costfunction(θ,X,y) m = length(y); …
2
votes
1 answer

scipy-optimize-minimize does not perform the optimization - CONVERGENCE: NORM_OF_PROJECTED_GRADIENT_<=_PGTOL

I am trying to minimize a function defined as follows: utility(decision) = decision * (risk - cost) where variables take the following form: decision = binary array risk = array of floats cost = constant I know the solution will take the form…
2
votes
2 answers

Confidence interval for result of multivariate minimization/fitting

I have a set of observations [x(t), y(t)], which I try to fit to a certain assumption: x=Fx(ax, bx, t), y=Fy(ay, by, t). Fx and Fy are linear, but the noise of observations is significantly not gaussian. For this I perform minimization of a…
2
votes
1 answer

Nonlinear Equality and Inequality Constraints in matlab optimization toolbox

I need to optimize following function: f(x) = x^2 + y^3 + z^4 with constraints: x + y + z = 10 1.5 + xy - z <= 0 xy >= -10 and limitations: -10 <= x <= 10 -5 <= y <= 5 0 <= z <= inf I need to use those options: 'LargeScale' = 'off', 'GradObj' ='…
rrrrroo
  • 23
  • 3
2
votes
1 answer

Neural network- derivative for second layer parameters wrong

I am building my first neural network. Although it's encouraging to see that I get around 95-98% accuracy. I found from gradient checking that the derivatives for theta(parameters) for 2nd layer are way off from what I got using numerical gradient…
nayakasu
  • 889
  • 1
  • 11
  • 32
2
votes
1 answer

SLSQP Error: length of bounds is not compatible with that of x0

Hi I am working with both the SLSQP solver on python and diffev2 which is part of the mystic package. For multiple parameters the format shown below works: bnds = ((0, 1e3), (0, 1e-4)) optimize.minimize(Error, [1e-8, 1e-7], args=(E, Bt, L, dt,…
Michael Black
  • 21
  • 1
  • 2