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

lsfitlinear does not solve a problem
http://forum.alglib.net/viewtopic.php?f=2&t=1028
Page 1 of 1

Author:  jore [ Sat Oct 19, 2013 9:54 am ]
Post subject:  lsfitlinear does not solve a problem

Hello,

I am using lsfitlinear with 2 different parameters:

y[] = {10,15,20,5};
fmatrix[,] = {
{1, 36.95, -5.95E-36},
{1, 38.33, -2.89 E-37},
{1, 38.59, -1.62E-37},
{1, 39.84, -1.06E-38}
}

and

y[] = {10,15,20,5};
fmatrix[,] = {
{1, 36.95, -4.94E-36},
{1, 38.33, -2.39E-37},
{1, 38.59, -1.33E-37},
{1, 39.84, -8.67E-39}
}

The first one is solved and the second one fails. I have also checked that if the values in the matrix are too big, for example 1E24 the problem is again the same, in the while loop in line #19222 in interpolation.cs the loop for the spdmatrixcholeskyinverse() runs until the matrix has infinite number and then goes to exception. Is this the correct behaviour? Probably I am not allowed to use such small positive numbers (or in the case of values like 1E24 I should not use such high numbers)?

thank you

Author:  Sergey.Bochkanov [ Tue Oct 22, 2013 11:15 am ]
Post subject:  Re: lsfitlinear does not solve a problem

The problem is that last column of your system is highly degenerate because of last, almost-zero column. ALGLIB decides to drop last column from consideration, which forces algorithm to give inexact solution.

If you want, you may scale (normalize) your columns prior to passing them to lsfitlinear(). it will solve problem.

Author:  jore [ Tue Oct 22, 2013 12:12 pm ]
Post subject:  Re: lsfitlinear does not solve a problem

thank you for your response. I will normalize them

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