使用广义极值分布 (GEV) 计算 Return 值

Calculating Return Value using Generalised Extreme Value Distribution (GEV)

我有 30 年的年度温度数据,想使用 GEV 分布 计算此数据的 Return 值 50 和 100 年 Return 时期.

我的30年数据:

data=[28.01,29.07,28.67,21.57,21.66,24.62,21.45,28.51,22.65,21.57,20.89,20.96,21.05,22.29,20.81,21.08,20.77,23.18,22.98,21.88,21.07,20.74,22.69,22.42,31.81,25.78,29.09,28.11,22.18,21.6]

如何使用 GEV 查找 return 值?

要估计给定 return 周期 T 的 return 水平,首先估计广义极值分布的参数,然后计算生存函数在 1/T 处的倒数拟合分布。 (生存函数 SF(x) 只是 1 - CDF(x)。如果你阅读有关计算 return 级别的内容,你通常会看到问题表述为求解 CDF(x) = 1 - 1/T。这与求解 SF(x) = 1/T 相同。)

这是一个脚本,它使用 scipy.stats.genextreme 来估计您的数据在几个 return 周期的 return 水平。方法genextreme.isf()是生存函数的反函数。

import numpy as np
from scipy.stats import genextreme


data = np.array([28.01, 29.07, 28.67, 21.57, 21.66, 24.62, 21.45, 28.51,
                 22.65, 21.57, 20.89, 20.96, 21.05, 22.29, 20.81, 21.08,
                 20.77, 23.18, 22.98, 21.88, 21.07, 20.74, 22.69, 22.42,
                 31.81, 25.78, 29.09, 28.11, 22.18, 21.6])

# Fit the generalized extreme value distribution to the data.
shape, loc, scale = genextreme.fit(data)
print("Fit parameters:")
print(f"  shape: {shape:.4f}")
print(f"  loc:   {loc:.4f}")
print(f"  scale: {scale:.4f}")
print()

# Compute the return levels for several return periods.
return_periods = np.array([5, 10, 20, 50, 100])
return_levels = genextreme.isf(1/return_periods, shape, loc, scale)

print("Return levels:")
print()
print("Period    Level")
print("(years)   (temp)")

for period, level in zip(return_periods, return_levels):
    print(f'{period:4.0f}  {level:9.2f}')

输出:

Fit parameters:
  shape: -0.9609
  loc:   21.5205
  scale: 1.0533

Return levels:

Period    Level
(years)   (temp)
   5      25.06
  10      29.95
  20      39.45
  50      67.00
 100     111.53