Borrar filtros
Borrar filtros

Weighted Least Square Regression

3 visualizaciones (últimos 30 días)
Raziur Rahman
Raziur Rahman el 5 de Jun. de 2015
Respondida: Star Strider el 6 de Jun. de 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.

Respuestas (1)

Star Strider
Star Strider el 6 de Jun. de 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