Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Poppy Miller
sourceR
Commits
4a9dcc4f
Commit
4a9dcc4f
authored
Dec 22, 2016
by
Chris Jewell
Browse files
Added normalising constant to DirichletNode$logDensity for consistency with other StochasticNodes.
parent
03b72f34
Changes
1
Hide whitespace changes
Inline
Side-by-side
R/node.R
View file @
4a9dcc4f
...
...
@@ -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
))
}
)
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment