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.
|