-
Notifications
You must be signed in to change notification settings - Fork 70
Fix haddock for negativeBinomial, remove references to original bos repo #217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,7 +47,7 @@ import Statistics.Internal | |
gChoose :: Double -> Int -> Double | ||
gChoose n k | ||
| k < 0 = 0 | ||
| k' >= 50 = exp $ logChooseFast n k' | ||
| k' >= 50 = exp $ logChooseFast n k' | ||
| otherwise = foldl' (*) 1 factors | ||
where factors = [ (n - k' + j) / j | j <- [1..k'] ] | ||
k' = fromIntegral k | ||
|
@@ -151,7 +151,7 @@ complCumulative (NBD r p) x | |
| k < 0 = 1 | ||
| otherwise = incompleteBeta (fromIntegral (k+1)) r (1 - p) | ||
where | ||
k = (floor x)::Integer | ||
k = floor x :: Integer | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just an hlint warning fix here. Note that |
||
|
||
mean :: NegativeBinomialDistribution -> Double | ||
mean (NBD r p) = r * (1 - p)/p | ||
|
@@ -166,14 +166,14 @@ directEntropy d = | |
dropWhile (>= -m_epsilon) $ | ||
[ let x = probability d k in x * log x | k <- [0..]] | ||
|
||
-- | Construct negative binomial distribution. Number of failures /r/ | ||
-- | Construct negative binomial distribution. Number of successes /r/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This got me really confused because it's in conflict with the This is even more confusing, because the "output" of the distribution is probability of number of failures before we get r-th success. |
||
-- must be positive and probability must be in (0,1] range | ||
negativeBinomial :: Double -- ^ Number of successes. | ||
-> Double -- ^ Success probability. | ||
-> NegativeBinomialDistribution | ||
negativeBinomial r p = maybe (error $ errMsg r p) id $ negativeBinomialE r p | ||
|
||
-- | Construct negative binomial distribution. Number of failures /r/ | ||
-- | Construct negative binomial distribution. Number of successes /r/ | ||
-- must be positive and probability must be in (0,1] range | ||
negativeBinomialE :: Double -- ^ Number of successes. | ||
-> Double -- ^ Success probability. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,14 +36,16 @@ category: Math, Statistics | |
|
||
extra-source-files: | ||
README.markdown | ||
changelog.md | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixing
|
||
examples/kde/KDE.hs | ||
examples/kde/data/faithful.csv | ||
examples/kde/kde.html | ||
examples/kde/kde.tpl | ||
tests/utils/Makefile | ||
tests/utils/fftw.c | ||
|
||
extra-doc-files: | ||
changelog.md | ||
|
||
tested-with: | ||
GHC ==8.4.4 | ||
|| ==8.6.5 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This gives me 404 repository not found