I am attempting to replicate an R script in python, and have come across an exponential function that I do not understand:
exp(-var1-var2-var3)
If I were to use 0.8, 1.2, and 0.3 as variables here, R would give me the answer 0.1002588
. However, I do not know how this is arrived at. I understand that the equivalent of exp in python is **
, and know how to replicate this function with only one number as input but I see no way to do this with multiple numbers. I have tried -var1**-var2**-var3
, which gives me -1.235241
.
How do I interpret this function, and what would the equivalent python code be for this?
I ran the exp
function with the exact same values and it outputs the right result:
from math import exp
# 0.8, 1.2, and 0.3 as variables here, R would give me the answer 0.1002588.
var1 = 0.8
var2 = 1.2
var3 = 0.3
res = exp(-var1-var2-var3)
print (res)
OUT: 0.10025884372280375