scipy-optimize Questions
1
Solved
I am getting some very weird results when running the minimize function from scipy optimize.
Here is the code
from scipy.optimize import minimize
def objective(x):
return - (0.05 * x[0] ** 0.6...
Lunneta asked 21/4, 2019 at 23:44
2
I was wondering how I can choose the best minimization method for scipy.optimize.minimize and how different the results may be?
I am trying to minimize the following expression (solve for g):
|a1...
Sealey asked 19/11, 2019 at 2:2
0
Here it was suggested to use mathematical transforms to impose hard constraints on search variables in the SLSQP algorithm in scipy.optimize.minimize. I assume more algorithms that allow constraint...
Schonfeld asked 24/1, 2023 at 17:21
2
Context
I am the author and maintainer of netgraph, a python library for creating network visualisations.
I am currently trying to optimise a routine that computes a set of N node positions for net...
Graff asked 16/1, 2023 at 17:27
3
Solved
Normally I have been using GNU Octave to solve quadratic programming problems.
I solve problems like
x = 1/2x'Qx + c'x
With subject to
A*x <= b
lb <= x <= ub
Where lb and ub are low...
Erin asked 22/4, 2019 at 20:18
1
I was wondering if anybody knows of a reliable and fast analytic HDI calculation, preferably for beta functions.
The definition of the HDI is in this question called "Highest Posterior Density...
Angellaangelle asked 16/6, 2021 at 18:39
2
Solved
I'd want to achieve similar result as how the Solver-function in Excel is working. I've been reading of Scipy optimization and been trying to build a function which outputs what I would like to fin...
Donelson asked 10/5, 2022 at 22:4
5
After days of looking for an answer on internet and, of course, in overflow I make this post. I hope someone could help me.
I made a little program that fits some data that I got from chemistry exp...
Renz asked 7/1, 2021 at 4:4
1
I'm using least_squares optimization to adjust the output of a numerical model to some measured data. At this stage I'm wondering how to determine appropriate values for the ftol, xtol and gtol par...
Piggin asked 25/5, 2021 at 9:6
0
I found that the initial guess step length for the line search in NLCG and L-BFGS is determined by
"old_old_fval = old_fval + np.linalg.norm(gfk) / 2", (line 1621 in https://github.com/sc...
Kingcraft asked 1/1, 2022 at 18:11
1
Solved
I'm trying to use the optimization module in SciPy, just writing short trial programs. I can get solutions when there are linear constraints, but the Hessian definition just doesnt work. I've used ...
Rask asked 4/11, 2021 at 12:35
1
I have an assignment problem, and I wanted to ask the SO community the best way to go about implementing this for my spark dataframe (utilizing spark 3.1+). I will first describe the problem and th...
Duce asked 22/9, 2021 at 19:38
1
Solved
Below is a very stupid example which is basically a dumbing-down of my real world use case
import pandas as pd
from scipy.optimize import differential_evolution
import time
def optimizer_function...
Myology asked 30/7, 2019 at 6:48
1
I am using the SLSQP algorithm in openMDAO, but I am having trouble understanding how it actually works. I am just looking at the common paraboloid example, which has 2 design variables and aims to...
Gammer asked 19/1, 2020 at 8:44
2
I'm trying to optimize a exponential fitting with scipy.optimize.curve_fit. But the result is no good . My code is :
def func(x, a, b, c):
return a * np.exp(-b * x) + c
# xdata and data is obtai...
Sweeten asked 27/4, 2020 at 5:29
0
I am trying to fit a exponential decay to some experimental data and using polyfit in numpy. Also, fit itself is weighted, that is every data point has some weight associated with it and the polyfi...
Menhaden asked 17/4, 2020 at 21:29
1
Solved
I am trying to fit the functiony= 1-a(1-bx)**n to some experimental data using scipy curve_fit. The model only exists for y>0, so I clip the calculated values to enforce this.
The code is shown be...
Dinahdinan asked 31/3, 2020 at 15:26
1
Solved
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 = ...
Woodnote asked 17/3, 2020 at 15:35
0
I'm trying to use scipy.optimize.fmin_l_bfgs_b function in order to minimize my function evaluateFunc(params) which returns an error and the related error gradient.
However, when I call the functi...
Pious asked 3/11, 2019 at 14:4
1
Solved
While using scipy.optimize.minimize with the trust-constr method I got this UserWarning:
scipy\optimize\_hessian_update_strategy.py:187: UserWarning: delta_grad == 0.0. Check if the approximated ...
Testaceous asked 26/5, 2019 at 2:49
2
Solved
I have set up an optimization problem with linear equality constraints as follows
sol0 = minimize(objective, x0, args=mock_df, method='trust-constr',
bounds=bnds, constraints=cons,
options={'max...
Reefer asked 19/7, 2019 at 7:13
1
Solved
I am using scipy.optimize.minimize to find optimal parameters for my objective function.
My code :
import numpy as np
from scipy.optimize import minimize
from scipy.optimize import Bounds
bound...
Roca asked 13/5, 2019 at 5:38
1
© 2022 - 2024 — McMap. All rights reserved.