I have data of the form given below:
I am trying to optimize a function of the form: Now my y variable has 6 columns, I can optimize one column (in MWE #3) which I have done in the MWE. How can I optimize the function to get the parameters A, n and B for all the 6 column values? In other words how can I get the value one value of A, n and B for all 6 values of y. MWE
_______________________________________________ SciPy-User mailing list [hidden email] https://mail.scipy.org/mailman/listinfo/scipy-user |
Nxkr,
On Sat, Jul 2, 2016 at 4:02 AM, nxkryptor nxkr <[hidden email]> wrote: I strongly recommend writing a function for your power-law/exponential function,
and calling that 3 times. I assume your code does what you want, but it's far too messy to actually read. Also, it seems somewhat odd that you are
interpolating your data onto a finer x-grid (but backwards??)
rather than simply fitting the data you actually have. Maybe there's a good reason for that. Finally, I believe you can read in your data much more simply with
data = np.loadtxt('./exp_fit.dat', skiprows=3) I'm afraid I do not actually understand what you are trying to do. You ask "How can I optimize the function to get
the parameters A, n and B for all the 6 column values? In other words
how can I get the value one value of A, n and B for all 6 values of y". Do you mean that you want to do 6 separate fits, one for each column? Or perhaps you mean that you want to fit 9 parameter values (3 each A, n, B for 3 of you exponential functions) to all of the data columns simultaneously? Or perhaps you mean something else entirely (for example that you mean one value for A, but a different value for n and B for each column). Sorry, but I can't tell. Finally, just so you're aware, fitting multiple damped exponential functions is often very difficult. --Matt Newville
_______________________________________________ SciPy-User mailing list [hidden email] https://mail.scipy.org/mailman/listinfo/scipy-user |
It looks to me that if P is a constant, then A_i and n_i are not separately identified. Josef On Sun, Jul 3, 2016 at 7:10 PM, Matt Newville <[hidden email]> wrote:
_______________________________________________ SciPy-User mailing list [hidden email] https://mail.scipy.org/mailman/listinfo/scipy-user |
Free forum by Nabble | Edit this page |