corehydro
  • Examples
  • Porting Status
  • Python Reference
  • R Reference

On this page

  • Link
    • Parameters
    • Examples

Link

Link(type, *, inner=None, **parameters)

A link function spec, mirroring the seven Numerics link functions and the five RMC.BestFit-specific ones (the BestFit factory’s own YeoJohnson case routes to the Numerics class – see best_fit_link_function_factory.hpp – so there is one "YeoJohnson", not two). Six of the twelve take construction parameters, passed by keyword.

Parameters

Name Type Description Default
type str One of :func:link_names, matched case-insensitively. required
inner Link A :class:Link wrapped by "Centered"; ignored (and rejected) for every other type. Keyword-only. None
**parameters Named construction parameters: lambda_ for "YeoJohnson"; gamma0, scale, epsilon, delta for "ASinH"; a for "SES"; sigma0, a, lambda_ for "LogSES"; sigma0, log_scale, epsilon, delta for "LogASinH"; mu0, scale for "Centered". lambda_ is spelled with a trailing underscore because lambda is a reserved word in Python (matching the precedent set by :func:corehydropy.stats.box_cox/:func:corehydropy.stats.yeo_johnson, which take lambda_ for the same reason); R spells the same construction parameter lambda (no collision there). A literal lambda=... keyword is a SyntaxError before this class ever sees it, but **{"lambda": ...} still works if written that way. {}

Examples

>>> from corehydropy import link_function, link
>>> l = link_function("Log")
>>> link(l, [1, 10, 100])
array([0.        , 2.30258509, 4.60517019])
>>> yj = link_function("YeoJohnson", lambda_=0.5)
 

corehydro is an independent open-source port of the USACE-RMC Numerics and RMC-BestFit libraries. 0BSD licensed.