> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fincept.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Calculate Joint Entropy

> Calculates the joint entropy of two random variables from their joint probability distribution, measuring the total uncertainty in the combined system. Joint entropy is fundamental for understanding multivariate dependencies in financial systems.

**Use Cases:**
- Measure total uncertainty in multi-asset portfolios
- Analyze joint behavior of market indicators
- Quantify information in paired trading strategies
- Assess complexity of multi-factor models
- Study correlations in risk factors

**Formula:** H(X,Y) = -ΣΣ p(x,y) log(p(x,y))

**Credits:** 5 credits per request (Pro Tier) [Tier: ENTERPRISE, Credits: 10]



## OpenAPI

````yaml api-specs/physics.json post /quantlib/physics/entropy/joint
openapi: 3.1.0
info:
  title: FinceptQuantLib API - Physics Module
  description: >-
    Physics and Information Theory module for FinceptQuantLib API. Includes
    Shannon/Renyi/Tsallis entropy, KL/JS divergence, mutual information,
    transfer entropy, Fisher information, Boltzmann distribution, Ising model,
    maximum entropy, thermodynamics (free energy, Carnot cycle, van der Waals
    equation), and Maxwell relations. **Pro Tier required. 5 credits per
    request.**
  version: 3.0.0
  contact:
    name: Fincept API Support
    url: https://fincept.in
servers:
  - url: https://api.fincept.in
    description: Fincept API Production Server
security:
  - APIKeyHeader: []
tags:
  - name: quantlib-physics
    description: Physics and Information Theory module for FinceptQuantLib API
    x-displayName: Physics
paths:
  /quantlib/physics/entropy/joint:
    post:
      tags:
        - quantlib-physics
      summary: Calculate Joint Entropy
      description: >-
        Calculates the joint entropy of two random variables from their joint
        probability distribution, measuring the total uncertainty in the
        combined system. Joint entropy is fundamental for understanding
        multivariate dependencies in financial systems.


        **Use Cases:**

        - Measure total uncertainty in multi-asset portfolios

        - Analyze joint behavior of market indicators

        - Quantify information in paired trading strategies

        - Assess complexity of multi-factor models

        - Study correlations in risk factors


        **Formula:** H(X,Y) = -ΣΣ p(x,y) log(p(x,y))


        **Credits:** 5 credits per request (Pro Tier) [Tier: ENTERPRISE,
        Credits: 10]
      operationId: joint_entropy
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - joint_prob
              properties:
                joint_prob:
                  type: array
                  items:
                    type: array
                    items:
                      type: number
                  description: Joint probability matrix (must sum to 1 across all elements)
                  example:
                    - - 0.2
                      - 0.1
                      - 0.05
                    - - 0.15
                      - 0.25
                      - 0.1
                    - - 0.05
                      - 0.05
                      - 0.05
                base:
                  type: number
                  description: Logarithm base for entropy calculation
                  default: 2.718281828459045
                  example: 2.718281828459045
            examples:
              asset_pair:
                summary: Two-asset joint distribution
                value:
                  joint_prob:
                    - - 0.3
                      - 0.1
                      - 0.05
                    - - 0.1
                      - 0.25
                      - 0.1
                    - - 0.05
                      - 0.03
                      - 0.02
                  base: 2.718281828459045
              independent:
                summary: Independent variables
                value:
                  joint_prob:
                    - - 0.15
                      - 0.15
                    - - 0.35
                      - 0.35
                  base: 2
      responses:
        '200':
          description: Joint entropy calculated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      joint_entropy:
                        type: number
                        description: Joint entropy value (bits or nats depending on base)
                        example: 1.8965
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '402':
          $ref: '#/components/responses/InsufficientCreditsError'
        '422':
          $ref: '#/components/responses/ValidationError'
components:
  responses:
    UnauthorizedError:
      description: Authentication information is missing or invalid
      content:
        application/json:
          schema:
            type: object
            properties:
              detail:
                type: string
                example: Invalid API key
    InsufficientCreditsError:
      description: Insufficient API credits
      content:
        application/json:
          schema:
            type: object
            properties:
              detail:
                type: string
                example: Insufficient credits. This endpoint requires 5 credits.
    ValidationError:
      description: Request validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              detail:
                type: array
                items:
                  type: object
                  properties:
                    loc:
                      type: array
                      items:
                        type: string
                    msg:
                      type: string
                    type:
                      type: string
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        API key for authentication. Get your key at
        https://api.fincept.in/auth/register

````