> ## 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.

# Generalized Pareto Distribution (GPD) - Peaks Over Threshold

> Fits a Generalized Pareto Distribution to extreme tail events using the Peaks Over Threshold (POT) method. GPD is specifically designed to model the tail of a distribution and estimate extreme quantiles beyond observed data. Critical for estimating tail VaR, stress losses, and operational risk capital under Basel III. [Tier: PRO, Credits: 5]



## OpenAPI

````yaml api-specs/risk.json post /quantlib/risk/evt/gpd
openapi: 3.1.0
info:
  title: FinceptQuantLib API - Risk Module
  description: >-
    Professional-grade risk management endpoints including Value at Risk (VaR),
    stress testing, copulas, extreme value theory (EVT), XVA calculations,
    sensitivities, and portfolio hedging. Part of the Pro Tier (5 credits per
    request).
  version: 3.0.0
  contact:
    name: Fincept API Support
    url: https://fincept.in
    email: support@fincept.in
servers:
  - url: https://api.fincept.in
    description: Fincept API Production Server
security:
  - APIKeyHeader: []
tags:
  - name: quantlib-risk
    description: Risk Management Module - Pro Tier (5 credits/request)
    x-displayName: Risk
paths:
  /quantlib/risk/evt/gpd:
    post:
      tags:
        - quantlib-risk
      summary: Generalized Pareto Distribution (GPD) - Peaks Over Threshold
      description: >-
        Fits a Generalized Pareto Distribution to extreme tail events using the
        Peaks Over Threshold (POT) method. GPD is specifically designed to model
        the tail of a distribution and estimate extreme quantiles beyond
        observed data. Critical for estimating tail VaR, stress losses, and
        operational risk capital under Basel III. [Tier: PRO, Credits: 5]
      operationId: evt_gpd
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - data
              properties:
                data:
                  type: array
                  description: Loss or return data for tail analysis
                  items:
                    type: number
                  minItems: 100
                  example:
                    - -0.01
                    - -0.05
                    - -0.03
                    - -0.08
                threshold:
                  type: number
                  description: >-
                    Threshold value for defining extreme events (auto-selected
                    if not provided)
                  example: -0.04
                  nullable: true
                quantile:
                  type: number
                  description: >-
                    Quantile level for threshold selection if threshold not
                    provided
                  example: 0.95
                  default: 0.95
                fit_method:
                  type: string
                  description: Fitting method for GPD parameters
                  enum:
                    - mle
                    - pwm
                  example: mle
                  default: mle
            example:
              data:
                - -0.01
                - -0.05
                - -0.03
                - -0.08
                - -0.02
                - -0.12
                - -0.04
              threshold: -0.05
              quantile: 0.9
              fit_method: mle
      responses:
        '200':
          description: GPD fit results
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      threshold:
                        type: number
                        example: -0.05
                      xi:
                        type: number
                        description: Shape parameter (tail index)
                        example: 0.23
                      beta:
                        type: number
                        description: Scale parameter
                        example: 0.018
                      n_exceedances:
                        type: integer
                        description: Number of observations exceeding threshold
                        example: 45
                      extreme_quantile_99:
                        type: number
                        description: 99% extreme quantile estimate
                        example: -0.142
                      expected_shortfall:
                        type: number
                        description: Expected shortfall beyond threshold
                        example: -0.095
              example:
                success: true
                data:
                  threshold: -0.05
                  xi: 0.23
                  beta: 0.018
                  n_exceedances: 45
                  extreme_quantile_99: -0.142
                  expected_shortfall: -0.095
        '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 for this request
      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

````