How different?
In the calculation of derivatives, the operator ** is more complex numerically than the operator exp. Numerical errors may accumulate, and provide different results.
Here is an example:
With beta=0:
p1 = e**beta
p1.getValueAndDerivatives(prepareIds=True)
(1.0, array([0.99999997]), array([[0.99999994]]), array([[0.99999994]]))
p2 = exp(beta)
p2.getValueAndDerivatives(prepareIds=True)
(1.0, array([1.]), array([[1.]]), array([[1.]]))
With beta=5:
p1 = e**beta
p1.getValueAndDerivatives(prepareIds=True)
(148.41313656762816,
array([148.41313206]),
array([[148.41312755]]),
array([[22026.45776805]]))
p2 = exp(beta)
p2.getValueAndDerivatives(prepareIds=True)
(148.4131591025766,
array([148.4131591]),
array([[148.4131591]]),
array([[22026.46579481]]))
> --
> You received this message because you are subscribed to the Google Groups "Biogeme" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
biogeme+u...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/biogeme/73f80d83-522a-4cda-8dce-fe9588851917n%40googlegroups.com.