xdem.spatialstats.infer_heteroscedasticity_from_stable#
- xdem.spatialstats.infer_heteroscedasticity_from_stable(dvalues, list_var, stable_mask=None, unstable_mask=None, list_var_names=None, spread_statistic=<function nmad>, list_var_bins=None, min_count=100, fac_spread_outliers=7)[source]#
Infer heteroscedasticity from differenced values on stable terrain and a list of explanatory variables.
This function returns an error map, a dataframe of spread values and the error function with explanatory variables. It is a convenience wrapper for estimate_model_heteroscedasticity to work on either Raster or array, compute the stable mask and return an error map.
If no stable or unstable mask is provided to mask in or out the values, all terrain is used.
- Parameters:
dvalues (
Union
[ndarray
[Any
,dtype
[floating
[Any
]]],TypeVar
(RasterType
, bound= Raster)]) – Proxy values as array or Raster (i.e., differenced values where signal should be zero such as elevation differences on stable terrain)list_var (
list
[Union
[ndarray
[Any
,dtype
[floating
[Any
]]],TypeVar
(RasterType
, bound= Raster)]]) – List of size (L) of explanatory variables as array or Raster of same shape as dvaluesstable_mask (
Union
[ndarray
[Any
,dtype
[floating
[Any
]]],Mask
,TypeVar
(VectorType
, bound= Vector),GeoDataFrame
]) – Vector shapefile of stable terrain (if dvalues is Raster), or boolean array of same shape as dvaluesunstable_mask (
Union
[ndarray
[Any
,dtype
[floating
[Any
]]],Mask
,TypeVar
(VectorType
, bound= Vector),GeoDataFrame
]) – Vector shapefile of unstable terrain (if dvalues is Raster), or boolean array of same shape as dvalueslist_var_names (
list
[str
]) – List of size (L) of names of the explanatory variables, otherwise named var1, var2, etc.spread_statistic (
Callable
[[ndarray
[Any
,dtype
[floating
[Any
]]]],floating
[Any
]]) – Statistic to be computed for the spread; defaults to nmadlist_var_bins (
int
|tuple
[int
,...
] |tuple
[ndarray
[Any
,dtype
[floating
[Any
]]]] |None
) – Count of size (1), or list of size (L) of counts or custom bin edges for the explanatory variables; defaults to 10 binsmin_count (
int
|None
) – Minimum number of samples to be used as a valid statistic (replaced by nodata)fac_spread_outliers (
float
|None
) – Exclude outliers outside this spread after standardizing; pass None to ignore.
- Return type:
tuple
[Union
[ndarray
[Any
,dtype
[floating
[Any
]]],TypeVar
(RasterType
, bound= Raster)],DataFrame
,Callable
[[tuple
[ndarray
[Any
,dtype
[floating
[Any
]]],...
]],ndarray
[Any
,dtype
[floating
[Any
]]]]]- Returns:
Inferred error map (array or Raster, same as input proxy values), Dataframe of binned spread statistic with explanatory variables, Error function with explanatory variables