Skip to main content
POST
/
quantlib
/
physics
/
divergence
/
js
curl --request POST \
  --url https://finceptbackend.share.zrok.io/quantlib/physics/divergence/js \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "p": [
    0.4,
    0.3,
    0.2,
    0.1
  ],
  "q": [
    0.35,
    0.35,
    0.2,
    0.1
  ],
  "base": 2.718281828459045
}
'
{
  "success": true,
  "data": {
    "js_divergence": 0.0234
  }
}

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

First probability distribution (must sum to 1)

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

Second probability distribution (must sum to 1)

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

Logarithm base for divergence calculation

Example:

2.718281828459045

Response

JS divergence calculated successfully

success
boolean
Example:

true

data
object