Skip to main content
POST
/
quantlib
/
physics
/
entropy
/
cross
curl --request POST \
  --url https://finceptbackend.share.zrok.io/quantlib/physics/entropy/cross \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "p": [
    0,
    1,
    0,
    0
  ],
  "q": [
    0.1,
    0.7,
    0.15,
    0.05
  ],
  "base": 2.718281828459045
}
'
{
  "success": true,
  "data": {
    "cross_entropy": 1.3254
  }
}

Authorizations

X-API-Key
string
header
required

API key for authentication. Get your key at https://finceptbackend.share.zrok.io/auth/register

Body

application/json
p
number[]
required

True probability distribution (must sum to 1)

Example:
[0.4, 0.3, 0.2, 0.1]
q
number[]
required

Predicted/estimated probability distribution (must sum to 1)

Example:
[0.35, 0.35, 0.2, 0.1]
base
number
default:2.718281828459045

Logarithm base for entropy calculation

Example:

2.718281828459045

Response

Cross entropy calculated successfully

success
boolean
Example:

true

data
object