R: convert nats into bits

natstobits {infotheo} | R Documentation

## 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)

[Package infotheo version 1.2.0 Index]