T O P I C R E V I E W |
Passenger82 |
Posted - 04/04/2014 : 07:32:50 AM Using Origin 9.0 Pro:
Hello,
I have a problem and Im running out of ideas to solve it. I'd like to fit multiple data sets and want the fitting parameters to be kind of "sorted", "connected" or "dependent".
In other words: I have calculated data which can be approximated by a sum different, overlapping gaussfunctions and I want to fit using a self-defined fitting function. So far so good. This works quite well.
The function (for example): y=y0+AL*exp(0.5*((x-xcL)/sigmaL)^2)+AR*exp(0.5*((x-xcR)/sigmaR)^2)
I now have these functions calculated for different szenarios (several time steps). If all these data are displayed in one plot, origin offers the possibility of "global fitting", so that I can fit the multiple data set at once. This means I get xcL, xcL_2, xcL_3,.. and so on. I 'd now like to introduce some sort of linear constrains to describe the movement of a peak in -x-direction. So I want a parameter xcL for data set 1 to be greatest, for data set 2 to be smaller than "xcL" for data set 1, an so on. I therefore tried to add some contraints to the fitting function, like this: "xcL<xcL_2;" or "xcL_2<xcL_3;" with "_(number)" indicating which data set is active. But for some reason it doesn't work.
Is there a good tutorial how to use the linear contraints for the multiple fitting of data sets?
I know this text is weird, I just don't know how to explain it in a better way... |
8 L A T E S T R E P L I E S (Newest First) |
snowli |
Posted - 04/11/2014 : 09:38:27 AM Hi Passenger82,
Could you still send the opj and fdf to tech@originlab.com so someone can see if there are workaround and suggestions for you? E.g. the boundary for xA_10 can be removed and modify the linear constraint to mark <4.5E-9 at the end, etc.
Zheng put the jira link here just as a reference so that in the future it's easier for both you and us to refer to this issue and also inform you when it's fixed.
Sincerely, Snow OriginLab Corp. |
Passenger82 |
Posted - 04/11/2014 : 04:22:30 AM Thank you for your response.
@lkb0221: It seems I need a separate Atlassian OnDemand Account to view the mentioned list of problems. Nevertheless it is interessting to know that there is a certain problem regarding the fitting process with both boundaries and constraints.
@snowli: Since there seems to be a problem in the fitting procedure (Post of lbk0221)....Do you still want to get the dataset and the fitting function? Is there a special Email address I would send these files to?
Generally I want to thank all of you for your support and your cooperativeness. I'm looking forward to the release of the forthcoming patch. |
lkb0221 |
Posted - 04/10/2014 : 2:41:10 PM Hi,
We do have found some problems when there are both boundaries and linear constraints. Problems are listed here: https://originlab.jira.com/browse/ORG-10956
Our development team is working on it, and we are so sorry about the confusing and inconvenience.
Zheng OriginLab |
snowli |
Posted - 04/09/2014 : 12:24:50 PM Hi Passenger82,
Sorry for replying late. I did delete my reply since I felt Meili has replied what I mentioned.
Origin considers both boundaries and linear constraints when doing fitting. But I do see some issues as you described. e.g. click fit till converged does nothing while click 1 iteration can still fit one step at a time. In such case, fit fails to converge so it may randomly fit one step at a time and give some values without considering boundaries. I will check with developer how to improve this.
Also, you could try set all boundaries in Linear Constraints part to make boundaries considered when doing iterations. But as I mentioned if some constrains cause fit to fail, some constraint conditions may not be working either. Maybe you could try to set less constrains?
At the same time, could you send your opj and also fdf file defined so we can take a look to see how to fit with the constrains and boundaries you set.
Sincerely, Snow OriginLab Corp. |
Passenger82 |
Posted - 04/07/2014 : 05:54:53 AM Hi,
I have tried some other approaches, especially the one posted by snowli (has snowli's post been deleted?).
I made sure, that the "Enable linear contraints" checkbox was checked and that the syntax was correct.
After that I tried to fit the ten data sets in global fitting mode and made the following observations: - The Fit does not converge, but if you keep up klicking the 1-iterations the curves become better and better
- If the linear constraints are activated, the fitting procedure seems to ignore the upper and lower boundaries! Do the linear contraints override the boundary limitations?
- Because if I uncheck the linear contraints the parameters immediately are adjusted to values within the boundaries in the next iteration.
So, the open question remains: Is there a possibility to get BOTH the upper/lower boundaries AND the linear contraints working the same time? |
meili_yang |
Posted - 04/04/2014 : 11:21:08 AM Hi Passenger82,
The linear constrains should work. I am just curious, have you check the "Enable Linear Constrains" checkbox? When you select Constrains, the check box is right under the tab "Code".
Thanks,
Meili OriginLab Tech Support |
Passenger82 |
Posted - 04/04/2014 : 10:32:53 AM Thanks for the reply.
I have done that, and also looked up a couple of tutorials how these contraints have to be declared and how they work. But unfortunately they don't work for me.
If I have 10 datasets and want to fit all these datasets with the function shown in the first post using the global fitting mode, then I get (among the other parameters) ten values for "xcL".
xcL, xcL_2, xcL_3, xcL_4, xcL_5, xcL_6, xcL_7, xcL_8, xcL_9, xcL_10
I would like to apply some contraints to the fitting function, e.g. that the value of "xcL_n" has to decrease for increasing "n".
I tried several approaches, like "xcL<xcL_2; xcL_2<xcL_3; xcL_3<xcL_4; ..." which does not work. I also tried "xcL(n)<xcL(n+1), n=1..9", but this doesn't work, too.
Of course the success of the fit also depends on the (starting) values for the fitting parameter, but these values seem to be right. If I fit every single data set, the values (more or less) work for the fit.
Am I doing something wrong? What is the correct syntax for the contraints? |
lkb0221 |
Posted - 04/04/2014 : 10:04:53 AM Hi,
Linear constraint shall not be defined inside the fitting function. Please go to Code tab in NLFit dialog, Constraints node. And follow the Hints(n) in the lower panel.
Zheng OriginLab |
|
|