performing a least squares with regularisation in matlab

조회 수: 26 (최근 30일)
cgo
cgo 2018년 7월 13일
이동: Bruno Luong 2024년 10월 26일
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
SAKO
SAKO 2024년 10월 25일
이동: Bruno Luong 2024년 10월 26일
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 ?

댓글을 달려면 로그인하십시오.

답변 (2개)

Diwakar
Diwakar 2018년 7월 13일
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
Sterling Baird
Sterling Baird 2020년 9월 23일
How would you actually implement the regularization though?

댓글을 달려면 로그인하십시오.


Bruno Luong
Bruno Luong 2020년 9월 23일
편집: Bruno Luong 2020년 9월 23일
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)]

카테고리

Help CenterFile Exchange에서 Mathematics and Optimization에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by