Bluebit Software
Bluebit Software Support Forum
 Home          Members     Calendar     Who's On

Welcome Guest ( Login | Register )
        



column variance Expand / Collapse
Message
Posted Friday, November 24, 2006 4:26 AM Post #138
 

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member
what is the best way to get the variance of a column in a matrix?
Posted Friday, November 24, 2006 5:22 AM Post #362
 

Bluebit SupportBluebit SupportBluebit SupportBluebit SupportBluebit SupportBluebit SupportBluebit SupportBluebit Support

Using the ColsDotProduct(col, col) you can get Sum(x^2) and then you divide by N or N-1 where N is the number of rows.



Trifon Triantafillidis

Lead Developer

Bluebit Software

Posted Friday, November 24, 2006 8:53 AM Post #363
 

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member
I cant use that as that will not give me the variance as it is the sum of the x^2 and not the sum of (x-mean)^2

I can do it the long way by looping through but just wondered if there was a quicker command
Posted Friday, November 24, 2006 9:14 AM Post #364
 

Bluebit SupportBluebit SupportBluebit SupportBluebit SupportBluebit SupportBluebit SupportBluebit SupportBluebit Support

Sum( (x-mean)^2 ) = Sum( x^2 ) - 2*Sum(x)*mean + N*mean^2 = Sum(x^2) - 2 * Sun(x)* ( Sum(x)/N ) + N *(Sum(x)^2/N^2) =

= Sum(x^2) - Sum(x)^2 / N

You can get Sum(x) using ColSum method




Trifon Triantafillidis

Lead Developer

Bluebit Software

Posted Monday, November 27, 2006 8:08 AM Post #366
 

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member
thanks
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Trifon

Permissions Expand / Collapse

All times are GMT -5:00, Time now is 11:53am

Powered by InstantForum.NET v4.1.4 © 2010
Execution: 0.313. 8 queries. Compression Disabled.
.NET Matrix Library