Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > find covariance using ejml

Reply
Thread Tools

find covariance using ejml

 
 
jimgardener
Guest
Posts: n/a
 
      05-20-2011
hi
I have two double arrays as below
double[] x=new double[]{2.5,0.5,2.2,1.9,3.1,2.3,2.0,1.0,1.5,1.1};
double[] y=new double[]{2.4,0.7,2.9,2.2,3.0,2.7,1.6,1.1,1.6,0.9};

How do you find the covariance between them using ejml library?
Any code snippet most welcom
thanks
jim
 
Reply With Quote
 
 
 
 
Lew
Guest
Posts: n/a
 
      05-20-2011
jimgardener wrote:
> I have two double arrays as below
> double[] x=new double[]{2.5,0.5,2.2,1.9,3.1,2.3,2.0,1.0,1.5,1.1};
> double[] y=new double[]{2.4,0.7,2.9,2.2,3.0,2.7,1.6,1.1,1.6,0.9};
>
> How do you find the covariance between them using ejml [sic] library?
> Any code snippet most welcom


I've never used EJML, but the formula for matrix covariance
<http://stattrek.com/matrix-algebra/variance.aspx>
looks like it can be implemented using
<http://efficient-java-matrix-library...ta.D1Matrix64F,
org.ejml.data.D1Matrix64F)>

or some higher-level method, given that that particular method warns, "These
functions are often used inside of highly optimized code and therefor sanity
checks are kept to a minimum. It is not recommended that any of these
functions be used directly."

I just snooped around the EJML Javadocs for a minute. You can likely do better.

--
Lew
Honi soit qui mal y pense.
http://upload.wikimedia.org/wikipedi.../c/cf/Friz.jpg
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Covariance Return in C++ mufenhsieh@gmail.com C++ 2 03-30-2007 09:13 PM
covariance matrix Arkadiusz Stasiak C++ 1 07-21-2006 12:11 PM
Covariance of Java primitives Adam Warner Java 6 03-24-2006 11:03 AM
Parametric covariance in class hierarchies Matthias Kaeppler Java 6 01-23-2006 09:01 AM
Covariance Dave C++ 1 08-07-2004 04:40 PM



Advertisments