Nov-30-2021, 04:59 AM
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?
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?