Fortran Intrinsic Function for Lasso thresholding rule
In Lasso solution, the thresholding rule is
Which can be achieved in Fortran by
sign(dim(abs(a),b),a)
as easy as original function.
DIM(X, Y)
- If X > Y, the value of the result is X – Y.
- If X <= Y, the value of the result is zero.
SIGN(A, B)
The result is sgn*|A|, where:
- sgn = -1, if either of the following is true:
- B < 0
- B is a REAL(4) or REAL(8) number with a value of negative 0, and you have specified the -qxlf90=signedzero option
- sgn = 1, otherwise.
leave a comment