Somtimes I still get lost in the Hold, HoldAll etc. functions of Mathematica. I want to scale a simple PDF function with a previously calculated variable e.g.
scale=10.0
(scale PDF[NormalDistribution[]])[0.5]
where I would expect to get the same output as for
scale (PDF[NormalDistribution[]][0.5])
(* 3.52065 *)
unfortunately I get the unevaluated function with its argument. Another example with Interpolation:
points = {{0, 0}, {1, 1}, {2, 3}, {3, 4}, {4, 3}, {5, 0}};
(10 Interpolation[points])[0.5]
(and yes I know that I can scale the points upfront or could do the evaluation with the brackets around interpolation and the argument. This is not the point. I need to return a scaled pure function at the end without the evaluation with an numeric argument)
Is there an easy way to force the evaluation and return the resulting pure function?
Composition[]
. $\endgroup$scale = 10.0; pureScaledFunction = (scale PDF[NormalDistribution[]][#]) &; pureScaledFunction[0.5]
? $\endgroup$