Module: Freql::ZipF
- Defined in:
- lib/freql/zipf.rb
Class Method Summary collapse
- .calc_zipf(occurances, total) ⇒ Object
- .zipf_to_cb(zipf) ⇒ Object
- .zipf_to_fpbw(zipf) ⇒ Object
- .zipf_to_fpmw(zipf) ⇒ Object
- .zipf_to_fq(zipf) ⇒ Object
Class Method Details
.calc_zipf(occurances, total) ⇒ Object
30 31 32 |
# File 'lib/freql/zipf.rb', line 30 def calc_zipf occurances, total Math.log10(occurances / total.to_f)+9 end |
.zipf_to_cb(zipf) ⇒ Object
26 27 28 |
# File 'lib/freql/zipf.rb', line 26 def zipf_to_cb zipf (zipf * 100.0) - 900.00 end |
.zipf_to_fpbw(zipf) ⇒ Object
23 24 25 |
# File 'lib/freql/zipf.rb', line 23 def zipf_to_fpbw zipf 10.00 ** zipf end |
.zipf_to_fpmw(zipf) ⇒ Object
20 21 22 |
# File 'lib/freql/zipf.rb', line 20 def zipf_to_fpmw zipf 10.00 ** zipf / 1000 end |
.zipf_to_fq(zipf) ⇒ Object
17 18 19 |
# File 'lib/freql/zipf.rb', line 17 def zipf_to_fq zipf 10.00**zipf / 1e9 end |