cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can change your system assigned username to something more personal in your community settings. X

a question of parameter fitting in an experiment

FanCG
1-Newbie

a question of parameter fitting in an experiment

during recent experiments, I got some data like following figure.

y is the operating parameter of my experiment and z is what I wanna measure. x varies from 0 to 1

usually, such kind of data are usually fitted by an equation that looks like "z=F(y) exp[Σαi x^n]"or something others like this.

I tried to do this in mathcad twicely, but failed totally at last.

could anyone please help me solving the problem?

data fitting.JPG

1 ACCEPTED SOLUTION

Accepted Solutions
RichardJ
19-Tanzanite
(To:FanCG)

Here's a general way to fit multidimensional data. It will work with any number of dimensions and any objective function, and does not need multidfit.

You need a different objective function to the one you specified though. That sum of exponentials cannot fit the shape of your curves in the x direction. You should be able to edit this worksheet easily enough to change that though.

View solution in original post

16 REPLIES 16
VladimirN
24-Ruby II
(To:FanCG)

Fan CG wrote:

...I tried to do this in mathcad twicely, but failed totally at last...

Could you attach your Mathcad worksheet?

Raiko
16-Pearl
(To:FanCG)

Hello,

maybe this sheet helps. Did it with MC 15 on a Win 7 (64 bit) machine

Raiko

FanCG
1-Newbie
(To:Raiko)

I tried this method at first, but later I found that I actually needed a 2D fitting result. The attached solution can only tell me the relationship between "x" and "z", but none of the business of "y". Maybe I need to resortma to matlab.

thanks for your help

Fred_Kohlhepp
23-Emerald I
(To:FanCG)

Fan CG wrote:

I tried this method at first, but later I found that I actually needed a 2D fitting result. The attached solution can only tell me the relationship between "x" and "z", but none of the business of "y". Maybe I need to resortma to matlab.

Perish the thought!

You can do regress in two dimensions:

thank you very much, Fred

I m not skillful at 2D fitting on mathcad platform.

your method gives a new commer a lot of help, and it can give excellent fitting results like following.

countor.JPG

but actually what i want to do is more like parameter estimation, or, in other words, using a known or proposed, relatively simple mathematic expression to fit experimental data, and finally to obtain a experiment correlation, not only using a complex polynomial to get very good approximations.

according to your solution, I used some codes from help file to extract the coefficients(see attached), and found that when a satisfied result is obtained, the fitting precision will be at least no less than 5. This will make the final polynomial complex.

Here's another approach.

Thank you Harvey

your idea is very close to mine, I failed at using minimize function.

but I m not sure which verion of mathcad you are using.

coz I can only read the first part of your solution

when you began to convert data to multidfit form for final fit of C, it was reported by my mathcad14 that "multdfit" is an undefined fuction.

I will study your solution tomorrow morning, now it is too late, I have to throw myself onto my bed

I'm using version 15. I tried sending a pdf file so you could at least see the results, but the upload seemed to stall.

Instead, here's a snip of the results.Capture.JPG

RichardJ
19-Tanzanite
(To:FanCG)

Here's a general way to fit multidimensional data. It will work with any number of dimensions and any objective function, and does not need multidfit.

You need a different objective function to the one you specified though. That sum of exponentials cannot fit the shape of your curves in the x direction. You should be able to edit this worksheet easily enough to change that though.

I used your method with the function I showed and got nearly the same results as multidfit. Your program for getting the residuals was the piece I was missing for using minerr. I've been struggling how to do that. Thanks.

FanCG
1-Newbie
(To:RichardJ)

according to your calculation, I think I should change my model at first, then continue the fitting. thx, I will look up some paper and have a try.

and BTW, I should divide the Y-values by 100, but I forgot

FanCG
1-Newbie
(To:RichardJ)

I looked through some paper, and modified the objective function.

and modified the units of y and z

as your prediction, the fitting results are much better than old versions. see following figures

eq.JPG

new model.JPG

The trend of data has been obtained, but the residuals at low Y values are still not very good.

Are there any better methods to improve the results?

should I add items like sin(x) or cos(x) into the objective function?

RichardJ
19-Tanzanite
(To:FanCG)

Are there any better methods to improve the results?

If you mean alternative fitting methods, no. What you have is the least squares solution. There are alternative criteria for what constitutes "best fit", but all you will get is a "better" fit in some places traded off against a "worse" fit in others. The problem is that you only have 4 degrees of freedom (i.e. 4 parameters) for a fit in 2 independent variables.


should I add items like sin(x) or cos(x) into the objective function?

You need more degrees of freedom, but I don't think sin and cos terms would be good choices. In an earlier post you said you were after parameter estimation. If that's the case then any additional terms must be based on the physics of the experiment. That could mean terms to account for the underlying physics, or terms to account for errors in the experimental procedure (an offset term might be a good example), but they cannot just be arbitrary.

Actually, degrees of freedom are the number of data points less the number of parameters. So he needs less degrees of freedom, more parameters.

Also, models may be based on theory or not. Either way, they contain parameters which usually require estimation.

Actually, degrees of freedom are the number of data points less the number of parameters. So he needs less degrees of freedom, more parameters.

Yes, true. I misspoke

Also, models may be based on theory or not. Either way, they contain parameters which usually require estimation.

However, Fan makes it clear in an earlier post that the purpose is parameter estimation to get parameters that correlate with the experiment. I thought it was clear that my comment was in that context.

FanCG
1-Newbie
(To:FanCG)

thanks a lot for both of you, and I will try to improve my job. I will show my results if there are any more improvements

Top Tags