Skip to main content
POST
/
quantlib
/
physics
/
entropy
/
shannon
curl --request POST \ --url https://api.fincept.in/quantlib/physics/entropy/shannon \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <api-key>' \ --data ' { "probabilities": [ 0.4, 0.3, 0.2, 0.1 ], "base": 2.718281828459045 } '
{
  "success": true,
  "data": {
    "shannon_entropy": 1.2799,
    "base": 2.718281828459045
  }
}

Authorizations

X-API-Key
string
header
required

API key for authentication. Get your key at https://api.fincept.in/auth/register

Body

application/json
probabilities
number[]
required

Discrete probability distribution (must sum to 1)

Example:
[0.25, 0.25, 0.25, 0.25]
base
number
default:2.718281828459045

Logarithm base for entropy calculation (e=2.718 for nats, 2 for bits, 10 for dits)

Example:

2.718281828459045

Response

Shannon entropy calculated successfully

success
boolean
Example:

true

data
object