performing a least squares with regularisation in matlab
21 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have data sets X (2n by 8) and Y(2n by 1). I want to find the coefficients a so that Y = Xa. So we can perform a = X\Y (as a least squares minimisation).
I wanted to ask if it possible to proceed with a form of regularisation (L1 or something simple) from this?
Please help.
1 comentario
SAKO
el 25 de Oct. de 2024
Movida: Bruno Luong
el 26 de Oct. de 2024 a las 7:44
bonjours,je n'écris pas pour repondre a une question mais pour poser ma préoccupation.j'ai utiliser le package TOOL BOX de Per Christian Hansen pour faire une reconstruction de force.Avec la regularisation de Tikhonov pour le critère L_curve,le paramètre de regularisation qu'il me renvoi ne me permet pas de reconstruire ma force(ma courbe L_curve presente deux coins).Pouvez vous m'aider ?
Respuestas (2)
Diwakar
el 13 de Jul. de 2018
My understanding of your problem is that you want to find the coefficient a. So in order to implement optimization you can implement average of sum of least squares as shown below.
Loss= ((Y-X*a)'*(Y-X*a))/(2*n);
The above shown function is a vectorized implementation of the squared error loss function. So this can be minimized in order to get the optimal value of a. If you want to fit a curve to this then any form of regularization should be fine.
Hope this helps
Cheers!
1 comentario
Bruno Luong
el 23 de Sept. de 2020
Editada: Bruno Luong
el 23 de Sept. de 2020
Simpless method:
n = size(X,2); % 8
lambda = 1e-6; % <= regularization parameter, 0 no regularization, larger value stronger regularized solution
a = [X; lambda*eye(n)] \ [Y; zeros(n,1)]
1 comentario
Ver también
Categorías
Más información sobre Mathematics and Optimization en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!