Skip to content

Commit

Permalink
Total mass assigned by distribution must be within .Machine.eps neigh…
Browse files Browse the repository at this point in the history
…borhood of 1
  • Loading branch information
patrickreidy committed Sep 3, 2017
1 parent 63516b7 commit f0d4e91
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions .Rbuildignore
@@ -1,2 +1,3 @@
^.*\.Rproj$
^\.Rproj\.user$
.travis.yml
2 changes: 1 addition & 1 deletion R/distribution.R
Expand Up @@ -27,7 +27,7 @@ methods::setValidity(
p_error <- ifelse(!("P" %in% names(object)) ||
class(object[["P"]]) != "numeric" ||
length(which(object[["P"]] < 0)) > 0 ||
sum(object[["P"]]) != 1,
abs(sum(object[["P"]]) - 1) > .Machine$double.eps,
p_msg, "")
# A distribution must be defined over a random variable---a variable other than P.
rv <-
Expand Down

0 comments on commit f0d4e91

Please sign in to comment.