Weighted Least Square Regression
조회 수: 3 (최근 30일)
이전 댓글 표시
I have a x matrix with 5 columns and Y matrix with one column of values. I want to minimize this function for all observations:sum(y-sum(alpha*x))^2. Which function can do this thing? I want to have the values of alpha and sum of alpha will be one.
댓글 수: 0
답변 (1개)
Star Strider
2015년 6월 6일
I don’t understand your equation. Weighted least squares requires:
WSSCF = sum(w.*(y-f(x)).^2); % Weighted Least Squares Cost Function
where ‘w’ is the vector of weights, and f(x) is actually a function of ‘x’ that maps ‘x’ to ‘y’. (This is schematic only. The actual function f(b,x) is a function of the parameters ‘b’ as well.
There are several linear and nonlinear parameter estimation functions that can do what you want, but the one you use depends on the nature of your data, the toolboxes you have available, and the model you want to use to fit it.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Linear Regression에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!