Lately I've been trying to use functional prgramming and tried to implement the gaussian propagation of uncertainty (without correlation) in an elegant way, here is the outcome:
Norm /@ (#2 Outer[(Derivative @@ #2)@f @@ #1 &, #1, IdentityMatrix@Last@Dimensions@#1, 1] /. f -> #3) &[data, error, f]
error are assumed to be two dimensional lists (lists of data points), and
f is a function. What bothers me a bit is the
/.) rule for f, because I couldn't figure out how to create a function
g in a way that
Outer[g &, ...]& takes f as an argument to return a new function
g[f]&, which again takes two arguments (here a partial derivative of f respect to the variable specified by the first argument, evaluated at a point specified by the second argument).
What I ask for basically is some feedback. What could be done better? Any suggestions are appreciated, merci.