Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X
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.
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).
Could you show me how to plot an expfit() function first . I am trying to plot it in MathCAD.
OK, but I can't plot an expfit function if I don't have data to fit it to
Please see in attachment (this worksheet is taken from "Mathcad Help").
Have you read the Mathcad Help files on using that function and curve fitting in general?
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.
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.
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
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))