The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 Fit data where y is independent variable
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

sestes

USA
Posts

Posted - 12/09/2011 :  8:42:26 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I would like to fit the following data:

x,y
18.52421, 2
27.62332, 4
9.07731, 6
4.29332, 8
14.93523, 10
4.89243, 12
10.43479, 14
6.50662, 16
0.66017, 18
2.73978, 20.875

using the function x = (a*exp(-s*y)) + b (y is the independent variable). I added this equation correctly as a non-linear user defined function. If I perform a least-squares analysis manually, the calculated S parameter is 0.249. However, if I use the user defined function, the fit calculated in Origin is incorrect. If I plot the data traditionally with x as the independent variable, and use the built in exponential function (which agrees with my defined function), I get a correct fit. Why am I unable to fit the data with y as the independent variable?

Thanks!

Hideo Fujii

USA
1582 Posts

Posted - 12/12/2011 :  5:05:45 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi sestes,

If you fit directly from a worksheet, it shouldn't matter - just a matter which column is independent, and which is dependent. If you want to fit from a plot, the situation should be the same - just a matter of the assignment of the in/dependent variables to the datasets.
However, if you want to add the fitted curve (result) on the original graph, your input data plot should be arranged as independent variable for the horizontal axis, dependent for the vertical axis. I think this is by design.



I hope this answers to your question.

--Hideo Fujii
OriginLab
Go to Top of Page

sestes

USA
Posts

Posted - 12/12/2011 :  11:14:18 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Hideo,

Thanks for the reply. The solution you showed in your reply is what I ended up using. However, what I'd really like is to have the fitted data plotted with the independent variable on the vertical axis. The reason is that the y-data given in my original post represents depth, so it is easier to visualize depth dependent changes when depth is plotted vertically. I can get a fit to converge when the is data plotted in this manner, but the fit is incorrect. You stated that having the x-axis as the independent variable is "by design" -- which is the norm in the scientific community anyway. However, do you think there is any way of getting around this?



Shanna
Go to Top of Page

sestes

USA
Posts

Posted - 12/12/2011 :  11:40:32 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Hideo ... again -

I just found a nifty feature ... "exchange x-y axes" under the graph menu. I can fit the data in the traditional way ... independent variable on the x-axis and then exchange the axes. This give me exactly what I was looking for. Thanks for your help!
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000