sumX is definitely not (necessarily) 0, no.

Let mx and my be the means of X and Y. To compute the centered sum of XY, we
are computing:
sum( (X-mx)(Y-my) )

This is

sum( XY - mx*Y - my*X + my*mx )
or
sum(XY) - sum(mx*Y) - sum(my*X) + sum(my*mx)
or
sum(XY) - mx*sum(Y) - my*sum(X) + n*my*mx

The last observation is that n*my = sum(Y) so you can cancel terms 2 and 4.
(Or because n*mx = sum(X) you could also as well cancel 3 and 4)

This leaves

sum(XY) - my*sum(X)

On Sun, Apr 24, 2011 at 4:54 PM, Shem Cristobal <[email protected]>wrote:

> It was assumed that sumX is 0 so
>
> double centeredSumXY = sumXY - meanY * sumX;
>
> reduces to
>
> double centeredSumXY = sumXY;
>
> right?
>
>
>
>
> On Sun, Apr 24, 2011 at 11:36 PM, Sean Owen <[email protected]> wrote:
>
> > It's correct. :) Want to show your working or me to post the derivation?
> >
> > On Sun, Apr 24, 2011 at 4:07 PM, Shem Cristobal <
> [email protected]
> > >wrote:
> >
> > > Has anyone seen this line 235 (and line 313) of
> AbstractSimilarity.class?
> > >
> > > double centeredSumXY = sumXY - meanY * sumX;
> > >
> > > This is so wrong and should be replaced by
> > >
> > > double centeredSumXY = sumXY - meanY * meanX;
> > >
> > >
> > >
> > > Best regards,
> > >
> > > @shemcristobal
> > >
> >
>
>
>
> --
> Best regards,
>
> Shem Cristobal
> Project Manager, Stratpoint Global Outsourcing, Inc.
> Unit 601 Tower 1 Globe Telecom Plaza
> Pioneer St corner Madisson St
> Mandaluyong City, Philippines 1552
> Email: [email protected]
> Website: http://www.stratpoint.com/
>
> Microsoft Certified Application Developer for .NET
> Microsoft Certified Solution Developer for .NET
> Microsoft Certified Technology Specialist - SQL Server 2005
> Microsoft Certified Technology Specialist - MS Project 2007
>

Reply via email to