natural log of a summation



Hi All,

Please bear with me as I'm not a mathematican by trade, I'm a computer science researcher.

Ok I am currently implementing something and have encountered the following problem.

I have to code "the natural log of "the product" of "the sum" of a function. Ok for progamming reasons which are hard to explain, I changed this to

i.e. ln(TT E f(x)) (bear with the symbols!)

"The sum of" the "natural log" of "the sum" of a function.

i.e. E ln E f(x)

Ok thats all straight forward enough to program, however my problem comes because I am dealing with vectors, and the result of the "the sum" of a function is a vector itself. And of course this vector may contain +ve or -ve x,y, and z components.

I have currently implemented taking the natural log of each component, but obvious this hits problems when a component is -ve.

Any suggestions? Should I be taking the natural log of each component anyway?

Adam
.