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
Sylvain Jasson
gmp
Commits
d459d004
Commit
d459d004
authored
Aug 12, 2021
by
Martin Maechler
Browse files
add examples (incl. simple tests)
parent
996872c5
Changes
1
Hide whitespace changes
Inline
Side-by-side
man/binomQ.Rd
View file @
d459d004
...
...
@@ -25,6 +25,18 @@ dbinomQ(x, size, prob, log = FALSE)
\seealso{
\code{\link{chooseZ}}; \R's (\pkg{stats} package) \code{\link{dbinom}()}.
}
%% \examples{
%% TODO
%% }
\examples{
dbinomQ(0:8,8, as.bigq(1,2))
## 1/256 1/32 7/64 7/32 35/128 7/32 7/64 1/32 1/256
ph16. <- dbinomQ(0:16, size=16, prob = 1/2) # innocous warning
ph16 <- dbinomQ(0:16, size=16, prob = as.bigq(1,2))
ph16.75 <- dbinomQ(0:16, size=16, prob = as.bigq(3,4))
stopifnot(exprs = {
identical(ph16, ph16.)
identical(ph16,
dbinomQ(0:16, size=16, prob = as.bigz(1)/2))
all.equal(dbinom(0:16, 16, prob=1/2), asNumeric(ph16), tol=1e-15)
all.equal(dbinom(0:16, 16, prob=3/4), asNumeric(ph16.75), tol=1e-15)
})
}
Write
Preview
Markdown
is supported
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