Need definition of log1p,log2p, ln1p, and ln2p of field_value_factor modifier


(Iwan Vern) #1

Hi All,

I found that field_value_factor modifier could be none, log, log1p, log2p, ln, ln1p,ln2p, square, sqrt, or reciprocal.
I am not sure about the definition of these modifiers:

  1. log1p = log(1+p)
  2. log2p = log(2p) -> from wolfram alpha
  3. ln1p = ln(1+p)
  4. ln2p = ln(2p)

In wolfram alpha, defintion of #1 is ln(1+x).

CMIIW


(Colin Goodheart-Smithe) #2

I have raised https://github.com/elastic/elasticsearch/issues/13511 to update the documentation but in the mean time, from looking at the code in FieldValueFactorFunction.Modifier:

for a value n:

  1. log1p = Math.log10(n + 1)
  2. log2p = Math.log10(n + 2)
  3. ln1p = Math.log1p(n) = Math.log(n + 1) [= ln(n + 1)]
  4. ln2p = Math.log2p(n + 1) = Math.log(n + 2) [= ln(n + 2)]

Hope that helps


(Iwan Vern) #3

Thanks, it really helps


(system) #4