forum.alglib.net

ALGLIB forum
It is currently Sat Apr 27, 2024 8:16 pm

All times are UTC


Forum rules


1. This forum can be used for discussion of both ALGLIB-related and general numerical analysis questions
2. This forum is English-only - postings in other languages will be removed.



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: lsfitlinear does not solve a problem
PostPosted: Sat Oct 19, 2013 9:54 am 
Offline

Joined: Sat Oct 19, 2013 9:34 am
Posts: 2
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


Top
 Profile  
 
 Post subject: Re: lsfitlinear does not solve a problem
PostPosted: Tue Oct 22, 2013 11:15 am 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 906
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.


Top
 Profile  
 
 Post subject: Re: lsfitlinear does not solve a problem
PostPosted: Tue Oct 22, 2013 12:12 pm 
Offline

Joined: Sat Oct 19, 2013 9:34 am
Posts: 2
thank you for your response. I will normalize them


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 330 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group