forum.alglib.net

ALGLIB forum
It is currently Thu Mar 28, 2024 8:29 pm

All times are UTC


Forum rules


1. This forum can be used for discussion of both ALGLIB-related and general numerical analysis questions
2. This forum is English-only - postings in other languages will be removed.



Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Help lsfitcreatefg with multivariate function
PostPosted: Mon Feb 16, 2015 8:27 am 
Offline

Joined: Mon Feb 16, 2015 7:41 am
Posts: 1
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 60 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group