fips.Constant#
- class fips.Constant(*, within=None)[source]#
Bases:
_KernelA correlation of one between every two labels (of a group, with within).
- Parameters:
within (
str|Sequence[str] |None) – Correlate only labels that are the same on these levels; labels of different groups are independent."level.attribute"groups by an attribute of a datetime level ("obs_time.date").
Examples
Errors shared by every observation of a site on one day:
>>> import pandas as pd >>> from fips import Constant, Space >>> times = pd.to_datetime( ... ["2024-01-01 10:00", "2024-01-01 14:00", "2024-01-02 10:00"] ... ) >>> obs = pd.MultiIndex.from_product([["A"], times], names=["site", "obs_time"]) >>> model = Constant(within=["site", "obs_time.date"]) >>> model.with_std(1.0).build(Space({"co2": obs})).dense() array([[1., 1., 0.], [1., 1., 0.], [0., 0., 1.]])
Attributes
No levels, since the correlation is one at any distance. |
|
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: with_std