infer module

This module contains various functions to infer parameters of archpy model. For now, only surface parameters can be inferred.

class infer.Cm2fit(h_max=10, w_max=10, r_max=100, nu_max=10, alpha=0, ax=None)

Bases: object

Class for adjusting variograms

Parameters:
  • h_max (float) – maximum distance for the variogram

  • w_max (float) – maximum variance for the variogram

  • r_max (float) – maximum range for the variogram

  • nu_max (float) – maximum smoothness (nu parameter) to consider for the variogram, only for Matern covariance

  • alpha (float) – angle of the direction of the variogram, 0 implies that x axis os oriented West-East and y axis South-North This is just initial value for the fit. Only used for 2D variograms

  • ax (matplotlib.axes, optional) – axes to plot the variogram

class infer.Var_exp(x, v, hmax_lim=1000, ax=None)

Bases: object

Class to estimate experimental variogram

Parameters:
  • x (array) – x coordinates of the points. size = (n, dim) with dim = 1, 2 or 3

  • v (array) – values

  • hmax_lim (float) – maximum distance to consider for the variogram

  • ax (matplotlib axis) – axis to plot the variogram

clear()
Meta_private:

fit(**kwargs)

Function to fit the experimental variogram

Parameters:

kwargs (dict) – dictionnary of parameters to pass to make_exp_var

make_exp_var(dim=1, **kwargs)

Function to estimate the experimental variogram

Parameters:
  • dim (int) – dimension of the problem

  • kwargs (dict) – dictionnary of parameters to pass to make_exp_var_1D, make_exp_var_2D or make_exp_var_3D

make_exp_var_1D(x, v, hmax, ncla=10, **kwargs)

Function to estimate the experimental variogram in 1D

Parameters:
  • x (array) – x coordinates of the points. size = (n, dim) with dim = 1, 2 or 3

  • v (array) – values

  • hmax (float) – maximum distance to consider for the variogram

  • ncla (int) – number of classes to consider

  • kwargs (dict) – dictionnary of parameters to pass to geone.covModel.variogramExp1D

make_exp_var_2D(x, v, hmax_x, hmax_y, ncla_x=10, ncla_y=10, alpha=0, **kwargs)

Function to estimate the experimental variogram in 2D

Parameters:
  • x (array) – x coordinates of the points. size = (n, dim) with dim = 1, 2 or 3

  • v (array) – values

  • hmax_x (float) – maximum distance to consider for the variogram in x direction

  • hmax_y (float) – maximum distance to consider for the variogram in y direction

  • ncla_x (int) – number of classes to consider in x direction

  • ncla_y (int) – number of classes to consider in y direction

  • alpha (float) – angle of the direction of the variogram

  • kwargs (dict) – dictionnary of parameters to pass to geone.covModel.variogramExp2D

make_exp_var_3D(x, v, ncla=(10, 10, 10), hmax=None, alpha=0, beta=0, gamma=0, **kwargs)
infer.cm_any_nan(cm)

Detect if there is a nan inside a covmodel

Parameters:

cm (geone.covModel.CovModel1D, geone.covModel.CovModel2D or geone.covModel.CovModel3D) – covmodel to check

infer.fit_surfaces(self, default_covmodel=None, **kwargs)

Function to fit a covmodel to each surface of an Arch_table object

Parameters:
  • self (base.Arch_table object) – Arch_table object to fit

  • default_covmodel (geone.CovModel2D object, optional) – Default covmodel to add if not enough data for a variogram

  • **kwargs – Arguments for infer_surface(). See infer_surface() for more details

infer.infer_surface(ArchTable, unit, hmax=nan, cm_to_fit=None, auto=True, dim=1, plot=True, npoints_min=20, max_nugget=1, bounds=None, default_covmodel=None, vb=1, **kwargs)

Infer surface parameters of a unit in an base.Arch_table. Fitting can be done automatically or manually.

Parameters:
  • ArchTable (base.Arch_table) – ArchTable to infer surface parameters

  • unit (base.Unit) – unit to infer surface parameters

  • hmax (float, optional) – maximum distance to consider for variogram inference

  • cm_to_fit (geone.covModel.CovModel1D, geone.covModel.CovModel2D or geone.covModel.CovModel3D, optional) – covmodel to fit

  • auto (bool, optional) – if True, automatic inference of the covmodel

  • dim (int, optional) – dimension of the covmodel to fit

  • plot (bool, optional) – if True, plot the variogram

  • npoints_min (int, optional) – minimum number of points to infer the covmodel

  • max_nugget (float, optional) – maximum nugget effect to infer

  • bounds (list, optional) – bounds for the parameters of the covmodel to fit list containing two lists, one for the lower bounds and one for the upper bounds of each parameter

Returns:

cm – inferred covmodel

Return type:

geone.covModel.CovModel1D, geone.covModel.CovModel2D or geone.covModel.CovModel3D

infer.plot_var_exp(h1, h2, v1, v2, p1, p2, print_pairs=False)

Function to plot experimental variogram

Parameters:
  • h1 (array) – spacing lag between points in x direction

  • h2 (array) – spacing lag between points in y direction

  • v1 (array) – variance between points in x direction

  • v2 (array) – variance between points in y direction

  • p1 (array) – number of pairs between points in x direction

  • p2 (array) – number of pairs between points in y direction

  • print_pairs (bool, optional) – print number of pairs on the plot. The default is False.