gstools.cokriging.Correlogram
- class gstools.cokriging.Correlogram(primary_model, cross_corr, secondary_var, primary_mean=0.0, secondary_mean=0.0)[source]
Bases:
ABCAbstract base class for cross-covariance models in collocated cokriging.
A correlogram encapsulates the spatial relationship between primary and secondary variables, including their cross-covariance structure and statistical parameters (means, variances).
This design allows for different cross-covariance models (MM1, MM2, etc.) to be implemented as separate classes, making the cokriging framework extensible and future-proof.
- Parameters:
primary_model (
CovModel) – Covariance model for the primary variable.cross_corr (
float) – Cross-correlation coefficient between primary and secondary variables at zero lag (collocated). Must be in [-1, 1].secondary_var (
float) – Variance of the secondary variable. Must be positive.primary_mean (
float, optional) – Mean value of the primary variable. Default: 0.0secondary_mean (
float, optional) – Mean value of the secondary variable. Default: 0.0
- Variables:
Notes
Subclasses must implement
compute_covariancesandcross_covarianceto define the cross-covariance structure.Methods
Compute covariances at zero lag.
Compute cross-covariance \(C_{YZ}(h)\) at distance \(h\).
- abstractmethod compute_covariances()[source]
Compute covariances at zero lag.
- Returns:
Notes
This method defines how the cross-covariance at zero lag is computed from the cross-correlation and variances. Different correlogram models may use different formulas.
- abstractmethod cross_covariance(h)[source]
Compute cross-covariance \(C_{YZ}(h)\) at distance \(h\).
- Parameters:
h (
floatornumpy.ndarray) – Distance(s) at which to compute cross-covariance.- Returns:
C_YZ_h – Cross-covariance at distance \(h\).
- Return type:
Notes
This is the key method that differentiates correlogram models. For example, MM1 uses the primary variable’s spatial structure while MM2 would use the secondary variable’s structure.