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 for Programming
 LabTalk Forum
 No access to Cov-Matrix in "After Fitting" script

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
khuber Posted - 11/24/2009 : 2:14:33 PM
Origin 8.0 SR6
Origin 8.1 SR0
Operating System: Windows XP

I imported an O7.5 fdf-file in O8.0 and O8.1
In the "After Fitting" script derived parameters and their errors are
calculated. For a correct error propagation calculation the Reduced
Chi Square and the Covariance Matrix is used.

Origin 8.0:
I have no access to Chi Square and the Covariance Matrix:
type $(nlsf.chiSqr) $(nlsf.varCovar(1,1);
prints
-- --

Origin 8.1:
Same as O8.0 and additionally all fitting parameters are not defined:
Variable not defined: A1
Variable not defined: A2
....

Thank you for interest!
Kurt Huber
2   L A T E S T    R E P L I E S    (Newest First)
khuber Posted - 11/27/2009 : 06:11:16 AM
Hallo Max,
thank you for the fast and detailed reply!

I think this will become a hard job for me as these FDF-files are
tools for lab class students and they all have different Origin
versions....

One problem remains (see first post, but now in O8.0 too):
with some FDFs I get all fit parameters undefined in the
"After Fitting" script. The fit runs well and the results are OK.
But this may become a new topic???

Kurt
minimax Posted - 11/25/2009 : 08:14:12 AM
Hi Kurt,

Origin8.0/8.1's fitting routine is updated to use a new procedure so that the old nlsf.xxx object is no longer available in the new fitting.

We introduce a new object matching Origin8's fitting tool, see some documentaions and examples:
http://wiki.originlab.com/~originla/wiki2/index.php?title=X-Function:Nlbegin

http://wiki.originlab.com/~originla/wiki2/index.php?title=X-Function:Getnlr

http://wiki.originlab.com/~originla/wiki/index.php?title=LabTalk:Curve_Fitting#Nonlinear_Fit

As you can notice, chiSqr quantity can be accessed through for example tt.chisqr

However, we are sorry that Covariance Matrix is missed in Origin8, we will try to fix the getnlr tool to receive the matrix data for the next release.

After fix, you should be able to access it using for example tt.covar(i,j)

Currently, there is a workaround to access those values, a similar but rather complicated tool, getresults:
http://wiki.originlab.com/~originla/wiki2/index.php?title=X-Function:Getresults

On the other hand, we introduce several reserved strings refering to the last fitting output:
http://wiki.originlab.com/~originla/wiki/index.php?title=LabTalk:Last_Used_System_Variables

For example:

__Report$: hierarchical report sheet;
__FitCurve$: fitted curve data sheet;
__Residual$: residual data sheet;

You can access them in the "After Fitting" script.

Specific to your case, following scripts can help:

getresults tr:=mytree iw:=__REPORT$;
// Before accessing such values, you should make sure the report sheet contains the data.
// For example, you should check Advanced page - Quantities tyo Compute - Covariance Matrix chekcbox to output the matrix data into the report sheet.
// mytree.=; can show all the contents of the tree
type $(mytree.RegStats.c1.ReducedChiSq);
type $(mytree.Covariance.Covariance1.col0.row0);


And after the fix, a simpler script can be used:

getnlr tr:=mytree iw:=__REPORT$;
// mytree.=; can show all the contents of the tree
type $(mytree.chisq);
type $(mytree.Covar[1,1]);



Max
OriginLab Technical Support

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