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
- one question about computing variance using MKL 10.3

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

frank_ctx

Beginner

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

11-12-2011
07:54 PM

80 Views

one question about computing variance using MKL 10.3

status = 0

status = 0

status = -4006 (BAD_MEAN_ADDR ???)

status = 0

var = 0.000000

Here is my code:

VSLSSTaskPtr task;

double x[9] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0};

double v = 0.0;

int indices[1] = {1};

MKL_INT p, n, xstorage;

int status;

p = 1;

n = 9;

xstorage = VSL_SS_MATRIX_STORAGE_ROWS;

/* create task */

status = vsldSSNewTask( &task, &p, &n, &xstorage, x, 0, indices);

myprint("status = %d\\n", status);

status = vsldSSEditTask( task, VSL_SS_ED_VARIATION, &v );

myprint("status = %d\\n", status);

status = vsldSSCompute(task, VSL_SS_VARIATION , VSL_SS_METHOD_FAST );

myprint("status = %d\\n", status);

status = vslSSDeleteTask( &task );

myprint("status = %d\\n", status);

myprint("var = %f\\n", v);

Can someone tell me why? Thanks!!!

Link Copied

3 Replies

Andrey_N_Intel

Employee

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

11-13-2011
10:04 PM

80 Views

Thanks for the question and the short test case.

As a first note, can you please clarify which estimate you would like to compute, variation coefficientVC=Sigma/E, where Sigma is standard deviation, andE - Expectation (Mean), or variance Sigma^2 = E(X-E(X))^2, E(X) - is expectation of random variable X?

Variation coefficient is defined by mean and standard deviation,square root ofsecond central moment.Computation of i-th central momentuses raw (algebraic) moments up to i-th order. In case of VC estimates, the library will compute mean and the second raw moment.For this reason youneed to allocate the buffersfor those estimates and make them available to the libraryby using Task Editor [d|s]SSEditTask. Size ofeach bufferis defined by dimension of task p (which equal to 1 in your case).

The additional details describing the requirement of buffer allocation for intermediate estimatesare available in Section 3.1.1 of Summary StatsApplication Notes, http://software.intel.com/sites/products/documentation/hpc/mkl/sslnotes/sslnotes.pdf

Can you please let me know if the issue is resolvedwith the allocation of the memory?

Also, feel free to ask more questions on Statistical Component of Intel MKL, and we will gladly help.

Best,

Andrey

frank_ctx

Beginner

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

11-14-2011
02:33 PM

80 Views

solved. Thank you so much!

SDyul

Beginner

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

07-04-2018
09:11 AM

80 Views

Please update the documentation how variation is computed.

Looks confusing.

There is a variance and there is a standard deviation.

This quantity variation what is it used for?

I could not find any definition for it.

All the best

- 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.