linear least square optimization method that benefits from good start value?

2 vues (au cours des 30 derniers jours)
Peter
Peter le 8 Août 2013
i'm solving the unconstrained least square problem (min |Cx -d)|^2 with lsqlin:
tic
[x] = lsqlin(C,d,[],[],[],[],[],[],[]);
toc
tic
[x2] = lsqlin(C,d,[],[],[],[],[],[],[x]);
toc
I will have a quite decent start value for x in my problem. In order to figure out whether lsqlin really benefits from a good start value, I used the solution as the start value and ran lsqlin again, see code. Solving took just as long (appr 20 seconds) the second time, probably because no iteration is involved. So obviously this is not the way to handle my problem. Can anyone advice me on a method to solve this type of problem, that does benefit from a good start value for x? many thanks, P

Réponses (2)

Alan Weiss
Alan Weiss le 8 Août 2013
I believe that if you do not include any constraints in your problem, lsqlin simply calls backslash:
x = C\d;
The starting point in this case is ignored. See for yourself:
edit lsqlin
While there might possibly be a faster way, all I can think is that you might as well just use backslash. I have no better advice for you in this case, sorry.
Alan Weiss
MATLAB mathematical toolbox documentation
  1 commentaire
Peter
Peter le 9 Août 2013
thanks Alan, backslash is what I used first but there's hardly any difference.

Connectez-vous pour commenter.


John D'Errico
John D'Errico le 8 Août 2013
Simple linear least squares has no need for a good starting value. Backslash won't run any faster. And there is no real need to use lsqlin with no constraints at all. backslash should be faster then anyway, since the additional overhead of lsqlin is removed.
If your problem is really large enough to take a long time, are you using sparse matrices? If it is sparse and you are not, then why not?
Big problems take time to solve. Just wanting it to run faster is tough to achieve unless you are willing to invest money in a faster computer.
  2 commentaires
Peter
Peter le 9 Août 2013
Hi John, thanks for your answer. C is not sparse unfortunately and backslash is hardly any faster.
Richard Brown
Richard Brown le 9 Août 2013
out of curiosity, what size is your matrix C?

Connectez-vous pour commenter.

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by