Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

assertion to ensure matching dimension in log-pdf-dirichlet

  • Loading branch information...
commit 846342a9543e572e228b46726176e8466b6867ee 1 parent efcb676
Nils authored
Showing with 2 additions and 0 deletions.
  1. +2 −0  src/probabilistic_clojure/embedded/choice_points.clj
View
2  src/probabilistic_clojure/embedded/choice_points.clj
@@ -86,6 +86,8 @@ of probabilistic choice points."}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defn log-pdf-dirichlet [ps alphas]
+ (assert (= (count ps) (count alphas))
+ "Dimension mismatch in log-pdf-dirichlet!")
(let [log-gamma (fn [x] (Gamma/logGamma x))
norm (- (reduce + (map log-gamma alphas))
(log-gamma (reduce + alphas)))]
Please sign in to comment.
Something went wrong with that request. Please try again.