Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
6981 Discussions

VSL Summary Statistics VSL_SS_MIN does not work

tennican
Beginner
432 Views
Does anyone know why the VSL_SS_MIN routine doesn't work?
Almost exactly the same code with the VSL_SS_MAX routine works just fine.

If I run the code below, min_est does NOT get a value.
If I switch the comments to run the MAX code, max_est gets the value 34 as you would expect.

int status;
VSLSSTaskPtr task;
MKL_INT xstorage = VSL_SS_MATRIX_STORAGE_ROWS;
MKL_INT numCols = 1;
MKL_INT numRows = 6;
double Y[] = {5,8,23,4,34,20};
status = vsldSSNewTask( &task, &numCols, &numRows, &xstorage, Y, 0, 0 );

double min_est[1];
// double max_est[1];
status = vsldSSEditTask( task, VSL_SS_ED_MIN, min_est );
// status = vsldSSEditTask( task, VSL_SS_ED_MAX, max_est );
status = vsldSSCompute(task, VSL_SS_MIN, VSL_SS_METHOD_FAST );
// status = vsldSSCompute(task, VSL_SS_MAX, VSL_SS_METHOD_FAST );

thanks, Scott


0 Kudos
3 Replies
tennican
Beginner
432 Views
I found the text below in Summary Statistics Library Application Notes below a code example that did NOT initialize its initial values.

"Before the first call to the Compute routine, initialize the initial values of the estimates with reasonable values, such as the values of the first observation."

It turns out that this initialization is required.

So, the code below works fine:
double min_est = Y[0];
double max_est = Y[0];
double mean_est = Y[0];
status = vsldSSEditTask(task, VSL_SS_ED_MIN, &min_est);
status = vsldSSEditTask(task, VSL_SS_ED_MAX, &max_est);
status = vsldSSEditTask(task, VSL_SS_ED_MEAN, &mean_est);
status = vsldSSCompute(task, VSL_SS_MIN|VSL_SS_MAX|VSL_SS_MEAN, VSL_SS_METHOD_FAST);

Also, notice that the types of the parameters vary depending on the case of the letter in the method names.
Also, be careful not to mix up VSL_SS_ED_MIN and VSL_SS_MIN.


0 Kudos
Andrey_N_Intel
Employee
432 Views
Hello Scott,
Thanks for the communication. It's good to knowthat you resolvedthe parameter initialization issue for computation ofmin/max estimates with Intel MKL VSL Summary Statisticsroutines. Please, feel free to provide your feedback/askmore questions onStatistical Component of Intel MKL,and we will be glad to help.
Best,
Andrey
0 Kudos
tennican
Beginner
432 Views
Hi Andrey,

It's great knowing that there are people to help when I get stuck.
Hopefully, I will be able to help others when I have ramped on the library.

thanks, Scott
0 Kudos
Reply