Azzera filtri
Azzera filtri

Weighted Least Square Regression

3 visualizzazioni (ultimi 30 giorni)
Raziur Rahman
Raziur Rahman il 5 Giu 2015
Risposto: Star Strider il 6 Giu 2015
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.

Risposte (1)

Star Strider
Star Strider il 6 Giu 2015
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.

Community Treasure Hunt

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

Start Hunting!

Translated by