> ## 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 Conditional Entropy

> Calculates the conditional entropy H(Y|X) from a joint probability distribution, measuring the remaining uncertainty in Y given knowledge of X. Conditional entropy quantifies how much information Y provides beyond what's known from X, crucial for understanding predictive relationships.

**Use Cases:**
- Measure predictive power of indicators
- Quantify information gain from additional features
- Assess value of conditioning on market states
- Evaluate forecasting model informativeness
- Analyze dependencies in multi-factor models

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

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



## OpenAPI

````yaml api-specs/physics.json post /quantlib/physics/entropy/conditional
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/conditional:
    post:
      tags:
        - quantlib-physics
      summary: Calculate Conditional Entropy
      description: >-
        Calculates the conditional entropy H(Y|X) from a joint probability
        distribution, measuring the remaining uncertainty in Y given knowledge
        of X. Conditional entropy quantifies how much information Y provides
        beyond what's known from X, crucial for understanding predictive
        relationships.


        **Use Cases:**

        - Measure predictive power of indicators

        - Quantify information gain from additional features

        - Assess value of conditioning on market states

        - Evaluate forecasting model informativeness

        - Analyze dependencies in multi-factor models


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


        **Credits:** 5 credits per request (Pro Tier) [Tier: ENTERPRISE,
        Credits: 10]
      operationId: conditional_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 P(X,Y) (must sum to 1)
                  example:
                    - - 0.3
                      - 0.1
                      - 0.05
                    - - 0.1
                      - 0.25
                      - 0.1
                    - - 0.05
                      - 0.03
                      - 0.02
                base:
                  type: number
                  description: Logarithm base for entropy calculation
                  default: 2.718281828459045
                  example: 2.718281828459045
            examples:
              market_indicator:
                summary: Uncertainty given market state
                value:
                  joint_prob:
                    - - 0.35
                      - 0.05
                      - 0.05
                    - - 0.05
                      - 0.3
                      - 0.05
                    - - 0.05
                      - 0.05
                      - 0.05
                  base: 2.718281828459045
              signal_dependency:
                summary: Remaining uncertainty after signal
                value:
                  joint_prob:
                    - - 0.4
                      - 0.1
                    - - 0.1
                      - 0.4
                  base: 2
      responses:
        '200':
          description: Conditional entropy calculated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      conditional_entropy:
                        type: number
                        description: >-
                          Conditional entropy H(Y|X) - lower values indicate X
                          is more informative about Y
                        example: 0.7854
        '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

````