Commit ac9a60e7 authored by Chris Jewell's avatar Chris Jewell
Browse files

Small change to PoissonNode to deal with cases when the length of the mean...

Small change to PoissonNode to deal with cases when the length of the mean value is different to the offset.  Usual R conventions apply here.
parent 9b1cd80c
......@@ -208,7 +208,8 @@ PoissonNode <- R6::R6Class(
self$addParent(offset, 'offset')
},
logDensity = function() {
lambda <- sapply(self$parents, function(parent) parent$getData())
lambda <- as.data.frame(sapply(self$parents,
function(parent) parent$getData()))
lambda <- apply(lambda, 1, prod)
sum(dpois(self$data, lambda, log = T))
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment