protected: Catch numerical errors, and return -Inf
Description
Attempts to catch numerical erros in evaluating the expression x
, delivering a default result instead of NaN or other failures
Usage
protected(x,default=-Inf)
Value
Returns -Inf in case of error, otherwise the value of x
Arguments
- x
expression to be evaluated, typically the log-likelihood of a modified mixture model
- default
value to be delivered if numerical errors are encountered
Author
Peter Green (P.J.Green@bristol.ac.uk)