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

 Page 1 of 1 [ 2 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: Optimising lsfitlinearPosted: Tue Apr 09, 2013 2:06 pm

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

 Post subject: Re: Optimising lsfitlinearPosted: Tue Apr 09, 2013 5:54 pm

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

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 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 forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for: