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

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Exponential Fit Curve Help

nanay
1-Newbie

Exponential Fit Curve Help

Hello,

I am trying to create a best-fit curve for a data set. I have imported two excelsheets containg the data into Mathcad. Each excel contains 1066 intergers. I have plotted them using the x-yplot functionality. The plot appears to follow an exponential projection. So, I tried to obtain exponential fit curve using the expfit() function. However, the fit function that I obtained is not correct, because it does not fit the data.

Please advise what I shoulddo to obtain the proper exponential fit curve.

10 REPLIES 10
RichardJ
19-Tanzanite
(To:nanay)

Please post a worksheet with the data. We can show you how to perform a generalized fit that can be applied to any function (but I don't know what that function might be without seeing the data).

nanay
1-Newbie
(To:RichardJ)

Could you show me how to plot an expfit() function first . I am trying to plot it in MathCAD.

RichardJ
19-Tanzanite
(To:nanay)

OK, but I can't plot an expfit function if I don't have data to fit it to

VladimirN
24-Ruby II
(To:nanay)

Please see in attachment (this worksheet is taken from "Mathcad Help").

MichaelH
1-Newbie
(To:nanay)

Have you read the Mathcad Help files on using that function and curve fitting in general?

May be this help you: See attach.

Hello Jan Kowalski,

Thanks for sending me your sample mathcad files. They have been very helpful.

Now, I am trying to come up with a correlation coefficient associated with the curve fits. I tried using the function corr(A,B), as explained in the Mathcad Help site. However, I am not sure if I am using this fucntion correctly. How do I link the corr function with the fit curve? Are the varibable A, B supposed to be the raw data, or should I use the data from the curve fit? Please explain.

Werner_E
24-Ruby V
(To:nanay)

It would be time you begin attaching worksheets, don't you think so, too?

Are the varibable A, B supposed to be the raw data, or should I use the data from the curve fit?

Both! As you want to compare the original data (Y) to the fit data you get by the derived function H, you have to throw both into the corr function. First you have to create an apprpriate vector of fit values.

In lack of a sheet from yours I have taken one of the sheet Jan has provided to demonstrate.

Werner_E
24-Ruby V
(To:nanay)

Please be aware however that the correlation is no measure of a good fit. You will get exactly the same correlation value if you multiply Y by any constant.

A measure of fit would be the sum of square of difference between Y and fitData

leastsqu.png

0 would mean a perfect fit (identity).

Better use the mean squared error as it takes in account the number of points. This would be the above divided by the number of points (length(Y))

Top Tags