Skip to content
Prev 366006 / 398502 Next

Function implemented in R returns the wrong value

On 10/12/2016 2:01 PM, Fernando de Souza Bastos wrote:
I haven't read it carefully, but a likely problem is that you are using 
constructs like log(dnorm(x)) (e.g. log(phi_t0)) instead of dnorm(x, log 
= TRUE).  The dnorm(x) value will underflow to zero, and taking the log 
will give you -Inf.  Using the "log = TRUE" argument avoids the underflow.

Duncan Murdoch