Demo Weighted Nonlinear Regression (Statistics Toolbox)

In the Statistics toolbox Demo "Weighted Nonlinear Regression" the weights are normilized w = w / mean(w), but when applied to the data the square root of the normilized weights are used modelFunw = @(b,x) sqrt(w).*modelFun(b,x);
Why use the sqrt(w) and not just w? Should you always use sqrt(w)? The demo provided no explantion as to why sqrt(w) was used. Can someone provide an explantion?
I'm trying to apply this to the heavly weighted NHANES database.

 Respuesta aceptada

Tom Lane
Tom Lane el 16 de Mzo. de 2012
Weighted least squares means we want to minimize
sum over i of w(i) * {y(i)-yfit(i)}^2
You can write this by multiplying both y and yfit by sqrt(w), inside the thing in {} that is squared.

Más respuestas (0)

Categorías

Más información sobre Statistics and Machine Learning Toolbox en Centro de ayuda y File Exchange.

Preguntada:

el 16 de Mzo. de 2012

Community Treasure Hunt

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

Start Hunting!

Translated by