LinearRegression Standard Package
- To: mathgroup at smc.vnet.net
- Subject: [mg20753] LinearRegression Standard Package
- From: "DIAMOND Mark" <noname at noname.com>
- Date: Wed, 10 Nov 1999 00:17:59 -0500
- Organization: The University of Western Australia
- Sender: owner-wri-mathgroup at wolfram.com
I want to perform a series of weighted linear regressions with the same data
set. Sometimes I want to exclude some data points from the regression. I had
thought that this might be accomplished by weighting that point to zero, as
in the following example.
Needs["Statistics`LinearRegression`"]
data = {2, 3, 4, 5, 6};
w = {1, 1, 0, 1, 1};
Regress[data, {1, x}, x, Weights -> w]
However, this results in the error message
Power::infy Infinite expression 1/0 encountered.
Question 1: I presume that, in essence, this is because minimizing the sums
of 0*(yhat - a -bx)^2 is indeterminate for 'a' and 'b'. Am I correct in my
presumption?
Question 2: I have side stepped the problem by using $MinMachinePrecision
instead of a zero weight? All the other weights are many orders of magnitude
higher, but what problems if any might my inelegant cause me and what more
sensible way should I go about this?
Many thanks
mark diamond
no spam email: markd at psy dot uwa dot edu dot au