Hello,
it seams that I have to build my own a module which replicates functionality of the Mathematica function "MAP". Or maybe somebody has already a solution for that?
In Mathematica you can map functions to a list:
https://reference.wolfram.com/language/ref/Map.html
In our IML case we have to make a loop over cashflows which we want to discount (using an own discFactor_s Function).
do i = 1 to nrow(cf_m);
cf_d_v[i] = cf_m[i, 3] /*CF_AMT*/ # discFactor_s(discToDate_s, cf_m[i, 2] /*CF_DT*/, forward_m /*QUOTE_DT FROM_DT TO_DT QUOTE_RT*/);
end;
But we would like to apply the cashflow lines of the matrix to the function discFactor_s without a loop (we would like to avoid loops where ever possible):
cf_d_v = MAP[discFactor_s(discToDate_s, #[2], forward_m), cf_m)]....
#[2] -> the map function should take each row from the matrix cf_m and extract the value from second column.
In Mathematica there is # used as represant of the list item taken from the list (in this case cf_m).
Does exist a comfortable solution for that?
Thanks in advance!
Regards,
Adalbert