Covariance🍋
Covariance (Entity)
🍋
Nested Covariance class.
Attributes:
Name | Type | Description |
---|---|---|
dimension |
int |
Covariance dimension. |
sill |
float |
Covariance sill. |
metric |
List[Metric] |
Metric defining the covariances (angles and scales). |
dimension: int
property
readonly
🍋
Return Covariance dimension.
Returns:
Type | Description |
---|---|
int |
Covariance Dimension. |
metric: List[Metric]
property
readonly
🍋
Return metrics.
Returns:
Type | Description |
---|---|
List[Metric] |
List of Elementary Metric. |
sill: float
property
readonly
🍋
Return Covariance sill.
Returns:
Type | Description |
---|---|
float |
Covariance sill. |
eval(self, x, y, method=<VariographyMethod.COVARIOGRAM: '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". |
<VariographyMethod.COVARIOGRAM: 'COVARIOGRAM'> |
Returns:
Type | Description |
---|---|
float |
Computed covariance. |
plot(self, angles=[0, 0, 0], method=<VariographyMethod.SEMIVARIOGRAM: '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'. |
<VariographyMethod.SEMIVARIOGRAM: 'SEMIVARIOGRAM'> |
maxlag |
int |
Maximum distance to compute covariance. |
None |
save_file |
str |
Filename of saved figure. Defaults to None. |
None |
CovarianceElem (Entity)
🍋
Elementary covariance base class. Abstract base class, to be defined by its children.
Attributes:
Name | Type | Description |
---|---|---|
dimension |
int |
Covariance dimension. |
sill |
float |
Covariance sill. |
metric |
Metric |
Metric information. |
dimension: int
property
readonly
🍋
Return Covariance dimension.
Returns:
Type | Description |
---|---|
int |
Covariance Dimension. |
metric: Metric
property
readonly
🍋
Return covariance metric.
Returns:
Type | Description |
---|---|
Metric |
Covariance Metric. |
sill: float
property
readonly
🍋
Return Covariance sill.
Returns:
Type | Description |
---|---|
float |
Covariance sill. |
cov_func(self, h)
🍋
Return covariance function applied on a distance h.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
h |
np.ndarray |
Metric to apply covariance function on. |
required |
eval(self, x, y, method=<VariographyMethod.COVARIOGRAM: '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'. |
<VariographyMethod.COVARIOGRAM: 'COVARIOGRAM'> |
Returns:
Type | Description |
---|---|
float |
Computed covariance |
plot(self, angles=[0, 0, 0], method=<VariographyMethod.SEMIVARIOGRAM: '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'. |
<VariographyMethod.SEMIVARIOGRAM: 'SEMIVARIOGRAM'> |
maxlag |
int |
Maximum distance to compute covariance. |
None |
save_file |
str |
Filename of saved figure. Defaults to None. |
None |
Exponential (CovarianceElem)
🍋
Exponential Covariance Elementary base class.
Attributes:
Name | Type | Description |
---|---|---|
dimension |
int |
Covariance dimension. |
sill |
float |
Covariance sill. |
metric |
Metric |
Metric. |
cov_func(self, h)
🍋
Return covariance function applied on a distance h.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
h |
np.ndarray |
Metric to apply covariance function on. |
required |
Gaussian (CovarianceElem)
🍋
Gaussian Covariance Elementary base class.
Attributes:
Name | Type | Description |
---|---|---|
dimension |
int |
Covariance dimension. |
sill |
float |
Covariance sill. |
metric |
Metric |
Metric. |
cov_func(self, h)
🍋
Return covariance function applied on a distance h.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
h |
np.ndarray |
Metric to apply covariance function on. |
required |
Returns:
Type | Description |
---|---|
np.ndarray |
Covariance. |
Nugget (CovarianceElem)
🍋
Nugget Covariance Elementary base class.
Attributes:
Name | Type | Description |
---|---|---|
dimension |
int |
Covariance dimension. |
sill |
float |
Covariance sill. |
metric |
Metric |
Metric. |
cov_func(self, h)
🍋
Return covariance function applied on a distance h.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
h |
np.ndarray |
Metric to apply covariance function on. |
required |
Spherical (CovarianceElem)
🍋
Spherical Covariance Elementary base class.
Attributes:
Name | Type | Description |
---|---|---|
dimension |
int |
Covariance dimension. |
sill |
float |
Covariance sill. |
metric |
Metric |
Metric. |
cov_func(self, h)
🍋
Return covariance function applied on a distance h.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
h |
np.ndarray |
Metric to apply covariance function on. |
required |
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 |
Vector |
Number of discretization per cell. |
None |
lag |
List[float] |
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. |