Covariance🍋
Covariance
🍋
Bases: Entity
Nested Covariance class.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cov_list |
List[CovarianceElem]
|
List of elementary covariance composing nested model. |
required |
Raises:
Type | Description |
---|---|
TypeError
|
Covariances do not have the same dimensions. |
Attributes:
Name | Type | Description |
---|---|---|
dimension |
int
|
Covariance dimension. |
cov_elem_list |
List[CovarianceElem]
|
List of elementary covariances. |
sill |
float
|
Covariance sill. |
metric |
List[Metric]
|
Metric defining the covariances (angles and scales). |
cov_number) |
List[Metric]
|
Number of nested models. |
type |
List[str]
|
List of covariance types. |
cov_elem_list: List[CovarianceElem]
property
🍋
Return list of elementary covariances.
Returns:
Type | Description |
---|---|
List[CovarianceElem]
|
List of elementary covariances. |
cov_number: int
property
🍋
dimension: int
property
🍋
metric: List[Metric]
property
🍋
type: List[str]
property
🍋
eval(x, y, method=VariographyMethod.COVARIOGRAM)
🍋
Applies a covariance model to a distance matrix computed from a set of vectors.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
Vector
|
First vector. |
required |
y |
Vector
|
Second vector. |
required |
method |
VariographyMethod
|
Method used for computation. Defaults to "COVARIOGRAM". |
COVARIOGRAM
|
Returns:
Type | Description |
---|---|
float
|
Computed covariance. |
plot(angles=[0, 0, 0], method=VariographyMethod.SEMIVARIOGRAM, maxlag=None, save_file=None)
🍋
Plot covariance along a direction.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
angles |
Angles
|
Direction to plot covariance along, by default [0, 0, 0]. |
[0, 0, 0]
|
method |
VariographyMethod
|
Method used for computation, by default 'SEMIVARIOGRAM'. |
SEMIVARIOGRAM
|
maxlag |
Optional[int]
|
Maximum distance to compute covariance. |
None
|
save_file |
Optional[str]
|
Filename of saved figure. Defaults to None. |
None
|
CovarianceElem
🍋
Bases: Entity
Elementary covariance base class. Abstract base class, to be defined by its children.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dimension |
int
|
Covariance dimension. |
3
|
sill |
float
|
Covariance sill. |
1.0
|
metric |
Optional[Metric]
|
Metric information. |
None
|
Attributes:
Name | Type | Description |
---|---|---|
dimension |
int
|
Covariance dimension. |
sill |
float
|
Covariance sill. |
metric |
Metric
|
Metric information. |
type |
str
|
Covariance type. |
dimension: int
property
🍋
metric: Metric
property
🍋
cov_func(h)
abstractmethod
🍋
Return covariance function applied on a distance h.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
h |
ndarray
|
Metric to apply covariance function on. |
required |
eval(x, y, method=VariographyMethod.COVARIOGRAM)
🍋
Applies a covariance model to a distance matrix computed from a set of vectors.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
Vector
|
First vector. |
required |
y |
Vector
|
Second vector. |
required |
method |
VariographyMethod
|
Method used for computation, by default 'COVARIOGRAM'. |
COVARIOGRAM
|
Returns:
Type | Description |
---|---|
float
|
Computed covariance |
plot(angles=[0, 0, 0], method=VariographyMethod.SEMIVARIOGRAM, maxlag=None, save_file=None)
🍋
Plot covariance along a direction.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
angles |
Angles
|
Direction to plot covariance along, by default [0, 0, 0]. |
[0, 0, 0]
|
method |
VariographyMethod
|
Method used for computation, by default 'SEMIVARIOGRAM'. |
SEMIVARIOGRAM
|
maxlag |
Optional[int]
|
Maximum distance to compute covariance. |
None
|
save_file |
Optional[str]
|
Filename of saved figure. Defaults to None. |
None
|
Exponential
🍋
Bases: CovarianceElem
Exponential Covariance Elementary base class. Metric scales correspond to practical ranges.
Attributes:
Name | Type | Description |
---|---|---|
dimension |
int
|
Covariance dimension. |
sill |
float
|
Covariance sill. |
metric |
Metric
|
Metric. Scales correspond to practical ranges. |
Gaussian
🍋
Bases: CovarianceElem
Gaussian Covariance Elementary base class. Metric scales correspond to practical ranges.
Attributes:
Name | Type | Description |
---|---|---|
dimension |
int
|
Covariance dimension. |
sill |
float
|
Covariance sill. |
metric |
Metric
|
Metric. Scales correspond to practical ranges. |
Nugget
🍋
Bases: CovarianceElem
Nugget Covariance Elementary base class.
Attributes:
Name | Type | Description |
---|---|---|
dimension |
int
|
Covariance dimension. |
sill |
float
|
Covariance sill. |
metric |
Metric
|
Metric. |
Spherical
🍋
Bases: CovarianceElem
Spherical Covariance Elementary base class.
Attributes:
Name | Type | Description |
---|---|---|
dimension |
int
|
Covariance dimension. |
sill |
float
|
Covariance sill. |
metric |
Metric
|
Metric. |
cvv(cov, cell_size, discr=None, lag=None)
🍋
Applies a covariance model to a given grid for variance calculus.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cov |
Union[Covariance, CovarianceElem]
|
Covariance model to be applied. |
required |
cell_size |
Vector
|
Size of cell for block covariance computation. |
required |
discr |
Optional[Vector]
|
Number of discretization per cell. |
None
|
lag |
Optional[Vector]
|
Lag for the computation of the spatial regularized covariance. If None, lag will be set to 0 (block variance). |
None
|
Returns:
Type | Description |
---|---|
float
|
Regularized Covariance. |