forum.alglib.net
http://forum.alglib.net/

TaskRCond Definition
http://forum.alglib.net/viewtopic.php?f=2&t=115
Page 1 of 1

Author:  ERE12345 [ Mon Nov 08, 2010 10:49 pm ]
Post subject:  TaskRCond Definition

Hello, I just started testing out alglib and I'm trying to some polynomial fitting. I'm comparing my results to what a coworker got with the JMP tool. I need to get an RSquare value to do this and polynomialfitreport.TaskRCond attribute seems to be close to this, but my numbers are way off. Here's my VB code. xtime and Y1 have already been properly populated and a quadratic equation should fit the data well.

Dim BCInterpolant As New alglib.barycentricinterpolant
Dim FitRpt As New alglib.polynomialfitreport
alglib.polynomialfit(XTime, Y1, XTime.Length - 1, 3, info, BCInterpolant, FitRpt)
Dim a2() As Double
alglib.polynomialbar2pow(BCInterpolant, a2)
Dim RSquare As Double = FitRpt.taskrcond * FitRpt.taskrcond

The JMP RSquare value was 0.9974 and my "RSquare" value above as calculated is 0.1977. Am I misinterpreting the purpose of taskrcond? Thanks for your help.

Author:  Sergey.Bochkanov [ Tue Nov 09, 2010 7:58 am ]
Post subject:  Re: TaskRCond Definition

TaskRCond has another meaning - it is reciprocal of condition number of linear system solved by algorithm. It is always between 0 (degenerate system) and 1 (well conditioned system). So you've misinterpreted it.

ALGLIB 3.1 does not support RSquare, so you have to calculate it yourself.

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/