Python Forum
Optimization using scipy.optimize
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Optimization using scipy.optimize
#1
The original problem is as follows:
I have a line function that depends on two values (let's call them a and b) that I am using to fit 3 points. Note that I do not know the exact values of these points. However, what I have are their standard deviations (let's call them c, d, and e) based on the fit. So, for a given combination of a and b, I get different values of c, d, and e. The goal is to find a combination of a and b such that c, d, and e are the smallest. Manually, one can keep inputting different combinations of a and b until the smallest values of c, d, and e are achieved.

Given the repetitive nature of the problem, I want to try to automate this process. In terms of an algorithm, I am trying to use a table of c, d, and e for different values of a and b that I have to find out when c, d, and e are the smallest. I have looked at some functions of scipy.optimize, particularly the minimize function, but it does not seem like the best thing to use for this purpose since the minimize function requires a function whose variables are to be minimized. What I have tried to do is define a function that returns sqrt(c**2 + d**2 + e**2) and then pass that function to the minimize function, but this would obviously ignore the table of values that I currently have. What should I do differently so that I can use scipy.optimize.minimize? Or is there another python library that better solves this problem?
Reply
#2
How are c, d, e computed in terms of a and b?
Reply
#3
(Nov-30-2021, 07:11 AM)Gribouillis Wrote: How are c, d, e computed in terms of a and b?

c, d, and e are not computed. They are given data points.
Reply
#4
KaneBilliot Wrote:So, for a given combination of a and b, I get different values of c, d, and e. The goal is to find a combination of a and b such that c, d, and e are the smallest.
This sentence implies that there is a dependency relation between a, b and the values of c, d, e. This is the missing part in your description of the problem. How do you get the values of c, d, e for a given combination of a, b?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How can I multithread to optimize a groupby task: davisc4468 0 715 Jun-30-2023, 02:45 PM
Last Post: davisc4468
  do you have an idea to optimize this code[recursion]]? netanelst 4 1,302 May-20-2022, 06:41 PM
Last Post: jefsummers
  Using curve_fit to optimize function (TypeError) Laplace12 4 2,525 Aug-30-2021, 11:15 AM
Last Post: Larz60+
  How to use scipy.optimization.brute for multivariable function Shiladitya 9 6,266 Oct-28-2020, 10:40 PM
Last Post: scidam
  ModuleNotFoundError: No module named 'scipy.optimize'; 'scipy' is not a package AaronKR 1 10,289 Jul-09-2020, 02:36 AM
Last Post: bowlofred
  How to Solving non-linear equation using scipy.optimize fsolve with variable list djhak 3 4,551 Jun-10-2020, 04:12 PM
Last Post: Gribouillis
  is there a way to optimize my checking system? GalaxyCoyote 4 2,767 Oct-13-2019, 09:18 AM
Last Post: perfringo
  cannot import scipy.optimize.Bounds larkypython 2 7,249 May-05-2019, 04:09 AM
Last Post: larkypython
  Optimize unittest loading Nazz 3 2,556 Mar-05-2019, 11:59 AM
Last Post: Nazz
  optimize choices in multiple if ---: statements Pedroski55 2 2,899 Dec-25-2018, 05:06 AM
Last Post: Pedroski55

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020