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

Optimising lsfitlinear
http://forum.alglib.net/viewtopic.php?f=2&t=811
Page 1 of 1

Author:  andyste1 [ Tue Apr 09, 2013 2:06 pm ]
Post subject:  Optimising lsfitlinear

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 };

Author:  Sergey.Bochkanov [ Tue Apr 09, 2013 5:54 pm ]
Post subject:  Re: Optimising lsfitlinear

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.

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