Commit 4a9dcc4f authored by Chris Jewell's avatar Chris Jewell
Browse files

Added normalising constant to DirichletNode$logDensity for consistency with other StochasticNodes.

parent 03b72f34
......@@ -286,7 +286,8 @@ DirichletNode <- R6::R6Class(
self$addParent(alpha, name = 'alpha')
},
logDensity = function() {
sum((self$parents$alpha$getData() - 1) * log(self$data))
lgamma(sum(alpha)) - sum(lgamma(alpha)) +
sum((self$parents$alpha$getData() - 1) * log(self$data))
}
)
)
......
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