MathGroup Archive 2013

[Date Index] [Thread Index] [Author Index]

Search the Archive

Error in slope and intercept

  • To: mathgroup at
  • Subject: [mg131773] Error in slope and intercept
  • From: Gebbo <nicolasgebbo at>
  • Date: Wed, 2 Oct 2013 05:53:56 -0400 (EDT)
  • Delivered-to:
  • Delivered-to:
  • Delivered-to:
  • Delivered-to:

I was informing myself about linear regression with error in both observables and  found this algorithm: (Weighted Orthogonal Regression by Alternating Least Squares)

worals[x_, y_, sx_, sy_] := Block[{a,b,f,z, u = 1/sx, v = 1/sy, w = (sy/sx)^2},
{a,b} = (y*v).PseudoInverse@{v,x*v}; f = #.#&[(a+b*x-y)v];
While[f > (z = (x*w + (y-a)b)/(b^2 + w);
           {a,b} = (y*v).PseudoInverse@{v,z*v};
           f = #.#&@Join[(z-x)u,(a+b*z-y)v])];

which gives me {chisquare, {intercept, slope}} as output.
This works prefectly fine but I'd like to get the error on slope and intercept. I don't understand enough about Mathematica or the theory behind this algorithm, so i would pref the solution or hinds our i can write it myself.
Thanks Gebbo

  • Prev by Date: Re: ProgressIndicator in ParallelTable problem, redux
  • Next by Date: Error on slope and intercept
  • Previous by thread: Re: Tick Values on Gauges
  • Next by thread: Re: Error in slope and intercept