对于给定的数据集,我们使用 R 计算了 GEV 参数 - 形状、位置和比例。过去有人使用相同的参数使用matlab绘制GEV曲线 - 结果是这样发布的:
我需要使用 matplotlib 绘制 GEV 曲线——但是计算出的形状、位置和比例参数不会产生相同的曲线——我可能会遗漏什么吗?可能我计算y不正确,因为y仅介于 0 和 1 之间,而原始数据介于 20 和 55 之间。
在 R 中计算的参数(仅供参考 - 无需查看 R 代码)
library(extRemes)
library(boot)
dataset <- read.table("table.csv")
GEVfit <- fevd(dataset$MAXTEMP,type = "GEV", method = "MLE")
用 Python 绘图
from scipy.stats import genextreme
import numpy as np
import matplotlib.pyplot as plt
shape = -0.168374
loc = 25.649717
scale = 2.37303
x = np.linspace(2, 11000, 100000)
y = genextreme.cdf(x, shape, loc, scale)
plt.xscale('log')
plt.plot(x, y)


