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

Minimization python function which is constant on small intervals

I want to minimize a convex function on an area with bounds and constraints, therefore I try to use scipy.optimize.minimize with the SLSQP option. However my function is only defined at discrete points. Linear interpolation does not seem like an…
HolyMonk
  • 432
  • 6
  • 17
2
votes
2 answers

minimize a multivariate function in R with constraints

I am trying to minimize a function, S.residuum , in R with some constraints S.residuum<- function(w, stdv, corr) { intermed<-0 for (i in 1:length(stdvv)) { intermed =intermed+residuum(w,stdvv,corr.mat,i) } return(intermed) } where w is…
maniA
  • 1,437
  • 2
  • 21
  • 42
2
votes
0 answers

Implementing minimization in SciPy

I am trying to implement the 'Iterative hessian Sketch' algorithm from https://arxiv.org/abs/1411.0347 page 12. However, I am struggling with step two which needs to minimize the matrix-vector function. Imports and basic data generating…
2
votes
0 answers

Optimizing portfolio for sharpe ratio using python scipy's optimize.minimize

I am trying to optimize a portfolio for sharpe ratio and following is my code import pandas as pd import os import matplotlib.pyplot as plt import numpy as np import scipy.optimize as spo def get_path(sym, base_dir = "data"): cwd = os.getcwd() …
2
votes
1 answer

Minimization in Python to find shortest path between two points

I'm trying to find the shortest path between two points, (0,0) and (1000,-100). The path is to be defined by a 7th order polynomial function: p(x) = a0 + a1*x + a2*x^2 + ... + a7*x^7 To do so I tried to minimize the function that calculates the…
2
votes
1 answer

function minimization in r with constraints on function of parameters

Many libraries are available in R to perform minimisation. However, all the ones I could find (e.g. rcgmin, or optimx) only allow lower and upper bounds on the input parameters: opt_Params <- Rcgmin(par = Params_init, fn =…
kilgoretrout
  • 158
  • 3
  • 14
2
votes
2 answers

How do I pass through arguments to other functions (generally and via scipy)?

I am trying to minimize a function that outputs chi-square via scipy and find the mu,sigma,normc that provide the best fit for a Gaussian overlay. from math import exp from math import pi from scipy.integrate import quad from scipy.optimize import…
user7345804
2
votes
1 answer

How to properly round numpy float arrays

I have some sort of rounding issue when rounding floats. x = np.array([[1.234793487329877,2.37432987432],[1.348732847,8437.328737874]]) np.round(x,2) array([[ 1.23000000e+00, 2.37000000e+00], [ 1.35000000e+00, 8.43733000e+03]]) Is…
tomka
  • 2,516
  • 7
  • 31
  • 45
2
votes
1 answer

Scipy.optimize check_grad function gives "Unknown keyword arguments: ['args']" error

I want to use scipy.optimize.check_grad to evaluate correctness of gradients. I specify def func(x, a): return x[0]**2 - 0.5 * x[1]**3 + a**2 def grad(x, a): return [2 * x[0], -1.5 * x[1]**2 + 2*a] from scipy.optimize import…
tomka
  • 2,516
  • 7
  • 31
  • 45
2
votes
2 answers

Which algorithms can be used to solve this similarity minimizing equilibrium prob?

I've looked everywhere, but apparently I can't seem to find the correct keywords to search for a proper solution, so here goes the problem: * I have a set of P elements [A, B ....Y, Z], and a matrix of PxP values which represent the similarity…
2
votes
0 answers

Scipy Minimization

I have an inequality constrained optimization problem and am a bit unclear about the syntax of the input. The documentation did not prove all that clarifying. I want to know if the function below is doing what I hope it is: Initialize the…
Anisotropic
  • 635
  • 9
  • 21
2
votes
1 answer

Mimimization of anonymous function in C++

I have a cyclic program in C++ which includes composing of a function (every time it is different) and further minimization of it. Composing of a function is implemented with GiNaC package (symbolic expressions). I tried to minimize functions using…
2
votes
2 answers

can backtracking be avoided when trying to minimize the rectangle space that encloses rectangles of different integer shapes?

The abstraction of my problem is that in a cartesian plane there are a lot of rectangles. These rectangles have known integer sizes and must have integer coordinates their abscissas (horizontal coordinates) are known and fixed, only their ordinates…
Valentin Brasso
  • 1,388
  • 7
  • 21
  • 41
2
votes
1 answer

R: Quadratic programming/ Isotonic regression

I want to minimise the following equation: F=SUM{u 1:20}sum{w 1:10} Quw(ruw-yuw)^2 with the following constraints: yuw >= yu,w+1 yuw >= yu-1,w y20,0 = 100 y0,10 = 0 yu,10 = 0 I have a 20*10 ruw and 20*10 quw matrix, I now need to generate a yuw…
2
votes
1 answer

Matlab: Stopping evaluation of fmincon without losing data

Right now, fmincon solves a minimization problem for me. The function to minimize uses parfor for the sake of completeness. I am using those options options = optimoptions(@fmincon,'Display','iter',…
Pejta
  • 21
  • 2