Skip to content

Commit

Permalink
Update R reference
Browse files Browse the repository at this point in the history
  • Loading branch information
devmotion committed Dec 14, 2024
1 parent e9aa32e commit 9bb0947
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions src/univariate/discrete/binomial.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ function mode(d::Binomial{T}) where T<:Real
end
modes(d::Binomial) = Int[mode(d)]

# `median` falls back to quantile-based definition

function skewness(d::Binomial)
n, p1 = params(d)
p0 = 1 - p1
Expand Down
2 changes: 1 addition & 1 deletion test/ref/discrete/binomial.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Binomial <- R6Class("Binomial",
failprob=q,
ntrials=n,
mean=n * p,
median=round(n * p),
median=qbinom(0.5, self$n, self$p),
var=n * p * q,
skewness=(q - p) / sqrt(n*p*q),
kurtosis=(1 - 6*p*q) / (n*p*q))
Expand Down
2 changes: 1 addition & 1 deletion test/ref/discrete_test.ref.json
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@
"failprob": 0.5,
"ntrials": 3,
"mean": 1.5,
"median": 2,
"median": 1,
"var": 0.75,
"skewness": 0,
"kurtosis": -0.666666666666667
Expand Down

0 comments on commit 9bb0947

Please sign in to comment.