From my understanding, ARGMIN is just the value of the independent variable(s) that correspond to the global minimum in the dependent variable. Your one-dimensional example is thus wrong. No matter which location you place the "0", your formula always returns 0. a = [1, 2, 3, 4, 0, 6, 7, 8] argmin = SORT(MIN(a, DIMENSION = 1)) argmin = 0 The correct formula for ARGMIN would be as follows, which by the way will work for N dimensions: argmin = array_indices(a,where(a EQ min(a))) You can test this with a sample 2D array: a = [[5, 1, 2, 3, 1, 5, 6, 7, 8],[15, 11, 12, 13,11, 15, 16, 17, 18],[[25, 21, 22, 23,21, 25, 26, 27,28]]] argmin = array_indices(a,where(a EQ min(a))) print, argmin 1 0 4 0 In my original array, the minimum value (1) occurs twice. Once in [Column 1, Row 0] and also at [Column 4, Row 0]. Hope this helps.
|