forum.alglib.net

ALGLIB forum
It is currently Thu Dec 08, 2022 6:27 am

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  [ 2 posts ] 
Author Message
 Post subject: Optimising lsfitlinear
PostPosted: Tue Apr 09, 2013 2:06 pm 
Offline

Joined: Tue Feb 26, 2013 9:00 am
Posts: 6
This is a long shot, but I'm wondering if there is anything I can do to optimise/improve the performance of the "lsfitlinear" method? I'm developing a .Net application that runs many different calculations on thousands of data points. One of these calculations involves a call to "lsfitlinear", and a .Net profiler tool shows these calls as accounting for half of the overall time spent in my calculation routine.

Typical usage scenario: my routine calls lsfitlinear around 5000 times, most times passing it just two values. The following is a typical example:-

var fmatrix = new double[,] { { 1, 0 }, { 1, 5 } };
var y = new double[] { 2623.203, 7202.05 };


Top
 Profile  
 
 Post subject: Re: Optimising lsfitlinear
PostPosted: Tue Apr 09, 2013 5:54 pm 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 880
Do you have guarantee that:
* you always have 2 points, 2 unknowns?
* fmatrix is non-degenerate and well conditioned?

If so, you may just solve it as "conventional" linear system with 2 unknowns and 2 equations. lsfitlinear() is optimized for medium and large problems (10-100-1000 points, 10-100-1000 parameters). It works for such tiny systems, but it is overkill.


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

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 1 guest


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