How to compute covariance matrix in MKL?

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

3 posts / 0 nouveau(x)
Dernière contribution
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.

you can do that by using Summary Statistical Functions.   Vslsssnewtask(&taskpnxstoragexwindices)  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\"

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:

Laisser un commentaire

Veuillez ouvrir une session pour ajouter un commentaire. Pas encore membre ? Rejoignez-nous dès aujourd’hui