rb-gsl 1.16.0.2 → 1.16.0.3.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +5 -0
- data/README +2 -2
- data/Rakefile +2 -3
- data/lib/gsl/version.rb +1 -1
- data/rdoc/alf.rdoc +5 -5
- data/rdoc/blas.rdoc +8 -8
- data/rdoc/bspline.rdoc +16 -16
- data/rdoc/changes.rdoc +4 -9
- data/rdoc/cheb.rdoc +24 -24
- data/rdoc/cholesky_complex.rdoc +21 -21
- data/rdoc/combi.rdoc +36 -36
- data/rdoc/complex.rdoc +21 -21
- data/rdoc/const.rdoc +46 -46
- data/rdoc/dht.rdoc +48 -48
- data/rdoc/diff.rdoc +41 -41
- data/rdoc/ehandling.rdoc +5 -5
- data/rdoc/eigen.rdoc +152 -152
- data/rdoc/fft.rdoc +145 -145
- data/rdoc/fit.rdoc +108 -108
- data/rdoc/function.rdoc +10 -10
- data/rdoc/graph.rdoc +16 -16
- data/rdoc/hist.rdoc +102 -102
- data/rdoc/hist2d.rdoc +41 -41
- data/rdoc/hist3d.rdoc +8 -8
- data/rdoc/index.rdoc +18 -21
- data/rdoc/integration.rdoc +109 -109
- data/rdoc/interp.rdoc +70 -70
- data/rdoc/intro.rdoc +6 -6
- data/rdoc/linalg.rdoc +187 -187
- data/rdoc/linalg_complex.rdoc +1 -1
- data/rdoc/math.rdoc +57 -57
- data/rdoc/matrix.rdoc +272 -272
- data/rdoc/min.rdoc +56 -56
- data/rdoc/monte.rdoc +21 -21
- data/rdoc/multimin.rdoc +94 -94
- data/rdoc/multiroot.rdoc +79 -79
- data/rdoc/narray.rdoc +31 -31
- data/rdoc/ndlinear.rdoc +53 -53
- data/rdoc/nonlinearfit.rdoc +99 -99
- data/rdoc/ntuple.rdoc +30 -30
- data/rdoc/odeiv.rdoc +87 -87
- data/rdoc/perm.rdoc +89 -89
- data/rdoc/poly.rdoc +65 -65
- data/rdoc/qrng.rdoc +20 -20
- data/rdoc/randist.rdoc +81 -81
- data/rdoc/ref.rdoc +56 -56
- data/rdoc/rng.rdoc +84 -84
- data/rdoc/roots.rdoc +56 -56
- data/rdoc/sf.rdoc +427 -427
- data/rdoc/siman.rdoc +18 -18
- data/rdoc/sort.rdoc +29 -29
- data/rdoc/start.rdoc +8 -8
- data/rdoc/stats.rdoc +51 -51
- data/rdoc/sum.rdoc +11 -11
- data/rdoc/tensor.rdoc +30 -30
- data/rdoc/tut.rdoc +1 -1
- data/rdoc/use.rdoc +37 -37
- data/rdoc/vector.rdoc +187 -187
- data/rdoc/vector_complex.rdoc +23 -23
- data/rdoc/wavelet.rdoc +46 -46
- metadata +17 -20
- data/rdoc/rngextra.rdoc +0 -11
- data/rdoc/screenshot.rdoc +0 -40
data/rdoc/hist.rdoc
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
#
|
2
2
|
# = Histograms
|
3
|
-
# 1. {Histogram allocation}[link:
|
4
|
-
# 1. {Copying histograms}[link:
|
5
|
-
# 1. {Updating and accessing histogram elements}[link:
|
6
|
-
# 1. {Searching histogram ranges}[link:
|
7
|
-
# 1. {Histogram Statistics}[link:
|
8
|
-
# 1. {Histogram Operations}[link:
|
9
|
-
# 1. {Reading and writing histograms}[link:
|
10
|
-
# 1. {Extensions}[link:
|
11
|
-
# 1. {Histogram Operations}[link:
|
12
|
-
# 1. {Graph interface}[link:
|
13
|
-
# 1. {Histogram Fittings}[link:
|
14
|
-
# 1. {The histogram probability distribution}[link:
|
15
|
-
#
|
16
|
-
# ==
|
3
|
+
# 1. {Histogram allocation}[link:hist_rdoc.html#label-Histogram+allocation]
|
4
|
+
# 1. {Copying histograms}[link:hist_rdoc.html#label-Copying+Histograms]
|
5
|
+
# 1. {Updating and accessing histogram elements}[link:hist_rdoc.html#label-Updating+and+accessing+histogram+elements]
|
6
|
+
# 1. {Searching histogram ranges}[link:hist_rdoc.html#label-Searching+histogram+ranges]
|
7
|
+
# 1. {Histogram Statistics}[link:hist_rdoc.html#label-Histogram+Statistics]
|
8
|
+
# 1. {Histogram Operations}[link:hist_rdoc.html#label-Histogram+Operations]
|
9
|
+
# 1. {Reading and writing histograms}[link:hist_rdoc.html#label-Reading+and+writing+histograms]
|
10
|
+
# 1. {Extensions}[link:hist_rdoc.html#label-Extentions]
|
11
|
+
# 1. {Histogram Operations}[link:hist_rdoc.html#label-Histogram+operations]
|
12
|
+
# 1. {Graph interface}[link:hist_rdoc.html#label-Graphics]
|
13
|
+
# 1. {Histogram Fittings}[link:hist_rdoc.html#label-Fitting]
|
14
|
+
# 1. {The histogram probability distribution}[link:hist_rdoc.html#label-The+histogram+probability+distribution]
|
15
|
+
#
|
16
|
+
# == Histogram allocation
|
17
17
|
# ---
|
18
18
|
# * GSL::Histogram.alloc(n)
|
19
19
|
# * GSL::Histogram.alloc(n, [xmin, xmax])
|
@@ -22,7 +22,7 @@
|
|
22
22
|
# * GSL::Histogram.alloc(array)
|
23
23
|
# * GSL::Histogram.alloc(vector)
|
24
24
|
#
|
25
|
-
# Constructor for a histogram object with <tt>n</tt> bins.
|
25
|
+
# Constructor for a histogram object with <tt>n</tt> bins.
|
26
26
|
#
|
27
27
|
# Examples:
|
28
28
|
#
|
@@ -33,24 +33,24 @@
|
|
33
33
|
# [ bin[0] )[ bin[1] )[ bin[2] )[ bin[3] )
|
34
34
|
# |---------|---------|---------|---------|
|
35
35
|
# range[0] range[1] range[2] range[3] range[4]
|
36
|
-
#
|
36
|
+
#
|
37
37
|
# 1. With an array or a vector:
|
38
38
|
# h = Histogram.alloc([1, 3, 7, 9, 20]) <--- Histogram of 4 bins.
|
39
39
|
# The range is initialized as
|
40
40
|
# range[0] = 1, range[1] = 3, ..., range[4] = 20.
|
41
|
-
#
|
41
|
+
#
|
42
42
|
# 1. With size and the range [min, max]:
|
43
43
|
#
|
44
44
|
# >> h = Histogram.alloc(5, [0, 5])
|
45
45
|
# >> h.range
|
46
|
-
# => GSL::Histogram::Range:
|
46
|
+
# => GSL::Histogram::Range:
|
47
47
|
# [ 0.000e+00 1.000e+00 2.000e+00 3.000e+00 4.000e+00 5.000e+00 ]
|
48
48
|
# >> h.bin
|
49
|
-
# => GSL::Histogram::Bin:
|
49
|
+
# => GSL::Histogram::Bin:
|
50
50
|
# [ 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 ]
|
51
51
|
# >> h.increment(2.5)
|
52
52
|
# >> h.bin
|
53
|
-
# => GSL::Histogram::Bin:
|
53
|
+
# => GSL::Histogram::Bin:
|
54
54
|
# [ 0.000e+00 0.000e+00 1.000e+00 0.000e+00 0.000e+00 ]
|
55
55
|
#
|
56
56
|
# ---
|
@@ -59,26 +59,26 @@
|
|
59
59
|
# * GSL::Histogram.equal_bins_p(h1, h2)
|
60
60
|
# * GSL::Histogram.equal_bins(h1, h2)
|
61
61
|
#
|
62
|
-
# Return 1 if the all of the individual bin ranges of the two histograms
|
62
|
+
# Return 1 if the all of the individual bin ranges of the two histograms
|
63
63
|
# are identical, and 0 otherwise.
|
64
64
|
# ---
|
65
65
|
# * GSL::Histogram.equal_bins_p?(h1, h2)
|
66
66
|
# * GSL::Histogram.equal_bins?(h1, h2)
|
67
67
|
#
|
68
|
-
# Return <tt>true</tt> if the all of the individual bin ranges of the two histograms
|
68
|
+
# Return <tt>true</tt> if the all of the individual bin ranges of the two histograms
|
69
69
|
# are identical, and <tt>false</tt> otherwise.
|
70
70
|
#
|
71
71
|
# ---
|
72
72
|
# * GSL::Histogram#set_ranges(v)
|
73
73
|
#
|
74
|
-
# This sets the ranges of the existing histogram using a {GSL::Vector}[link:
|
74
|
+
# This sets the ranges of the existing histogram using a {GSL::Vector}[link:vector_rdoc.html] object.
|
75
75
|
# ---
|
76
76
|
# * GSL::Histogram#set_ranges_uniform(xmin, xmax)
|
77
77
|
# * GSL::Histogram#set_ranges_uniform([xmin, xmax])
|
78
78
|
#
|
79
|
-
# This method sets the ranges of the existing histogram <tt>self</tt>
|
80
|
-
# to cover the range <tt>xmin</tt> to <tt>xmax</tt> uniformly.
|
81
|
-
# The values of the histogram bins are reset to zero.
|
79
|
+
# This method sets the ranges of the existing histogram <tt>self</tt>
|
80
|
+
# to cover the range <tt>xmin</tt> to <tt>xmax</tt> uniformly.
|
81
|
+
# The values of the histogram bins are reset to zero.
|
82
82
|
# The bin ranges are shown as below,
|
83
83
|
# bin[0] corresponds to xmin <= x < xmin + d
|
84
84
|
# bin[1] corresponds to xmin + d <= x < xmin + 2 d
|
@@ -86,20 +86,20 @@
|
|
86
86
|
# bin[n-1] corresponds to xmin + (n-1)d <= x < xmax
|
87
87
|
# where d is the bin spacing, d = (xmax-xmin)/n.
|
88
88
|
#
|
89
|
-
# ==
|
89
|
+
# == Copying Histograms
|
90
90
|
# ---
|
91
91
|
# * GSL::Histogram.memcpy(dest, src)
|
92
92
|
#
|
93
|
-
# Copies the histogram <tt>src</tt> into the pre-existing histogram <tt>dest</tt>,
|
94
|
-
# making dest into an exact copy of <tt>src</tt>.
|
95
|
-
# The two histograms must be of the same size.
|
93
|
+
# Copies the histogram <tt>src</tt> into the pre-existing histogram <tt>dest</tt>,
|
94
|
+
# making dest into an exact copy of <tt>src</tt>.
|
95
|
+
# The two histograms must be of the same size.
|
96
96
|
# ---
|
97
97
|
# * GSL::Histogram#clone
|
98
98
|
#
|
99
|
-
# Returns a newly created histogram which is an exact copy of the histogram
|
99
|
+
# Returns a newly created histogram which is an exact copy of the histogram
|
100
100
|
# <tt>self</tt>.
|
101
101
|
#
|
102
|
-
# ==
|
102
|
+
# == Updating and accessing histogram elements
|
103
103
|
# ---
|
104
104
|
# * GSL::Histogram#increment(x, weight = 1)
|
105
105
|
# * GSL::Histogram#fill(x, weight = 1)
|
@@ -107,10 +107,10 @@
|
|
107
107
|
#
|
108
108
|
# These methods updates the histogram <tt>self</tt> by adding <tt>weight</tt>
|
109
109
|
# (default = 1) to the bin whose range contains the coordinate <tt>x</tt>.
|
110
|
-
# If <tt>x</tt> is an instance of <tt>GSL::Vector</tt> or <tt>Array</tt>,
|
110
|
+
# If <tt>x</tt> is an instance of <tt>GSL::Vector</tt> or <tt>Array</tt>,
|
111
111
|
# all the elements are filled into the histogram.
|
112
|
-
# If <tt>x</tt> is less than (greater than) the lower limit (upper limit)
|
113
|
-
# of the histogram then none of bins are modified.
|
112
|
+
# If <tt>x</tt> is less than (greater than) the lower limit (upper limit)
|
113
|
+
# of the histogram then none of bins are modified.
|
114
114
|
#
|
115
115
|
# ---
|
116
116
|
# * GSL::Histogram#increment2(x, weight = 1)
|
@@ -118,27 +118,27 @@
|
|
118
118
|
# * GSL::Histogram#accumulate2(x, weight = 1)
|
119
119
|
#
|
120
120
|
# These methods updates the histogram <tt>self</tt> by adding <tt>weight</tt>
|
121
|
-
# to the bin whose range contains the coordinate <tt>x</tt>.
|
121
|
+
# to the bin whose range contains the coordinate <tt>x</tt>.
|
122
122
|
# If <tt>x</tt> is less than the lower limit, the lowest bin is incremented.
|
123
123
|
# If <tt>x</tt> is greater than the upper limit, the highest bin is incremented.
|
124
124
|
#
|
125
125
|
# ---
|
126
126
|
# * GSL::Histogram#get(i)
|
127
|
-
# * GSL::Histogram#[i]
|
127
|
+
# * \GSL::Histogram#[i]
|
128
128
|
#
|
129
|
-
# These methods return the contents of the <tt>i</tt>-th bin of the histogram
|
129
|
+
# These methods return the contents of the <tt>i</tt>-th bin of the histogram
|
130
130
|
# <tt>self</tt>.
|
131
131
|
#
|
132
132
|
# ---
|
133
133
|
# * GSL::Hiatogram#get_range(i)
|
134
134
|
#
|
135
|
-
# This method finds the upper and lower range limits of the <tt>i</tt>-th bin
|
135
|
+
# This method finds the upper and lower range limits of the <tt>i</tt>-th bin
|
136
136
|
# of the histogram <tt>self</tt>, and returns an array [<tt>lower, upper</tt>].
|
137
137
|
#
|
138
138
|
# ---
|
139
139
|
# * GSL::Histogram#range
|
140
140
|
#
|
141
|
-
# This returns a <tt>Vector::View</tt> object as a reference to the pointer
|
141
|
+
# This returns a <tt>Vector::View</tt> object as a reference to the pointer
|
142
142
|
# <tt>double *range</tt> in the <tt>gsl_histogram</tt> struct.
|
143
143
|
#
|
144
144
|
# ---
|
@@ -151,7 +151,7 @@
|
|
151
151
|
# * GSL::Histogram#min
|
152
152
|
# * GSL::Histogram#bins
|
153
153
|
#
|
154
|
-
# These methods return the maximum upper and minimum lower range
|
154
|
+
# These methods return the maximum upper and minimum lower range
|
155
155
|
# limits and the number of bins of the histogram <tt>self</tt>.
|
156
156
|
#
|
157
157
|
# ---
|
@@ -159,14 +159,14 @@
|
|
159
159
|
#
|
160
160
|
# This method resets all the bins in the histogram <tt>self</tt> to zero.
|
161
161
|
#
|
162
|
-
# ==
|
162
|
+
# == Searching histogram ranges
|
163
163
|
# ---
|
164
164
|
# * GSL::Histogram#find(x)
|
165
165
|
#
|
166
|
-
# This method finds and sets the index i to the bin number which
|
166
|
+
# This method finds and sets the index i to the bin number which
|
167
167
|
# covers the coordinate <tt>x</tt> in the histogram <tt>self</tt>.
|
168
168
|
#
|
169
|
-
# ==
|
169
|
+
# == Histogram Statistics
|
170
170
|
# ---
|
171
171
|
# * GSL::Histogram#max_val
|
172
172
|
#
|
@@ -175,8 +175,8 @@
|
|
175
175
|
# ---
|
176
176
|
# * GSL::Histogram#max_bin
|
177
177
|
#
|
178
|
-
# This returns the index of the bin containing the maximum value.
|
179
|
-
# In the case where several bins contain the same maximum value the
|
178
|
+
# This returns the index of the bin containing the maximum value.
|
179
|
+
# In the case where several bins contain the same maximum value the
|
180
180
|
# smallest index is returned.
|
181
181
|
#
|
182
182
|
# ---
|
@@ -187,24 +187,24 @@
|
|
187
187
|
# ---
|
188
188
|
# * GSL::Histogram#min_bin
|
189
189
|
#
|
190
|
-
# This returns the index of the bin containing the minimum value.
|
191
|
-
# In the case where several bins contain the same maximum value
|
190
|
+
# This returns the index of the bin containing the minimum value.
|
191
|
+
# In the case where several bins contain the same maximum value
|
192
192
|
# the smallest index is returned.
|
193
193
|
#
|
194
194
|
# ---
|
195
195
|
# * GSL::Histogram#mean
|
196
196
|
#
|
197
|
-
# This returns the mean of the histogrammed variable,
|
198
|
-
# where the histogram is regarded as a probability distribution.
|
199
|
-
# Negative bin values are ignored for the purposes of this calculation.
|
197
|
+
# This returns the mean of the histogrammed variable,
|
198
|
+
# where the histogram is regarded as a probability distribution.
|
199
|
+
# Negative bin values are ignored for the purposes of this calculation.
|
200
200
|
# The accuracy of the result is limited by the bin width.
|
201
201
|
#
|
202
202
|
# ---
|
203
203
|
# * GSL::Histogram#sigma
|
204
204
|
#
|
205
|
-
# This function returns the standard deviation of the histogrammed variable,
|
206
|
-
# where the histogram is regarded as a probability distribution.
|
207
|
-
# Negative bin values are ignored for the purposes of this calculation.
|
205
|
+
# This function returns the standard deviation of the histogrammed variable,
|
206
|
+
# where the histogram is regarded as a probability distribution.
|
207
|
+
# Negative bin values are ignored for the purposes of this calculation.
|
208
208
|
# The accuracy of the result is limited by the bin width.
|
209
209
|
#
|
210
210
|
# ---
|
@@ -214,7 +214,7 @@
|
|
214
214
|
# to the <tt>iend</tt>-th bin.
|
215
215
|
#
|
216
216
|
#
|
217
|
-
# ==
|
217
|
+
# == Histogram Operations
|
218
218
|
#
|
219
219
|
# ---
|
220
220
|
# * GSL::Histogram#add(h2)
|
@@ -226,7 +226,7 @@
|
|
226
226
|
#
|
227
227
|
#
|
228
228
|
#
|
229
|
-
# ==
|
229
|
+
# == Reading and writing histograms
|
230
230
|
# ---
|
231
231
|
# * GSL::Histogram#fwrite(io)
|
232
232
|
# * GSL::Histogram#fwrite(filename)
|
@@ -238,8 +238,8 @@
|
|
238
238
|
# * GSL::Histogram#fscanf(filename)
|
239
239
|
#
|
240
240
|
#
|
241
|
-
# ==
|
242
|
-
# ===
|
241
|
+
# == Extentions
|
242
|
+
# === Histogram operations
|
243
243
|
# ---
|
244
244
|
# * GSL::Histogram#normalize
|
245
245
|
#
|
@@ -250,43 +250,43 @@
|
|
250
250
|
# * GSL::Histogram#rebin(m = 2)
|
251
251
|
#
|
252
252
|
# This method creates a new histogram merging <tt>m</tt> bins in one in the
|
253
|
-
# histogram <tt>self</tt>. This method cannot be used for histograms of
|
254
|
-
# non-uniform bin size. If <tt>m</tt> is not an exact divider of the number
|
253
|
+
# histogram <tt>self</tt>. This method cannot be used for histograms of
|
254
|
+
# non-uniform bin size. If <tt>m</tt> is not an exact divider of the number
|
255
255
|
# of bins of <tt>self</tt>, the range of the rebinned histogram is extended
|
256
256
|
# not to lose the entries in the last <tt>m-1</tt> (at most) bins.
|
257
257
|
#
|
258
258
|
# Example: a histogram <tt>h</tt> of size 5 with the range [0, 5), binned as
|
259
259
|
#
|
260
|
-
# GSL::Histogram::Range:
|
260
|
+
# GSL::Histogram::Range:
|
261
261
|
# [ 0.000e+00 1.000e+00 2.000e+00 3.000e+00 4.000e+00 5.000e+00 ]
|
262
|
-
# GSL::Histogram::Bin:
|
262
|
+
# GSL::Histogram::Bin:
|
263
263
|
# [ 0.000e+00 3.000e+00 1.000e+00 1.000e+00 3.000e+00 ]
|
264
|
-
#
|
265
|
-
# When a new histogram is created merging two bins into one as
|
264
|
+
#
|
265
|
+
# When a new histogram is created merging two bins into one as
|
266
266
|
# <tt>h2 = h.rebin</tt>, then <tt>h2</tt> looks like
|
267
267
|
#
|
268
|
-
# GSL::Histogram::Range:
|
268
|
+
# GSL::Histogram::Range:
|
269
269
|
# [ 0.000e+00 2.000e+00 4.000e+00 6.000e+00 ]
|
270
|
-
# GSL::Histogram::Bin:
|
270
|
+
# GSL::Histogram::Bin:
|
271
271
|
# [ 3.000e+00 2.000e+00 3.000e+00 ]
|
272
272
|
#
|
273
273
|
# ---
|
274
274
|
# * GSL::Histogram#reverse
|
275
275
|
#
|
276
|
-
# This method create a new histogram reversing the order of the range and the bin of
|
276
|
+
# This method create a new histogram reversing the order of the range and the bin of
|
277
277
|
# histogram <tt>self</tt>.
|
278
|
-
#
|
278
|
+
#
|
279
279
|
# ---
|
280
280
|
# * GSL::Histogram#integrate(istart = 0, iend = n-1)
|
281
281
|
# * GSL::Histogram#integrate([istart, iend])
|
282
282
|
# * GSL::Histogram#integrate(direction = 1 or -1)
|
283
283
|
#
|
284
284
|
# This method calculates cumulative counts of the histogram <tt>self</tt>
|
285
|
-
# from the <tt>istart</tt>-th bin to the <tt>iend</tt>-th bin (<tt>iend</tt> inclusive),
|
286
|
-
# and returns a <tt>GSL::Histogram::Integral</tt>
|
287
|
-
# object. If <tt>istart <= iend</tt> (or <tt>direction == 1</tt>),
|
288
|
-
# the <tt>i</tt>-th bin value of a
|
289
|
-
# <tt>GSL::Histogram::Integral</tt> object <tt>hi</tt> created from a
|
285
|
+
# from the <tt>istart</tt>-th bin to the <tt>iend</tt>-th bin (<tt>iend</tt> inclusive),
|
286
|
+
# and returns a <tt>GSL::Histogram::Integral</tt>
|
287
|
+
# object. If <tt>istart <= iend</tt> (or <tt>direction == 1</tt>),
|
288
|
+
# the <tt>i</tt>-th bin value of a
|
289
|
+
# <tt>GSL::Histogram::Integral</tt> object <tt>hi</tt> created from a
|
290
290
|
# <tt>GSL::Histogram</tt> <tt>h</tt> is given by <tt>hi[i] = hi[i-1] + h[i]</tt>.
|
291
291
|
# If <tt>istart > iend</tt> (or <tt>direction == -1</tt>), <tt>hi[i] = hi[i+1] = h[i]</tt>.
|
292
292
|
#
|
@@ -294,19 +294,19 @@
|
|
294
294
|
# * GSL::Histogram::Integral#differentiate
|
295
295
|
# * GSL::Histogram::Integral#diff
|
296
296
|
#
|
297
|
-
# ===
|
297
|
+
# === Graphics
|
298
298
|
# ---
|
299
299
|
# * GSL::Histogram#graph(options)
|
300
300
|
#
|
301
301
|
# This method uses the GNU plotutils <tt>graph</tt> to draw the histogram <tt>self</tt>.
|
302
302
|
# The options as "-T X -C -l x" etc are given by a String.
|
303
303
|
#
|
304
|
-
# ===
|
304
|
+
# === Fitting
|
305
305
|
# ---
|
306
306
|
# * GSL::Histogram#fit_exponential(binstart = 0, binend = n-1)
|
307
307
|
#
|
308
|
-
# This method fits the histogram <tt>self</tt> to an exponential model
|
309
|
-
# <tt>h[n] = a exp(b x[n])</tt> using the bins of indices from <tt>binstart</tt>
|
308
|
+
# This method fits the histogram <tt>self</tt> to an exponential model
|
309
|
+
# <tt>h[n] = a exp(b x[n])</tt> using the bins of indices from <tt>binstart</tt>
|
310
310
|
# to <tt>binend</tt>. The result is returned as an Array of 6 elements,
|
311
311
|
# <tt>[a, b, erra, errb, sumsq, dof]</tt>, where
|
312
312
|
# * <tt>a</tt>: scale factor
|
@@ -318,8 +318,8 @@
|
|
318
318
|
# ---
|
319
319
|
# * GSL::Histogram#fit_power(binstart = 0, binend = n-1)
|
320
320
|
#
|
321
|
-
# This method fits the histogram <tt>self</tt> to a power-law model
|
322
|
-
# <tt>h[n] = a x[n]^b</tt> using the bins of indices from <tt>binstart</tt>
|
321
|
+
# This method fits the histogram <tt>self</tt> to a power-law model
|
322
|
+
# <tt>h[n] = a x[n]^b</tt> using the bins of indices from <tt>binstart</tt>
|
323
323
|
# to <tt>binend</tt>. The result is returned as an Array of 6 elements,
|
324
324
|
# <tt>[a, b, erra, errb, sumsq, dof]</tt>.
|
325
325
|
#
|
@@ -328,8 +328,8 @@
|
|
328
328
|
#
|
329
329
|
# This method fits the histogram <tt>self</tt> to Gaussian distribution
|
330
330
|
# using the bins of indices from <tt>binstart</tt> to <tt>binend</tt>,
|
331
|
-
# and returns an Array of 8 elements,
|
332
|
-
# <tt>[sigma, mean, height, errsig, errmean, errhei, sumsq, dof]</tt>.
|
331
|
+
# and returns an Array of 8 elements,
|
332
|
+
# <tt>[sigma, mean, height, errsig, errmean, errhei, sumsq, dof]</tt>.
|
333
333
|
#
|
334
334
|
# Example:
|
335
335
|
# #!/usr/bin/env ruby
|
@@ -348,40 +348,40 @@
|
|
348
348
|
# y = height*Ran::gaussian_pdf(x-mean, sigma)
|
349
349
|
# GSL::graph(h, [x, y], "-T X -C -g 3")
|
350
350
|
#
|
351
|
-
# ==
|
352
|
-
# The probability distribution function for a histogram consists of a set of bins
|
353
|
-
# which measure the probability of an event falling into a given range of
|
351
|
+
# == The histogram probability distribution
|
352
|
+
# The probability distribution function for a histogram consists of a set of bins
|
353
|
+
# which measure the probability of an event falling into a given range of
|
354
354
|
# a continuous variable x. A probability distribution function is defined
|
355
|
-
# by the following class, which actually stores the cumulative probability
|
356
|
-
# distribution function. This is the natural quantity for generating samples
|
357
|
-
# via the inverse transform method, because there is a one-to-one mapping
|
358
|
-
# between the cumulative probability distribution and the range [0,1].
|
359
|
-
# It can be shown that by taking a uniform random number in this
|
360
|
-
# range and finding its corresponding coordinate in the cumulative probability
|
355
|
+
# by the following class, which actually stores the cumulative probability
|
356
|
+
# distribution function. This is the natural quantity for generating samples
|
357
|
+
# via the inverse transform method, because there is a one-to-one mapping
|
358
|
+
# between the cumulative probability distribution and the range [0,1].
|
359
|
+
# It can be shown that by taking a uniform random number in this
|
360
|
+
# range and finding its corresponding coordinate in the cumulative probability
|
361
361
|
# distribution we obtain samples with the desired probability distribution.
|
362
362
|
#
|
363
|
-
# ===
|
363
|
+
# === Pdf class
|
364
364
|
# ---
|
365
365
|
# * GSL::Histogram::Pdf.alloc(n)
|
366
366
|
# * GSL::Histogram::Pdf.alloc(h)
|
367
367
|
#
|
368
|
-
# Constructors. If a histogram <tt>h</tt> is given,
|
368
|
+
# Constructors. If a histogram <tt>h</tt> is given,
|
369
369
|
# the probability distribution is initialized with the contents of <tt>h</tt>.
|
370
370
|
#
|
371
371
|
# ---
|
372
372
|
# * GSL::Histogram::Pdf#init(h)
|
373
373
|
#
|
374
|
-
# This initializes the probability distribution <tt>self</tt> with the contents
|
375
|
-
# of the histogram <tt>h</tt>.
|
374
|
+
# This initializes the probability distribution <tt>self</tt> with the contents
|
375
|
+
# of the histogram <tt>h</tt>.
|
376
376
|
#
|
377
377
|
# ---
|
378
378
|
# * GSL::Histogram::Pdf#sample(r)
|
379
379
|
#
|
380
|
-
# This method uses <tt>r</tt>, a uniform random number between zero and one,
|
381
|
-
# to compute a single random sample from the probability distribution <tt>self</tt>.
|
380
|
+
# This method uses <tt>r</tt>, a uniform random number between zero and one,
|
381
|
+
# to compute a single random sample from the probability distribution <tt>self</tt>.
|
382
382
|
# The algorithm used to compute the sample s is given by the following formula,
|
383
383
|
# s = range[i] + delta * (range[i+1] - range[i])
|
384
|
-
# where i is the index which satisfies
|
384
|
+
# where i is the index which satisfies
|
385
385
|
# <tt>sum[i] <= r < sum[i+1]</tt> and <tt>delta</tt> is <tt>(r - sum[i])/(sum[i+1] - sum[i])</tt>.
|
386
386
|
#
|
387
387
|
# ---
|
@@ -392,18 +392,18 @@
|
|
392
392
|
# ---
|
393
393
|
# * GSL::Histogram:Pdf#range
|
394
394
|
#
|
395
|
-
# This returns a <tt>Vector::View</tt> object as a reference to the pointer
|
395
|
+
# This returns a <tt>Vector::View</tt> object as a reference to the pointer
|
396
396
|
# <tt>double *range</tt> in the <tt>gsl_histogram_pdf</tt> struct.
|
397
397
|
# ---
|
398
398
|
# * GSL::Histogram:Pdf#sum
|
399
399
|
#
|
400
|
-
# This returns a <tt>Vector::View</tt> object as a reference to the pointer
|
400
|
+
# This returns a <tt>Vector::View</tt> object as a reference to the pointer
|
401
401
|
# <tt>double *sum</tt> in the <tt>gsl_histogram_pdf</tt> struct.
|
402
402
|
#
|
403
|
-
# {prev}[link:
|
404
|
-
# {next}[link:
|
403
|
+
# {prev}[link:stats_rdoc.html]
|
404
|
+
# {next}[link:hist2d_rdoc.html]
|
405
405
|
#
|
406
|
-
# {Reference index}[link:
|
406
|
+
# {Reference index}[link:ref_rdoc.html]
|
407
407
|
# {top}[link:index.html]
|
408
408
|
#
|
409
409
|
#
|