Hello. First of all, thank you for all the work on this library.
I am currently trying to do a fit on a multivariate function and I wanted to use the lsfit subpackage which seems the more suited to my needs. However I have difficulties understanding how to create the function to fit when the points are multidimensional.
Taking the example from the documentation, what I understand is that if I want to fit for example C in the following function, X being a 2 dimensional variable:
f(C) = C[0]exp(X[0]) + C[1]exp(X[1])
I should declare my function as:
void function_cx_1_func(const real_1d_array &C, const real_2d_array &x, double &func, void *ptr) {
func = C[0]*exp(x[0][0]) + C[1]*exp(x[0][1]); }
Is it right or did I miss something? Do I proceed the same to use "3d" points (x[0][0], x[0][1], x[0][2])?
Any help would be greatly appreciated. Thank you in advance for your answer.
|