knowledge-database (beta)

Current group: comp.databases

How To Get Covariance Matrix

How To Get Covariance Matrix  
Kalyan
 Re: How To Get Covariance Matrix  
Simon Hayes
From:Kalyan
Subject:How To Get Covariance Matrix
Date:18 Jan 2005 22:01:43 -0800
Hi All,

I have the table as follows


column1 ---------------------------------column2------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-----column3-------

3 -1.149,3.571,17.978,4.706,8.28,-5.988,-5.65,7.273,10,-7.975,0.617,-9.497,5.917,-1.744,-7.027,29.371,0,2.878,-2.113,0,-16.471,-10.526,-2.062,-2.513,-0.995,-12.987,0.435,4.072,12.183,-3.902,-4.651,25,-7.027,8.824,-15,-3.846,-4.587,-7.234,-5.242,16.432,0.472, -0.618326923076923
16 1.649,2.768,3.474,-0.746,-0.186,1.129,-1.801,-0.46,5.634,1.429,0.995,-1.131,-2.959,1.946,3.266,0.404,2.588,-0.31,0.938,-0.26,-1.333,-1.215,-0.554,-1.194,-2.304,-0.223,1.576,-1.932,2.425,-4.67,0.617,0.333,0.962,-1.59,-0.066,3.575,-1.018,3.357,0.372,3.627,-1 0.282173076923077
23 7.042,1.429,11.111,-13.103,-3.974,-1.948,6.207,2.113,-0.699,0.704,1.429,0,-2.098,2.143,0,1.449,-1.429,-6.667,13.636,-8.966,1.399,2.143,-9.091,-3.75,-5.882,10.39,-5.521,-13.757,2.717,-2.128,2.174,0,-8.911,12.222,-10,3.093,-3,7.527,0,-2.105,2.151,-7,-0.99,0, -0.531596153846154
25 0.542,0.63,0.549,-2.148,4.534,0.13,2.436,-10.432,0.599,4.854,4.871,2.519,-3.306,5.362,-4.716,0.837,11.487,-5.869,-2.523,8.187,-6.087,-8.232,1.061,-6.914,-5.7,-5.058,-4.202,13.982,-1.559,4.282,-1.868,5.414,-4.728,-2.737,-2.592,-8.441,-2.091,-5.341,-1.516,4. -0.194057692307692

From The above result pane i want to get a covariance matrix from
column2 and column3.Here column3 can be be taken as "Mean"

please help .It's an urgent deliverable.
Immediate response is highly appreciated.
From:Simon Hayes
Subject:Re: How To Get Covariance Matrix
Date:Wed, 19 Jan 2005 11:55:23 +0100

"Kalyan" wrote in message
news:8d9bccc3.0501182201.55ab2b82@posting.google.com...
> Hi All,
>
> I have the table as follows
>
>
>
> umn1 ---------------------------------column2------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> -----column3-------
>
>
> -1.149,3.571,17.978,4.706,8.28,-5.988,-5.65,7.273,10,-7.975,0.617,-9.497,5.917,-1.744,-7.027,29.371,0,2.878,-2.113,0,-16.471,-10.526,-2.062,-2.513,-0.995,-12.987,0.435,4.072,12.183,-3.902,-4.651,25,-7.027,8.824,-15,-3.846,-4.587,-7.234,-5.242,16.432,0.472,
> -0.618326923076923
> 16
> 1.649,2.768,3.474,-0.746,-0.186,1.129,-1.801,-0.46,5.634,1.429,0.995,-1.131,-2.959,1.946,3.266,0.404,2.588,-0.31,0.938,-0.26,-1.333,-1.215,-0.554,-1.194,-2.304,-0.223,1.576,-1.932,2.425,-4.67,0.617,0.333,0.962,-1.59,-0.066,3.575,-1.018,3.357,0.372,3.627,-1
> 0.282173076923077
> 23
> 7.042,1.429,11.111,-13.103,-3.974,-1.948,6.207,2.113,-0.699,0.704,1.429,0,-2.098,2.143,0,1.449,-1.429,-6.667,13.636,-8.966,1.399,2.143,-9.091,-3.75,-5.882,10.39,-5.521,-13.757,2.717,-2.128,2.174,0,-8.911,12.222,-10,3.093,-3,7.527,0,-2.105,2.151,-7,-0.99,0,
> -0.531596153846154
> 25
> 0.542,0.63,0.549,-2.148,4.534,0.13,2.436,-10.432,0.599,4.854,4.871,2.519,-3.306,5.362,-4.716,0.837,11.487,-5.869,-2.523,8.187,-6.087,-8.232,1.061,-6.914,-5.7,-5.058,-4.202,13.982,-1.559,4.282,-1.868,5.414,-4.728,-2.737,-2.592,-8.441,-2.091,-5.341,-1.516,4.
> -0.194057692307692
>
> From The above result pane i want to get a covariance matrix from
> column2 and column3.Here column3 can be be taken as "Mean"
>
> please help .It's an urgent deliverable.
> Immediate response is highly appreciated.

These links might be helpful:

http://www.users.drew.edu/skass/sql/covariance.sql.txt
http://sql.reproms.si/live/default.asp (statistics white paper #3)

Analysis Services has a convariance() function, so if you already use AS,
then that could be another option.

Simon
   

Copyright © 2006 knowledge-database   -   All rights reserved