Author |
Topic |
|
hr829
15 Posts |
Posted - 09/13/2011 : 09:26:36 AM
|
I have a set of experimental data and model data that represent an "ideal model" for the experiment. The "ideal model" can not be represented by any well behaved function or polynomial.
Is there a way I can use to do non-linear least squares fit of the data to the model without using a function or writing code?
I have Origin 8.5 SR2 on a Win7 machine.
|
|
Hideo Fujii
USA
1582 Posts |
Posted - 09/13/2011 : 09:57:18 AM
|
Hi hr829,
Though I might have misunderstood off from what you meant, when you wrote of "non-linear least squares fit without using a function", it sounds self-contradictory for me. For the experimental data, maybe you can consider smoothing/filtering, or simply apply Spline/B-Spline connection?
--Hideo Fujii OriginLab |
Edited by - Hideo Fujii on 09/13/2011 09:59:39 AM |
|
|
hr829
15 Posts |
Posted - 09/13/2011 : 10:21:55 AM
|
This is what I mean:
I have a set of experimental data H. H is a matrix containing (x,yexperiment) data gathered from an instrument.
I have a set of corresponding set of model data M (x,ymodel) data generated from a complicated atmospheric model that can not be represented with a well defined function.
Origin minimizes the difference (RSS error) between the experiment H and a model function to get the best fit between the data and that function (see for example: Origin-Help-Topics-Illustration of the Least Squares Method).
I need to minimize the difference (error) between the experiment H and the model data M - not a function.
How can I use the Non linear curve fit (NLFit) dialog without using a function in the drop down menu? The dialog box asks for either a predefined Origin function or a user generated function.
I can do it by writing C-code but is there another (faster) way to do this in Origin?
|
|
|
Sam Fang
293 Posts |
Posted - 09/14/2011 : 08:32:52 AM
|
Hi hr829,
I still not really understand your question.
Can you give me the formula to calculate the difference (error) between the experiment H and the model data M? Then we can see whether it can be done in Origin.
Thanks.
Sam OriginLab Technical Services |
|
|
hr829
15 Posts |
Posted - 09/14/2011 : 09:15:56 AM
|
The formula is the same whether you are fitting to a function or a data model. You are minimizing the difference between the observations and the model. Just look at Origin Help least squares for more details where this image it taken from.
However, when you try to use the Analysis > Fitting > Non linear curvefit menu the dialog box that comes up requires the user to either choose a predefined Origin function or supply a user function. I can not use a predefined Origin function or supply a user function. I just have a bunch of data points that represent my model. How can I make Origin use those points instead?
This can be accomplished by writing some code. I just thought Origin may provide an easy way to do this.
|
|
|
Hideo Fujii
USA
1582 Posts |
Posted - 09/14/2011 : 10:37:33 AM
|
Hi hr829#12289;
As you wrote that you have "a set of experimental data" and "a set of corresponding set of model data", what I thought was that you have one experimental xy datum and multiple xy model data, and want to find a way either to choose a best model among them, or by some way to find a best middle ground among them (e.g., consider a linear combination of model "data-based" functions but not limited to this linear estimation). Is either case correctly your task?
IF it is the later case, Origin can treat an xy dataset as a function, and you can fit the target experimental data with a combination of model functions. You can see a sample in the following tutorial: http://wiki.originlab.com/~originla/howto/index.php?title=Tutorial:Fitting_Datasets So, by doing this, you get a set of parameters how to combine the models by Origin's fitting feature.
IF it is the first case, you probably need a (relatively simple) script or an Origin C program.
Sorry, if I still misunderstood your intention.
--Hideo Fujii OriginLab |
|
|
|
Topic |
|