Sha256: 77ff69239ff19a7ed2d7a2b4bbc63c1b0d5b662fe30eeb3be9c36d21e3fda343

Contents?: true

Size: 334 Bytes

Versions: 16

Compression:

Stored size: 334 Bytes

Contents

#!/usr/bin/env ruby
require("gsl")

N = 10000
rng = GSL::Rng.alloc
data = rng.exponential(2, N)
h = GSL::Histogram.alloc(100, [0, 15])
h.fill(data)

#result = h.fit_exponential
result = h.fit("exponential")
a = result[0]
b = result[1]

x = GSL::Vector.linspace(0, 15, 100)
y = a*GSL::Sf::exp(x*b)
GSL::graph(h, [x, y], "-C -g 3")

  

Version data entries

16 entries across 16 versions & 4 rubygems

Version Path
rb-gsl-1.16.0.4 examples/histogram/exponential.rb
rb-gsl-1.16.0.3 examples/histogram/exponential.rb
rb-gsl-1.16.0.3.rc1 examples/histogram/exponential.rb
gsl-nmatrix-1.15.3.2 examples/histogram/exponential.rb
gsl-nmatrix-1.15.3.1 examples/histogram/exponential.rb
rb-gsl-1.16.0.2 examples/histogram/exponential.rb
rb-gsl-1.16.0.1 examples/histogram/exponential.rb
rb-gsl-1.16.0 examples/histogram/exponential.rb
rb-gsl-1.15.3.2 examples/histogram/exponential.rb
rb-gsl-1.15.3.1 examples/histogram/exponential.rb
blackwinter-gsl-1.15.3.2 examples/histogram/exponential.rb
gsl-nmatrix-1.15.3.0 examples/histogram/exponential.rb
gsl-1.15.3 examples/histogram/exponential.rb
gsl-1.14.7 examples/histogram/exponential.rb
gsl-1.14.6 examples/histogram/exponential.rb
gsl-1.14.5 examples/histogram/exponential.rb