[SciPy-user] linear regression

Robert Kern robert.kern@gmail....
Wed May 27 19:40:44 CDT 2009


On Wed, May 27, 2009 at 19:24,  <josef.pktd@gmail.com> wrote:

> after removing the weighting in your example to get plain OLS, I get
>
>>>> bodr, bols = random_betas(5000)
>>>> bols.mean(1)
> array([-0.4757033 ,  5.46418868])
>>>> bodr.mean(1)
> array([-0.48364392,  5.49508047])
>>>> bodr.mean(1)-beta_true
> array([-0.00403564,  0.01834022])
>>>> bols.mean(1)-beta_true
> array([ 0.00390498, -0.01255157])

I suspect the unweighted OLS performs well because of the structure of
the uncertainties. If you replace p_sy with a uniform 0.03, for
example, and use unweighted OLS, you get a lopsided distribution
though not one with a pronounced spur like the weighted OLS. The mean
does not appear to be converging, either.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco


More information about the SciPy-user mailing list