gsl-random 0.4.4 → 0.4.5
raw patch · 3 files changed
+59/−2 lines, 3 filesdep ~vectorPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: vector
API changes (from Hackage documentation)
+ GSL.Random.Dist: getLognormal :: RNG -> Double -> Double -> IO Double
+ GSL.Random.Dist: lognormalP :: Double -> Double -> Double -> Double
+ GSL.Random.Dist: lognormalPInv :: Double -> Double -> Double -> Double
+ GSL.Random.Dist: lognormalPdf :: Double -> Double -> Double -> Double
+ GSL.Random.Dist: lognormalQ :: Double -> Double -> Double -> Double
+ GSL.Random.Dist: lognormalQInv :: Double -> Double -> Double -> Double
Files
- NEWS +3/−0
- gsl-random.cabal +2/−2
- lib/GSL/Random/Dist.hs +54/−0
NEWS view
@@ -1,3 +1,6 @@+Changes in 0.4.5+* Clark Gaebel added the lognormal distribution.+ Changes in 0.4.4 * Compile fixes for GHC 7.4.2
gsl-random.cabal view
@@ -1,5 +1,5 @@ name: gsl-random-version: 0.4.4+version: 0.4.5 homepage: http://github.com/patperry/hs-gsl-random synopsis: Bindings the the GSL random number generation facilities. description:@@ -32,4 +32,4 @@ ghc-options: -Wall extensions: ForeignFunctionInterface build-depends: base >= 4 && < 5- , vector >= 0.7.0.1 && < 0.10+ , vector >= 0.7.0.1 && < 0.11
lib/GSL/Random/Dist.hs view
@@ -95,6 +95,15 @@ logisticPInv, logisticQInv, + -- * The Log-Normal Distribution+ getLognormal,++ lognormalPdf,+ lognormalP,+ lognormalQ,+ lognormalPInv,+ lognormalQInv,+ -- * The Pareto Distribution getPareto, @@ -770,6 +779,51 @@ foreign import ccall unsafe "gsl/gsl_randist.h" gsl_ran_dirichlet :: Ptr () -> CSize -> Ptr Double -> Ptr Double -> IO ()+++++-- | @lognormalPdf x zeta sigma@ evaluates the probability density+-- @p(x)@ at @x@ for a log-normal distribution with parameters @zeta@+-- and @sigma@, given. The density is given by+-- @p(x) dx = p(x) {1 \over x \sqrt{2 \pi \sigma^2} } \exp(-(\ln(x) - \zeta)^2/2 \sigma^2) dx@+lognormalPdf :: Double -> Double -> Double -> Double+lognormalPdf = liftDouble3 gsl_ran_lognormal_pdf++foreign import ccall unsafe "gsl/gsl_randist.h"+ gsl_ran_lognormal_pdf :: CDouble -> CDouble -> CDouble -> CDouble++-- | @getLognormal zeta sigma@ gets a random lognormal with parameters @zeta@ and @sigma@.+getLognormal :: RNG -> Double -> Double -> IO Double+getLognormal = liftRan2 gsl_ran_lognormal++foreign import ccall unsafe "gsl/gsl_randist.h"+ gsl_ran_lognormal :: Ptr () -> CDouble -> CDouble -> IO CDouble++lognormalP :: Double -> Double -> Double -> Double+lognormalP = liftDouble3 gsl_cdf_lognormal_P++foreign import ccall unsafe "gsl/gsl_randist.h"+ gsl_cdf_lognormal_P :: CDouble -> CDouble -> CDouble -> CDouble++lognormalQ :: Double -> Double -> Double -> Double+lognormalQ = liftDouble3 gsl_cdf_lognormal_Q++foreign import ccall unsafe "gsl/gsl_randist.h"+ gsl_cdf_lognormal_Q :: CDouble -> CDouble -> CDouble -> CDouble++lognormalPInv :: Double -> Double -> Double -> Double+lognormalPInv = liftDouble3 gsl_cdf_lognormal_Pinv++foreign import ccall unsafe "gsl/gsl_randist.h"+ gsl_cdf_lognormal_Pinv :: CDouble -> CDouble -> CDouble -> CDouble++lognormalQInv :: Double -> Double -> Double -> Double+lognormalQInv = liftDouble3 gsl_cdf_lognormal_Qinv++foreign import ccall unsafe "gsl/gsl_randist.h"+ gsl_cdf_lognormal_Qinv :: CDouble -> CDouble -> CDouble -> CDouble+