quantile_estimator 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. checksums.yaml +7 -0
  2. data/.ruby-gemset +1 -0
  3. data/.ruby-version +1 -0
  4. data/Gemfile +4 -0
  5. data/Gemfile.lock +17 -0
  6. data/LICENSE.txt +22 -0
  7. data/README.md +85 -0
  8. data/Rakefile +9 -0
  9. data/benchmark.rb +21 -0
  10. data/doc/Cursor.html +422 -0
  11. data/doc/Estimator.html +779 -0
  12. data/doc/Invariant.html +115 -0
  13. data/doc/Invariant/Biased.html +268 -0
  14. data/doc/Invariant/Invariant.html +193 -0
  15. data/doc/Invariant/SingleTarget.html +278 -0
  16. data/doc/Invariant/Targeted.html +278 -0
  17. data/doc/Item.html +620 -0
  18. data/doc/Quantile.html +270 -0
  19. data/doc/QuantileEstimator.html +117 -0
  20. data/doc/_index.html +211 -0
  21. data/doc/class_list.html +54 -0
  22. data/doc/compression.png +0 -0
  23. data/doc/css/common.css +1 -0
  24. data/doc/css/full_list.css +57 -0
  25. data/doc/css/style.css +338 -0
  26. data/doc/file.README.html +186 -0
  27. data/doc/file_list.html +56 -0
  28. data/doc/frames.html +26 -0
  29. data/doc/index.html +186 -0
  30. data/doc/js/app.js +219 -0
  31. data/doc/js/full_list.js +178 -0
  32. data/doc/js/jquery.js +4 -0
  33. data/doc/method_list.html +221 -0
  34. data/doc/time.png +0 -0
  35. data/doc/top-level-namespace.html +114 -0
  36. data/lib/estimator.rb +120 -0
  37. data/lib/quantile_estimator/cursor.rb +24 -0
  38. data/lib/quantile_estimator/invariant.rb +47 -0
  39. data/lib/quantile_estimator/item.rb +21 -0
  40. data/lib/quantile_estimator/quantile.rb +3 -0
  41. data/lib/quantile_estimator/test.rb +37 -0
  42. data/lib/quantile_estimator/version.rb +3 -0
  43. data/pkg/quantile_estimator-0.0.1.gem +0 -0
  44. data/quantile_estimator.gemspec +29 -0
  45. data/test/test_quantile_estimator.rb +85 -0
  46. metadata +120 -0
@@ -0,0 +1,278 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Class: Invariant::SingleTarget
8
+
9
+ &mdash; Documentation by YARD 0.8.7.3
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '../';
20
+ framesUrl = "../frames.html#!" + escape(window.location.href);
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="../_index.html">Index (S)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../Invariant.html" title="Invariant (module)">Invariant</a></span></span>
36
+ &raquo;
37
+ <span class="title">SingleTarget</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="../class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="../method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="../file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
62
+ </div>
63
+
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Class: Invariant::SingleTarget
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+ <dt class="r1">Inherits:</dt>
75
+ <dd class="r1">
76
+ <span class="inheritName"><span class='object_link'><a href="Invariant.html" title="Invariant::Invariant (class)">Invariant</a></span></span>
77
+
78
+ <ul class="fullTree">
79
+ <li>Object</li>
80
+
81
+ <li class="next"><span class='object_link'><a href="Invariant.html" title="Invariant::Invariant (class)">Invariant</a></span></li>
82
+
83
+ <li class="next">Invariant::SingleTarget</li>
84
+
85
+ </ul>
86
+ <a href="#" class="inheritanceTree">show all</a>
87
+
88
+ </dd>
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+ <dt class="r2 last">Defined in:</dt>
99
+ <dd class="r2 last">lib/quantile_estimator/invariant.rb</dd>
100
+
101
+ </dl>
102
+ <div class="clear"></div>
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+
111
+
112
+ <h2>
113
+ Instance Method Summary
114
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
115
+ </h2>
116
+
117
+ <ul class="summary">
118
+
119
+ <li class="public ">
120
+ <span class="summary_signature">
121
+
122
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (SingleTarget) <strong>initialize</strong>(phi, epsilon) </a>
123
+
124
+
125
+
126
+ </span>
127
+
128
+
129
+ <span class="note title constructor">constructor</span>
130
+
131
+
132
+
133
+
134
+
135
+
136
+
137
+
138
+ <span class="summary_desc"><div class='inline'>
139
+ <p>A new instance of SingleTarget.</p>
140
+ </div></span>
141
+
142
+ </li>
143
+
144
+
145
+ <li class="public ">
146
+ <span class="summary_signature">
147
+
148
+ <a href="#upper_bound-instance_method" title="#upper_bound (instance method)">- (Object) <strong>upper_bound</strong>(rank, n) </a>
149
+
150
+
151
+
152
+ </span>
153
+
154
+
155
+
156
+
157
+
158
+
159
+
160
+
161
+
162
+ <span class="summary_desc"><div class='inline'></div></span>
163
+
164
+ </li>
165
+
166
+
167
+ </ul>
168
+
169
+
170
+
171
+
172
+
173
+
174
+
175
+
176
+ <div id="constructor_details" class="method_details_list">
177
+ <h2>Constructor Details</h2>
178
+
179
+ <div class="method_details first">
180
+ <h3 class="signature first" id="initialize-instance_method">
181
+
182
+ - (<tt><span class='object_link'><a href="" title="Invariant::SingleTarget (class)">SingleTarget</a></span></tt>) <strong>initialize</strong>(phi, epsilon)
183
+
184
+
185
+
186
+
187
+
188
+ </h3><div class="docstring">
189
+ <div class="discussion">
190
+
191
+ <p>Returns a new instance of SingleTarget</p>
192
+
193
+
194
+ </div>
195
+ </div>
196
+ <div class="tags">
197
+
198
+
199
+ </div><table class="source_code">
200
+ <tr>
201
+ <td>
202
+ <pre class="lines">
203
+
204
+
205
+ 19
206
+ 20
207
+ 21
208
+ 22</pre>
209
+ </td>
210
+ <td>
211
+ <pre class="code"><span class="info file"># File 'lib/quantile_estimator/invariant.rb', line 19</span>
212
+
213
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_phi'>phi</span><span class='comma'>,</span> <span class='id identifier rubyid_epsilon'>epsilon</span><span class='rparen'>)</span>
214
+ <span class='ivar'>@phi</span> <span class='op'>=</span> <span class='id identifier rubyid_phi'>phi</span>
215
+ <span class='ivar'>@epsilon</span> <span class='op'>=</span> <span class='id identifier rubyid_epsilon'>epsilon</span>
216
+ <span class='kw'>end</span></pre>
217
+ </td>
218
+ </tr>
219
+ </table>
220
+ </div>
221
+
222
+ </div>
223
+
224
+
225
+ <div id="instance_method_details" class="method_details_list">
226
+ <h2>Instance Method Details</h2>
227
+
228
+
229
+ <div class="method_details first">
230
+ <h3 class="signature first" id="upper_bound-instance_method">
231
+
232
+ - (<tt>Object</tt>) <strong>upper_bound</strong>(rank, n)
233
+
234
+
235
+
236
+
237
+
238
+ </h3><table class="source_code">
239
+ <tr>
240
+ <td>
241
+ <pre class="lines">
242
+
243
+
244
+ 24
245
+ 25
246
+ 26
247
+ 27
248
+ 28
249
+ 29
250
+ 30</pre>
251
+ </td>
252
+ <td>
253
+ <pre class="code"><span class="info file"># File 'lib/quantile_estimator/invariant.rb', line 24</span>
254
+
255
+ <span class='kw'>def</span> <span class='id identifier rubyid_upper_bound'>upper_bound</span><span class='lparen'>(</span><span class='id identifier rubyid_rank'>rank</span><span class='comma'>,</span> <span class='id identifier rubyid_n'>n</span><span class='rparen'>)</span>
256
+ <span class='kw'>if</span> <span class='ivar'>@phi</span> <span class='op'>*</span> <span class='id identifier rubyid_n'>n</span> <span class='op'>&lt;=</span> <span class='id identifier rubyid_rank'>rank</span>
257
+ <span class='lparen'>(</span><span class='int'>2</span> <span class='op'>*</span> <span class='ivar'>@epsilon</span> <span class='op'>*</span> <span class='id identifier rubyid_rank'>rank</span><span class='rparen'>)</span> <span class='op'>/</span> <span class='ivar'>@phi</span>
258
+ <span class='kw'>else</span>
259
+ <span class='lparen'>(</span><span class='int'>2</span> <span class='op'>*</span> <span class='ivar'>@epsilon</span> <span class='op'>*</span> <span class='lparen'>(</span><span class='id identifier rubyid_n'>n</span> <span class='op'>-</span> <span class='id identifier rubyid_rank'>rank</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='op'>/</span> <span class='lparen'>(</span><span class='int'>1</span> <span class='op'>-</span> <span class='ivar'>@phi</span><span class='rparen'>)</span>
260
+ <span class='kw'>end</span>
261
+ <span class='kw'>end</span></pre>
262
+ </td>
263
+ </tr>
264
+ </table>
265
+ </div>
266
+
267
+ </div>
268
+
269
+ </div>
270
+
271
+ <div id="footer">
272
+ Generated on Fri Nov 15 15:39:43 2013 by
273
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
274
+ 0.8.7.3 (ruby-2.0.0).
275
+ </div>
276
+
277
+ </body>
278
+ </html>
@@ -0,0 +1,278 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Class: Invariant::Targeted
8
+
9
+ &mdash; Documentation by YARD 0.8.7.3
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '../';
20
+ framesUrl = "../frames.html#!" + escape(window.location.href);
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="../_index.html">Index (T)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../Invariant.html" title="Invariant (module)">Invariant</a></span></span>
36
+ &raquo;
37
+ <span class="title">Targeted</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="../class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="../method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="../file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
62
+ </div>
63
+
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Class: Invariant::Targeted
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+ <dt class="r1">Inherits:</dt>
75
+ <dd class="r1">
76
+ <span class="inheritName"><span class='object_link'><a href="Invariant.html" title="Invariant::Invariant (class)">Invariant</a></span></span>
77
+
78
+ <ul class="fullTree">
79
+ <li>Object</li>
80
+
81
+ <li class="next"><span class='object_link'><a href="Invariant.html" title="Invariant::Invariant (class)">Invariant</a></span></li>
82
+
83
+ <li class="next">Invariant::Targeted</li>
84
+
85
+ </ul>
86
+ <a href="#" class="inheritanceTree">show all</a>
87
+
88
+ </dd>
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+ <dt class="r2 last">Defined in:</dt>
99
+ <dd class="r2 last">lib/quantile_estimator/invariant.rb</dd>
100
+
101
+ </dl>
102
+ <div class="clear"></div>
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+
111
+
112
+ <h2>
113
+ Instance Method Summary
114
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
115
+ </h2>
116
+
117
+ <ul class="summary">
118
+
119
+ <li class="public ">
120
+ <span class="summary_signature">
121
+
122
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (Targeted) <strong>initialize</strong>(target_values) </a>
123
+
124
+
125
+
126
+ </span>
127
+
128
+
129
+ <span class="note title constructor">constructor</span>
130
+
131
+
132
+
133
+
134
+
135
+
136
+
137
+
138
+ <span class="summary_desc"><div class='inline'>
139
+ <p>A new instance of Targeted.</p>
140
+ </div></span>
141
+
142
+ </li>
143
+
144
+
145
+ <li class="public ">
146
+ <span class="summary_signature">
147
+
148
+ <a href="#upper_bound-instance_method" title="#upper_bound (instance method)">- (Object) <strong>upper_bound</strong>(rank, n) </a>
149
+
150
+
151
+
152
+ </span>
153
+
154
+
155
+
156
+
157
+
158
+
159
+
160
+
161
+
162
+ <span class="summary_desc"><div class='inline'></div></span>
163
+
164
+ </li>
165
+
166
+
167
+ </ul>
168
+
169
+
170
+
171
+
172
+
173
+
174
+
175
+
176
+ <div id="constructor_details" class="method_details_list">
177
+ <h2>Constructor Details</h2>
178
+
179
+ <div class="method_details first">
180
+ <h3 class="signature first" id="initialize-instance_method">
181
+
182
+ - (<tt><span class='object_link'><a href="" title="Invariant::Targeted (class)">Targeted</a></span></tt>) <strong>initialize</strong>(target_values)
183
+
184
+
185
+
186
+
187
+
188
+ </h3><div class="docstring">
189
+ <div class="discussion">
190
+
191
+ <p>Returns a new instance of Targeted</p>
192
+
193
+
194
+ </div>
195
+ </div>
196
+ <div class="tags">
197
+
198
+
199
+ </div><table class="source_code">
200
+ <tr>
201
+ <td>
202
+ <pre class="lines">
203
+
204
+
205
+ 34
206
+ 35
207
+ 36
208
+ 37
209
+ 38
210
+ 39</pre>
211
+ </td>
212
+ <td>
213
+ <pre class="code"><span class="info file"># File 'lib/quantile_estimator/invariant.rb', line 34</span>
214
+
215
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_target_values'>target_values</span><span class='rparen'>)</span>
216
+ <span class='ivar'>@targets</span> <span class='op'>=</span> <span class='id identifier rubyid_target_values'>target_values</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_target_value'>target_value</span><span class='op'>|</span>
217
+ <span class='id identifier rubyid_phi'>phi</span><span class='comma'>,</span> <span class='id identifier rubyid_epsilon'>epsilon</span> <span class='op'>=</span> <span class='id identifier rubyid_target_value'>target_value</span>
218
+ <span class='const'>SingleTarget</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_phi'>phi</span><span class='comma'>,</span> <span class='id identifier rubyid_epsilon'>epsilon</span><span class='rparen'>)</span>
219
+ <span class='rbrace'>}</span>
220
+ <span class='kw'>end</span></pre>
221
+ </td>
222
+ </tr>
223
+ </table>
224
+ </div>
225
+
226
+ </div>
227
+
228
+
229
+ <div id="instance_method_details" class="method_details_list">
230
+ <h2>Instance Method Details</h2>
231
+
232
+
233
+ <div class="method_details first">
234
+ <h3 class="signature first" id="upper_bound-instance_method">
235
+
236
+ - (<tt>Object</tt>) <strong>upper_bound</strong>(rank, n)
237
+
238
+
239
+
240
+
241
+
242
+ </h3><table class="source_code">
243
+ <tr>
244
+ <td>
245
+ <pre class="lines">
246
+
247
+
248
+ 41
249
+ 42
250
+ 43
251
+ 44
252
+ 45</pre>
253
+ </td>
254
+ <td>
255
+ <pre class="code"><span class="info file"># File 'lib/quantile_estimator/invariant.rb', line 41</span>
256
+
257
+ <span class='kw'>def</span> <span class='id identifier rubyid_upper_bound'>upper_bound</span><span class='lparen'>(</span><span class='id identifier rubyid_rank'>rank</span><span class='comma'>,</span> <span class='id identifier rubyid_n'>n</span><span class='rparen'>)</span>
258
+ <span class='ivar'>@targets</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_target'>target</span><span class='op'>|</span>
259
+ <span class='id identifier rubyid_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_upper_bound'>upper_bound</span><span class='lparen'>(</span><span class='id identifier rubyid_rank'>rank</span><span class='comma'>,</span> <span class='id identifier rubyid_n'>n</span><span class='rparen'>)</span>
260
+ <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_min'>min</span>
261
+ <span class='kw'>end</span></pre>
262
+ </td>
263
+ </tr>
264
+ </table>
265
+ </div>
266
+
267
+ </div>
268
+
269
+ </div>
270
+
271
+ <div id="footer">
272
+ Generated on Fri Nov 15 15:39:43 2013 by
273
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
274
+ 0.8.7.3 (ruby-2.0.0).
275
+ </div>
276
+
277
+ </body>
278
+ </html>