> ## 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 Extreme Value (GEV) Distribution

> Fits a Generalized Extreme Value distribution to block maxima (e.g., maximum annual losses). GEV combines three types of extreme value distributions (Gumbel, Frechet, Weibull) and is used to model rare events like maximum flood levels, worst portfolio losses, or largest operational losses. Essential for return level estimation and long-term risk planning. [Tier: PRO, Credits: 5]



## OpenAPI

````yaml api-specs/risk.json post /quantlib/risk/evt/gev
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/gev:
    post:
      tags:
        - quantlib-risk
      summary: Generalized Extreme Value (GEV) Distribution
      description: >-
        Fits a Generalized Extreme Value distribution to block maxima (e.g.,
        maximum annual losses). GEV combines three types of extreme value
        distributions (Gumbel, Frechet, Weibull) and is used to model rare
        events like maximum flood levels, worst portfolio losses, or largest
        operational losses. Essential for return level estimation and long-term
        risk planning. [Tier: PRO, Credits: 5]
      operationId: evt_gev
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - data
              properties:
                data:
                  type: array
                  description: Block maxima (e.g., annual maximum losses)
                  items:
                    type: number
                  minItems: 20
                  example:
                    - -0.08
                    - -0.12
                    - -0.05
                    - -0.15
                fit_method:
                  type: string
                  description: Fitting method
                  enum:
                    - mle
                    - pwm
                  example: mle
                  default: mle
                return_periods:
                  type: array
                  description: >-
                    Return periods (in years) for which to calculate return
                    levels
                  items:
                    type: number
                  example:
                    - 10
                    - 50
                    - 100
                    - 250
                  nullable: true
            example:
              data:
                - -0.08
                - -0.12
                - -0.05
                - -0.15
                - -0.09
                - -0.18
                - -0.11
              fit_method: mle
              return_periods:
                - 10
                - 50
                - 100
                - 250
      responses:
        '200':
          description: GEV fit results
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      mu:
                        type: number
                        description: Location parameter
                        example: -0.105
                      sigma:
                        type: number
                        description: Scale parameter
                        example: 0.035
                      xi:
                        type: number
                        description: Shape parameter (tail index)
                        example: 0.18
                      return_levels:
                        type: object
                        description: Return levels for specified return periods
                        additionalProperties:
                          type: number
                        example:
                          '10': -0.185
                          '50': -0.245
                          '100': -0.278
                          '250': -0.325
              example:
                success: true
                data:
                  mu: -0.105
                  sigma: 0.035
                  xi: 0.18
                  return_levels:
                    '10': -0.185
                    '50': -0.245
                    '100': -0.278
                    '250': -0.325
        '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

````