Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!.POSTED!not-for-mail From: Lew 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: References: 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: Cancel-Lock: sha1:9ZVU0aYYZyqJFEytLLLaGMUDxh8= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:4363 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 looks like it can be implemented using 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