Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

natstobits

convert nats into bits


Description

natstobits takes a value in nats (a double) as input and returns the value in bits (a double).

Usage

natstobits(H)

Arguments

H

double denoting a value (in nats), as returned by one of the function of the infotheo package

Details

Information-theoretic quantities can have different units depending on the base of the logarithm used in their computation. All the function of tha package use a base e, hence the unit is the nat. The value in bit is given by using the base 2, hence the conversion is done by multiplying by log2(e) = 1.442695.

Value

natstobits returns a double that is the conversion of the nats value into bits.

Author(s)

Patrick E. Meyer

Examples

data(USArrests)
  H <- entropy(discretize(USArrests))
  natstobits(H)

infotheo

Information-Theoretic Measures

v1.2.0
GPL (>= 3)
Authors
Patrick E. Meyer
Initial release
2014-07

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.