Visible to Intel only — GUID: GUID-853FB664-0814-4021-9907-9491F945B9D2
Legal Information
About This Document
About Summary Statistics
Algorithms and Interfaces in Summary Statistics
Common Usage Model of Summary Statistics Algorithms
Processing Data in Blocks
Detecting Outliers in Datasets
Dealing with Missing Observations
Computing Quantiles for Streaming Data
Bibliography
Estimating Raw and Central Moments and Sums, Skewness, Excess Kurtosis, Variation, and Variance-Covariance/Correlation/Cross-Product Matrix
Computing Median Absolute Deviation
Computing Mean Absolute Deviation
Computing Minimum/Maximum Values
Calculating Order Statistics
Estimating Quantiles
Estimating a Pooled/Group Variance-Covariance Matrices/Means
Estimating a Partial Variance-Covariance Matrix
Performing Robust Estimation of a Variance-Covariance Matrix
Detecting Multivariate Outliers
Handling Missing Values in Matrices of Observations
Parameterizing a Correlation Matrix
Sorting an Observation Matrix
Visible to Intel only — GUID: GUID-853FB664-0814-4021-9907-9491F945B9D2
Computing Median Absolute Deviation
Use the VSL_SS_METHOD_FAST method to compute a median absolute deviation estimate in the datasets. The calculation is straightforward and follows the pattern of the example below:
#include "mkl_vsl.h" #define DIM 3 /* dimension of the task */ #define N 1000 /* number of observations */ int main() { VSLSSTaskPtr task; float x[DIM][N]; /* matrix of observations */ float mdad[DIM]; MKL_INT p, n, xstorage; int status; /* Parameters of the task and initialization */ p = DIM; n = N; xstorage = VSL_SS_MATRIX_STORAGE_ROWS; /* Create a task */ status = vslsSSNewTask( &task, &p, &n, &xstorage, (float*)x, 0, 0 ); /* Initialize the task parameters */ status = vslsSSEditTask( task, VSL_SS_ED_MDAD, mdad ); /* Compute median absolute deviation in observations */ status = vslsSSCompute(task, VSL_SS_MDAD, VSL_SS_METHOD_FAST ); /* Deallocate the task resources */ status = vslSSDeleteTask( &task ); return 0; }
The size of the array to hold median absolute deviation should be sufficient for storing at least p values of the estimate, where p is the dimension of the task.
Computation of median absolute deviation is only possible for data arrays available at once, or in separate blocks of the dataset.
Parent topic: Algorithms and Interfaces in Summary Statistics