The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 fitting with 2 ind. and 2 dep. variables
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

menhart@ii

USA
23 Posts

Posted - 03/18/2003 :  10:51:39 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
i have been deleloping a fitting fuinctiuon to deal with pairs of linked data sets. i use two independent and two dependent variables, and a pair of equations that share several parameters implimented in a y-script. it works fine.

the problems is that when the two data sets have different numbers of data points (i.e. all the time in reality) it only considers the minimum number. i.e. for a 7 and 12 data point pair, the last 5 points of the 12-point set are ignored.

Laurie

USA
404 Posts

Posted - 03/20/2003 :  12:28:53 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Nick,

Thank you for reporting this problem. Apparently this problem has always existed.

The probelm is as follows:

Let's say we define a fitting function as

y_1 = P1*x_1;
y_2 = P2*x_2;

with two independent (x_1 and x_2) and two dependent (y_1 and y_2) variables.

The way the function is written, we know that y_2 does not depend on x_1, but the NLSF does not know this. The NLSF believes that y_2 depends on both x_1 and x_2, so as soon as one of independents runs out of range - fitting stops.

To adress this issue we must provide a way to specify set of independent variables for every dependent one. This requires not only a change in our implementation of Levenberg-Marquardt but changes to the GUI as well.

This problem is tracked in our development database, to be considered for a future version.

Thank you.

OriginLab Technical Support
Go to Top of Page

menhart@ii

USA
23 Posts

Posted - 03/21/2003 :  12:31:23 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Ok, well in the GUI, we DO link the x's with the y's... in the dataset dialog, you have to select an x for every y, and they are linked exactly as you said, x1 with y1, x2 with y2. In fact when I click to assign y, it automatically determines, correctly, which x to choose. And even assigns the range appropriately. So LM should produce y1 for the N1 x1's, and then y2 for the N2 x2's, then calculate ssq. and minimize etc.

I don't see why this is a problem... the argument about not knowing which goes with which applies to parameters, which I understand and agree with. For instance in my case, I have 6 parameters, of which 4 are common, and 2 of which only applies to one of the two y?s. But clearly it knows which go with which, since the values are completely different (i.e. none of the x1's are identical to any of the x2's) but are sense appropriately ? this demonstrated by the fact that the calculated values (in FIT or even in SIMULATE) use the appropriate dataset. So some parts of the program clearly do associate individual y?s with x?s and know which goes with which.

This knowledge is, as you say, not transferred to the NLSF engine appropriately. Clearly you iterate over some range, calculating each y from the parameters and the x?s. You seem to be saying that you treat the x?s as unlinked in the NLSF (which is useful in some cases - but not here). As NLSF goes through, it iterates over x1[1]?x1[N1] and then clearly starts over again at x2[1] - I know this must happen, since both y1 and y2 are done properly as far as it goes. Only the iterations of x2 stop at x2[N1] not x2[N2]. If they were truly independent, as you claim (i.e. 2d data fitting of surfaces? I don?t think you offer that, do you?), then wouldn?t it do N1*N2 iterations, and get all the points properly? It seems this must be the case when fitting things of the type z=f(x,y), which I know origin does just fine. Perhaps I can include a dummy term in each equation (i.e. of the type y1= f(P,x1) + x2 ? x2 and y2= f(P,x2) + x1 ? x1)

It seems to me that the underlying problem with your range variable, which although reported independently in the dataset dialog, doesn?t seem to be transferred to the NLSF engine appropriately. You seem to a scalar range variable, where you need a vector range just as you have a vector of parameters or a vector of dependent variables or a vector of independent variables.
Go to Top of Page

menhart@ii

USA
23 Posts

Posted - 03/21/2003 :  2:26:58 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
(i.e. of the type y1= f(P,x1) + x2 ? x2 and y2= f(P,x2) + x1 ? x1)
should be
(i.e. of the type y1= f(P,x1) + x2 - x2 and y2= f(P,x2) + x1 - x1)

i guess this doesn't cut and paste from Word too well. non-standard dashes...
Go to Top of Page

YimingChen

1691 Posts

Posted - 09/18/2019 :  11:52:49 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

We have a new app to fit multiple sets of data with multiple fitting functions with shared parameters. Please try and see if the issue is still there.
https://www.originlab.com/FileExchange/details.aspx?fid=475

You need Origin 2019 or later to run the app.

James


Edited by - YimingChen on 09/18/2019 11:53:20 AM
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000