xdem.spatialstats.number_effective_samples#
- xdem.spatialstats.number_effective_samples(area, params_variogram_model, rasterize_resolution=None, **kwargs)[source]#
Compute the number of effective samples, i.e. the number of uncorrelated samples, in an area accounting for spatial correlations described by a sum of variogram models.
This function wraps two methods:
- A discretized integration method that provides the exact estimate for any shape of area using a double sum of
covariance. By default, this method is approximated using Equation 18 of Hugonnet et al. (2022), https://doi.org/10.1109/jstars.2022.3188922 to decrease computing times while preserving a good approximation.
- A continuous integration method that provides a conservative (i.e., slightly overestimated) value for a disk
area shape, based on a generalization of the approach of Rolstad et al. (2009), http://dx.doi.org/10.3189/002214309789470950.
By default, if a numeric value is passed for an area, the continuous method is used considering a disk shape. If a vector is passed, the discretized method is computed on that shape. If the discretized method is used, a resolution for rasterization is generally expected, otherwise is arbitrarily chosen as a fifth of the shortest correlation range to ensure a sufficiently fine grid for propagation of the shortest range.
- Parameters:
area (
Union
[float
,int
,TypeVar
(VectorType
, bound= Vector),GeoDataFrame
]) – Area of interest either as a numeric value of surface in the same unit as the variogram ranges (will assume a circular shape), or as a vector (shapefile) of the areaparams_variogram_model (
DataFrame
) – Dataframe of variogram models to sum with three to four columns, “model” for the model types (e.g., [“spherical”, “matern”]), “range” for the correlation ranges (e.g., [2, 100]), “psill” for the partial sills (e.g., [0.8, 0.2]) and “smooth” for the smoothness parameter if it exists for this model (e.g., [None, 0.2]).rasterize_resolution (
Union
[TypeVar
(RasterType
, bound= Raster),float
]) – Resolution to rasterize the area if passed as a vector. Can be a float value or a Raster.kwargs (
Any
) – Keyword argument to pass to the neff_hugonnet_approx function.
- Return type:
- Returns:
Number of effective samples