Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #4363

Re: find covariance using ejml

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!.POSTED!not-for-mail
From Lew <noone@lewscanon.com>
Newsgroups comp.lang.java.programmer
Subject Re: find covariance using ejml
Date Fri, 20 May 2011 13:00:09 -0400
Organization albasani.net
Lines 25
Message-ID <ir66ml$ek4$1@news.albasani.net> (permalink)
References <fc798e81-6839-4506-8ee9-d070c1916d41@d19g2000prh.googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 7bit
X-Trace news.albasani.net jCGnJ5luAIYF9pfDqzJkTmWlUAwBboYHeC65BMbvn+jjy5OZjvOxJr6hVr8/qYVrtBVSAFXa5QkgChd3sd60BJhhclLmbxPlqcMka4tmV3GOFbjnwthUov4pb2Hby3kW
NNTP-Posting-Date Fri, 20 May 2011 17:00:05 +0000 (UTC)
Injection-Info news.albasani.net; logging-data="1N3ybTCsZcCzNbZZKjb70hax0jLVoSWi5BUVjspPsmzsW+yk4C+iPRb0dhfpxsmYsfKhfNxJOXT8K0lxYi+qfB0e/VnQI/bCd5m3tWY3uUKwMVNoSiOqiO/dpp9iUMaX"; mail-complaints-to="abuse@albasani.net"
User-Agent Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110424 Thunderbird/3.1.10
In-Reply-To <fc798e81-6839-4506-8ee9-d070c1916d41@d19g2000prh.googlegroups.com>
Cancel-Lock sha1:9ZVU0aYYZyqJFEytLLLaGMUDxh8=
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:4363

Show key headers only | View raw


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.googlecode.com/svn/javadoc/ver0.16/org/ejml/alg/dense/mult/VectorVectorMult.html#innerProd(org.ejml.data.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/wikipedia/commons/c/cf/Friz.jpg

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Find similar


Thread

find covariance using ejml jimgardener <jimgardener@gmail.com> - 2011-05-19 22:56 -0700
  Re: find covariance using ejml Lew <noone@lewscanon.com> - 2011-05-20 13:00 -0400

csiph-web