fips.Gaussian#
- class fips.Gaussian(levels, scale, *, within=None, metric='euclidean')[source]#
Bases:
_DecayA Gaussian correlation, \(\exp(-d^2 / (2 \ell^2))\) at a distance \(d\).
The limit of
Maternas \(\nu \to \infty\): very smooth. On the Earth it takesmetric="chordal"(with the great-circle distance it is not positive-definite).- Parameters:
levels (
str|Sequence[str]) – The levels the distance is measured along (seeExponential).scale (
float|str|Timedelta) – The length scale \(\ell\), positive.within (
str|Sequence[str] |None) – Correlate only labels the same on these levels (seeExponential).metric (
str) – How the distance is measured (seeExponential).
- Raises:
ValueError – As
Exponential, and formetric="haversine".
Examples
>>> import pandas as pd >>> from fips import Gaussian >>> Gaussian("x", 1.0).correlation(pd.DataFrame({"x": [0.0, 1.0]})).round(4) array([[1. , 0.6065], [0.6065, 1. ]])
Attributes
How the distance is measured, |
|
The length scale, a time for a datetime or timedelta level, else in the levels' units (km on the Earth). |
|
The levels on which two labels must be the same to be correlated ( |
Methods
|
Return the correlation between the rows of coords, zero between groups (see |
Inherited
From CorrelationModel: levels, with_std