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
 All Forums
 Origin Forum
 Origin Forum
 Integer fitting parameter

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
karvek Posted - 07/06/2016 : 08:58:09 AM
Origin Ver.9.1SR2
Operating System: Windows 7

Hallo,

I wrote a function in Origin C and I am trying to fit, everything looks fine.
However is it possible to force one (or more) fitting parameter to be an integer?
I mean, REALLY an integer, not just setting the number of significant digits to 1.

Thanks!
G.
7   L A T E S T    R E P L I E S    (Newest First)
Hideo Fujii Posted - 07/14/2016 : 3:31:43 PM
Hi karvek,

I was thinking a smooth function like below instead of int() (or floor()). This may
lead fitting to convergence, then after fitting, you can round down the parameter:



--Hideo Fujii
OriginLab
Chris D Posted - 07/13/2016 : 08:59:42 AM
Hi,

You cannot modify a parameter value within the fitting function body. Well, technically you can within the function body, but the changed value will not propagate back out of the function.

If you look at how the fitting function is defined, parameters are passed in to the function by value and not by reference. Hence whatever change you make to them within the function don't effect the value of the parameters that the fitter chose when it calls the function during iteration.

Thanks,
Chris Drozdowski
Originlab Technical Support
Hideo Fujii Posted - 07/12/2016 : 4:33:51 PM
Hi karvek,

Sorry, although floor(p1) would make the function compilable, but anyway it may never converge - hill climbing
will probably always hit a wall.I wonder if you can find a function similar to a step function, but which is smooth,
but I'm not certain.

--Hideo Fujii
OriginLab
karvek Posted - 07/12/2016 : 08:22:37 AM
Hi Hideo,

Unfortunately when I substitute p1 with int(p1) my Origin C fail to compile. It says Error, function or variable int not found.
I think you cannot force it, at least not this way.

The idea of taking the better Chi^2 was already developing in my mind but my actual concern is, as you can see, fixing the paramter to be integer.

Nevertheless thanks a lot for support, any additional hint will be really appreciated.
Hideo Fujii Posted - 07/11/2016 : 10:57:27 AM
Hi karvek,

Can you replace, say for parameter p1, in your function definition with int(p1)? If this failed to
converge, how about taking either int(p1) or int(p1)+1, whichever gives the better Chi^2 after
finding p1? (Though I'm not sure this is practically okay, or not.)

--Hideo Fujii
OriginLab
karvek Posted - 07/11/2016 : 07:44:11 AM
Hi,

is there any alternative way to write the fitting function to have integer parameters?
I mean by using expression, equation or LabTalk script.
Chris D Posted - 07/06/2016 : 1:59:39 PM
Hi,

Origin C fitting parameters are always double data type. You can't specify them as actual integer type.

Thanks,
Chris Drozdowski
Originlab Technical Support

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000