Module: Freql::CB
- Defined in:
- lib/freql/cb.rb
Class Method Summary collapse
- .calc_cb(occurances, total) ⇒ Object
- .cb_to_fpbw(cb) ⇒ Object
- .cb_to_fpmw(cb) ⇒ Object
- .cb_to_fq(cb) ⇒ Object
- .cb_to_zipf(cb) ⇒ Object
Class Method Details
.calc_cb(occurances, total) ⇒ Object
45 46 47 |
# File 'lib/freql/cb.rb', line 45 def calc_cb occurances, total Math.log10(occurances / total.to_f) * 100.0 end |
.cb_to_fpbw(cb) ⇒ Object
38 39 40 |
# File 'lib/freql/cb.rb', line 38 def cb_to_fpbw cb (10.00 ** (-cb.abs / 100.00)) * 1000000000 end |
.cb_to_fpmw(cb) ⇒ Object
35 36 37 |
# File 'lib/freql/cb.rb', line 35 def cb_to_fpmw cb (10.00 ** (-cb.abs / 100.00)) * 1000000 end |
.cb_to_fq(cb) ⇒ Object
32 33 34 |
# File 'lib/freql/cb.rb', line 32 def cb_to_fq cb 10.00 ** (-cb.abs / 100.00) end |
.cb_to_zipf(cb) ⇒ Object
41 42 43 |
# File 'lib/freql/cb.rb', line 41 def cb_to_zipf cb (-cb.abs + 900.00) / 100.00 end |