numeric: numeric utilities | ||||||||||||||||||||||||||||||||||||||||||||||||||||
clean y to tolerance of x (default 1e_10) form: tolerance (default 1e_10) clean numbers sets values less than tolerance to 0 sum data columns of matrix by key form: key colsum mat sum data columns of matrix on key columns e.g. if column 2 of mat is age, then 2 colsum mat sums the remaining columns by age group indices of y in x Return group indices of elements of y x is an integer vector of the starting numbers of each group, assumed to be in ascending order. e.g. 0 0 0 1 1 1 2 2 = 0 3 6 groupndx i.8 i.e. <:@(+/@(<:/)) groupndx=: 4 : '<: (#x) }. (+/\r<#x) /: r=. /: x,y' range from a to b [in steps of c] range a,b[,c] = range from a to b [in steps of c] solves recurrence r(i)=a(i)+r(i-1)*m(i-1) form: r = m recur a r(0) = a(0) r(i) = a(i)+r(i-1)*m(i-1) e.g 1.05 1.10 recur 100 100 100 100 205 325.5 round y to nearest x with bankers rounding round y to nearest x if y is a mid point, it is rounded up if even, down if odd 0.1 roundbanker 1.23 2.15 2.25 2.35 2.45 1.2 2.2 2.2 2.4 2.4 round y to nearest x preserving total distributive rounding round y to nearest x preserving total to nearest x e.g. 0.1 rounddist 6$0.45 0.5 0.4 0.5 0.4 0.5 0.4 steps from a to b in c steps form: steps a,b,c
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
>> << Ndx Usr Pri JfC LJ Phr Dic Rel Voc !: wd Help User |