Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Intel Community
- Software
- Software Development SDKs and Libraries
- Intel® oneAPI Math Kernel Library
- How to compute covariance matrix in MKL?

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Hai

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

01-18-2013
01:09 PM

136 Views

How to compute covariance matrix in MKL?

Given a 2D matrix A as input, how to compute its covariance matrix? For example, in Matlab, I use cov(A) to do the computation.

Thanks

Link Copied

2 Replies

Gennady_F_Intel

Moderator

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

01-18-2013
10:58 PM

136 Views

you can do that by using Summary Statistical Functions. Vslsssnewtask(*&task*, *p*, *n*, *xstorage*, *x*, *w*, *indices*) where P -- Dimension of the task, number of variables

There are many examples show how to do that. You can find these examples into manual or into <mkl_root>\examples\vsls\source\"

Ilya_B_Intel

Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

01-22-2013
11:19 PM

136 Views

More specifically you should be interested in vslsbasicstats.c/vsldbasicstats.c for C or vslsbasicstats.f/vsldbasicstats.f for Fortran examples.

At the same time those examples show calculation for all basic stats including min/max, moments, skewness, etc.

In order to calculate covariance only you can skip several steps there, the rest will be: vslsSSNewTask() + vslsSSEditCovCor() + vslsSSCompute() + vslSSDeleteTask().

You can also look here:

- Summary Statistics Application Notes, and especially this part is about calculation cov/cor and meaning of each step.
- There is also an older blog post, which gives some insight for use case.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

For more complete information about compiler optimizations, see our Optimization Notice.