T O P I C R E V I E W |
vldluca |
Posted - 10/26/2005 : 08:58:02 AM Origin Version (Select Help-->About Origin): 7.0 Operating System: Windows XP How I use my own fitting functions for Non-linear curve fitting? More precisely, the function which I want to use is f(x,a,b)=(x^(k-1)*exp(-x/a))/((b^a)*Gamma(a)) with a>0 and b>0 parameters. Thanks! |
1 L A T E S T R E P L I E S (Newest First) |
easwar |
Posted - 10/26/2005 : 10:49:24 AM Hi,
1> If you do not have the latest service release for version 7, I suggest you get that first (http://www.originlab.com/index.aspx?s=9&lm=144)
2> Bring up NLSF tool and define your function as follows: -> check user-defined parameter names check box -> enter parameter names of a, b, k -> enter x and y for indep and dep var names -> Make sure the "Use Origin C" checkbox is checked -> in the function edit box, enter the expression: y=(x^(k-1)*exp(-x/a))/((b^a)*nag_gamma(a)) ; -> The above uses the NAG library and a header for that needs to be added. So click on the "Edit in Code Builder" button which opens the function in Code Builder Window -> Scroll to the top where the #include statements are, and add the following: #include <OC_NAG.h> -> Compile the function and click the "Return to NLSF" button -> Go to Options->Constraints page of NLSF tool and add your constraints -> Save the function - and try fittig to your data with initial guess values or your own initial parameter estimation codes
Easwar OriginLab
Edited by - easwar on 10/26/2005 10:53:19 AM |
|
|