Extremwertanalyse und Quantilschätzung unter Verwendung von Log Pearson Typ 3 (Pearson III) Verteilung - R gegen PythonPython

Python-Programme
Anonymous
 Extremwertanalyse und Quantilschätzung unter Verwendung von Log Pearson Typ 3 (Pearson III) Verteilung - R gegen Python

Post by Anonymous »

Ich versuche, Quantile für einige Schneedaten unter Verwendung der Log Pearson Typ 3 -Verteilung in Python abzuschätzen und mit R zu vergleichen. Ich mache dies, indem ich in den Daten liest, log -transformiert, Pearson Typ 3 anpasst, Quantile schätzt und dann aus dem Protokollraum zurückträgt.

Code: Select all

import numpy as np
import matplotlib.pyplot as plt
import scipy.stats as stats
import lmoments3 as lm
import lmoments3.distr as ld

data=np.array([[1079],
[ 889],
[ 996],
[1476],
[1567],
[ 897],
[ 991],
[1222],
[1372],
[1450],
[1077],
[1354],
[1029],
[1699],
[ 965],
[1133],
[1951],
[1621],
[1069],
[ 930],
[1039],
[1839]])

return_periods = np.array([2,3,5,10,20,50,100,200,1000])

log_data = np.log(data)
params = stats.pearson3.fit(log_data) #Max likelihood estimation method
quantiles = np.exp(stats.pearson3.ppf(1 - 1 / return_periods, *params))

paramsmm=ld.pe3.lmom_fit(log_data) #lmoments estimation method
paramsmm2=(paramsmm["skew"], paramsmm['loc'], paramsmm['scale'][0])
quantilesmm = np.exp(ld.pe3.ppf(1 - 1 / return_periods, *paramsmm2))

print(quantiles)
print(quantilesmm)
< /code>
in r: < /p>
library(lmom)
library(lmomco)
library(FAdist)

swe_data

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post