r/matlab•
attackcat

Multiple linear regression with weights

In my data, I want to predict f from variables x, y, z. I have many points, but I would like to give each point a weighting in the regression. Does anyone know a way to do this?

Posted Aug 22, 2011, 10:55 PM UTC

33
RobotBodiesBFF•

If you have the stats toolbox.
http://www.mathworks.com/help/toolbox/stats/bq_w_hm.html#braa3a4-1

Otherwise, google "multivariate least squares regression matlab" and you'll find some 3rd party toolboxes or functions that will get the job done.

1
duckandcover•

Scale the rows by your weights, i.e give wi as the weight for (xi,yi,zi) ( for equation/row axi+byi=zi ) use (xi',yi',zi') instead where xi'=xi * wi,yi'=yi * wi, zi'=zi * wi.

1