gw

gw

Generalized Weibull (GW) tail estimation and directional tail analysis.

Line-by-line ports of EVTools::FitGW_iHilli, EVTools::qGWdisp, EVTools::h (R package EVTools) esextr.R, collect.R, taildir.R (KNMI R scripts) Index conventions: R is 1-based; comments give the R expression where helpful.

Functions

Name Description
FitGW_iHilli Port of EVTools::FitGW_iHilli (GW tail fit with implicit joint shape/scale solution).
assigncat assigncat.R: logical matrix (len(y) x nbins) of direction-bin membership.
collect collect.R: indices (1-based) of the resampled series, in the order of the original series.
esextr esextr.R: estimates for the thresholds l0 (in the order of l0, NA where absent).
h EVTools::h: (lambda^theta - 1)/theta, log(lambda) for theta ~ 0.
qGWdisp Port of EVTools::qGWdisp: GW quantiles (and standard errors) from location/dispersion/shape.
rank_transform wlt <- -log(index) + log(N+1), index = ranks of -v (ties in order of occurrence).
taildir Port of taildir.R: directional GW tails, consistent with the omni tail.

FitGW_iHilli

gw.FitGW_iHilli(
    X,
    p=None,
    N=0,
    r11=1,
    fixedpar=None,
    l0=None,
    sigma=np.inf,
    metadata=None,
)

Port of EVTools::FitGW_iHilli (GW tail fit with implicit joint shape/scale solution).

assigncat

gw.assigncat(y, lbin, ubin)

assigncat.R: logical matrix (len(y) x nbins) of direction-bin membership.

collect

gw.collect(blockno, blocks)

collect.R: indices (1-based) of the resampled series, in the order of the original series.

esextr

gw.esextr(es, l0)

esextr.R: estimates for the thresholds l0 (in the order of l0, NA where absent).

h

gw.h(theta, lam)

EVTools::h: (lambda^theta - 1)/theta, log(lambda) for theta ~ 0.

qGWdisp

gw.qGWdisp(
    p,
    p0,
    q0,
    logdisp,
    theta,
    q0Std=np.nan,
    logdispStd=np.nan,
    thetaStd=np.nan,
)

Port of EVTools::qGWdisp: GW quantiles (and standard errors) from location/dispersion/shape.

rank_transform

gw.rank_transform(v, N)

wlt <- -log(index) + log(N+1), index = ranks of -v (ties in order of occurrence).

taildir

gw.taildir(fixdata, wlmm, winddir, bins, r11values=None)

Port of taildir.R: directional GW tails, consistent with the omni tail.

fixdata: dict with metadata, N, factor, pthreshold (scalar), kthresh, mthresh (1-based), theta0, theta0Std (None or arrays of length lcats), es, x, freq bins: kuststatistiek.settings.Bins (lbin, ubin, cats, lbinsm, ubinsm, lbin0, ubin0, cats0, binlink)