environmentaltools.spatiotemporal.bme.compute_bme_moments

environmentaltools.spatiotemporal.bme.compute_bme_moments(dfk, dfh, dfs, covmodel, covparam, nmax, dmax, order, options, path, name)[source]

Compute Bayesian Maximum Entropy moments for spatiotemporal estimation.

This function calculates statistical moments at estimation points using BME theory, incorporating both hard (exact) and soft (probabilistic) data with spatiotemporal covariance modeling.

Parameters:
  • dfk (pd.DataFrame) – Estimation points with columns [‘x’, ‘y’, ‘t’] for spatial and temporal coordinates.

  • dfh (pd.DataFrame) – Hard data (exact observations) with columns [‘x’, ‘y’, ‘t’, ‘h’].

  • dfs (pd.DataFrame) – Soft data (probabilistic observations) with columns [‘x’, ‘y’, ‘t’, ‘h’, ‘s’].

  • covmodel (str) – Covariance model type (e.g., ‘exponential’, ‘gaussian’, ‘spherical’).

  • covparam (array-like) – Parameters for the covariance model.

  • nmax (list of int) – Maximum number of data points [hard_max, soft_max] to use in local neighborhoods.

  • dmax (list of float) – Maximum distances [spatial_max, temporal_max, space_time_ratio] for data selection.

  • order (list of int) – Polynomial regression orders [spatial_order, temporal_order] for local mean.

  • options (list) – BME options [max_integration_intervals, num_moments, percentile].

  • path (str) – Directory path for saving/loading cached results.

  • name (str) – Base filename for cached results.

Returns:

Array of shape (n_estimation_points, n_moments+1) containing estimated moments at each estimation point. Columns include probability, mean, variance, and skewness.

Return type:

np.ndarray

Notes

Results are cached to disk using NumPy’s .npy format. If a cached file exists, it will be loaded instead of recomputing.

The BME approach combines prior knowledge (covariance model) with hard and soft data to produce optimal spatiotemporal estimates.