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.
Questions tagged [minimization]
529 questions
1
vote
1 answer
Minimum length of lines needed
Suppose we have a set of N points on the cartesian plane (x_i and y_i). Suppose we connect those points with lines.
Is there any way like using a graph and something like a shortest path algorithm or minimum spanning tree so that we can reach any…

GiorgosPap31
- 43
- 7
1
vote
0 answers
Python - Find Weights Through Least Square Minimization
I have an array of data from a function that resemble loosely a sine wave which were obtained through filtering, let's call them A[ ]. They are not smooth or scaled correctly. In another array I have data from a "perfect" sine wave, generated in…

Adam
- 486
- 1
- 8
- 26
1
vote
1 answer
What is the best algo for this array minimization problem?
I have an array say 'A' of size n having some numbers {a1, a2, …, an} not necessarily distinct.
I have to create another array B = {b1, b2, …, bn} which are distinct such that the value of
sum|ai - bi| over all i's{i =1 to i =n} is…

Shirish Srivastava
- 13
- 4
1
vote
0 answers
Alternatives to bounded root finding functions
My question involves a bounded root finding problem for when the
function behaves strangely when it is near zero.
Setup
I am trying to find the root for the following equation
where
kappa, chi, theta and alpha are all parameters that I set.…

Joe Emmens
- 135
- 13
1
vote
1 answer
Optimizing input where output has constraints in python
I trying to minimise an input ( 1 variable ) to a non linear function where the output is a probability.
As in, if the input is 5 the output probability is 40% , 10 input the probability becomes say 93%. The function to compute the probability is…

Ram
- 389
- 4
- 13
1
vote
1 answer
Custom interpolation / minimization function (aka curve fitting) any library
I usually work with ROOT and its powerful MINUIT interpolation classes in a C++ environment. For reason related to plotting and ease of data handling, I switched recently to Python 3.8. The problem is that I can't find a library that allows me to…

giammi56
- 154
- 1
- 15
1
vote
0 answers
Scipy.optimize.minimize ignores the bounds
Below is the dummy example, for which I expect the answer 0.8, but it outputs something close to 0:
from scipy.optimize import minimize, Bounds
minimize(lambda chi: chi**2, 1, method='nelder-mead', bounds=Bounds(0.8,1.2,True) )

Mikhail Genkin
- 3,247
- 4
- 27
- 47
1
vote
2 answers
`f0` passed has more than 1 dimension. - fmin_l_bfgs_b
I want to find parameters which minimalize a function but I get an error. So far use scipy.optimize.fmin but I want to add bounds for every argument. This is my code
def Kou_calibration_full():
i=0
global opt
p0 =…

Math122
- 147
- 1
- 8
1
vote
1 answer
First loop through columns and then loop through through rows
I want to loop first through columns and then through rows.
data test ;
input cat $ cat3 cat4 cat5 cat6 cat7 cat8 num_rat ;
cards;
cat3 0 -1.78 -2.68 -3.06 -3.4 -3.83 1885
cat4 0 2.12 -2.15 -2.63 -2.94 -3.34 3151
…

Jass
- 11
- 2
1
vote
0 answers
How can I solve variables in pandas dataframe?
I executed solver function in Excel to minimize variables and get success. We can see how I made it below:
First, we got a table of matches with "Away Team", "Away Pts", "Home
Team", "Home Pts", "Game Total", "Home MoV":
Then, we get variables…

matheuscosta
- 21
- 5
1
vote
2 answers
R: Maximum Likelihood Estimation of a exponential mixture using optim
I'm trying to get the parameters w, lambda_1, lambda_2 and p from a mixture bi-exponential model, using a loglikelihood function and the optim function in R. The model is the following
Here is the code
biexpLL <- function(theta, y) {
# define…

jealcalat
- 147
- 9
1
vote
1 answer
Optimizing a function using Scipy Package
I am given an objective function that I need to maximize using a nonlinear optimizer in Python. I understand that many optimizers are written as minimizations but I am having trouble setting up the parameters given that I have a few inequality…

eruiz
- 59
- 9
1
vote
1 answer
Constrain on parameters for Negative Log Likelihood Minimization
I am trying to fit a 5 parameter (a, b, c, d, e) model, where one of the parameters is constrained by another, let's say,
0< d < 1
e < |d|
I am currently using zfit which as far as I know, uses iMinuit
I have only created the zfit.Parameters and put…

Horace
- 62
- 4
1
vote
1 answer
Pulp constraints when probelm is Infeasible
I am trying to solve a linear optimization problem using Pulp in Python.
Here is the code:
import pandas as pd
import pulp
D_XB = 20
D_XP = 0
D_XC = 0
Available_Time = 1440 #in minutes
test = [['A1', 'A2', 'A3', 'A4', 'A5'], [1,2,1,0,3],…

Carlotta Fabris
- 37
- 1
- 8
1
vote
1 answer
Calculating scaling constants for two curves using lmfit minimize or scipy optimize
I have a relatively complex plot which I would like to model. The model consists of two 'phases'/components which have been measured experimentally, however the ratio of these components is unknown. The data is shown in the image: where some…

JoshuaT31524
- 11
- 2