krigekit.variogram_fitting#
Generic weighted fitting for marginal nested variogram models.
Classes#
Uniform result of a variogram fit at any level. |
Functions#
|
Least-squares fit of a (nested) variogram model to averaged data. |
|
Calculate goodness-of-fit metrics for a VariogramModel against empirical data. |
Module Contents#
- class krigekit.variogram_fitting.FitResult#
Uniform result of a variogram fit at any level.
targetis the fitted object (aVgmStructure, analysis model, or system).paramsis the flat fitted vector,covits covariance when available,optimizerthe SciPy result for joint/constrained fits, andmetricsa goodness-of-fit dict.summary()returns a labelled parameter table using each component’sname/vtype.- property success#
True unless an optimizer reported failure.
- summary()#
Return a labelled parameter table with variance and p-values.
Columns:
structure, component, vtype, param, value, variance, std_err, p_value.variance/std_errcome from the fit covariance (NaNwhen unavailable);p_valueis a two-sided Wald test that the parameter differs from zero (Student-t whennobsis known, else normal). Treat p-values as heuristic – binned variogram points are not independent.
- krigekit.variogram_fitting.fit_vgm(avgvgm, x_col=('distance', 'mean'), y_col=('variogram', 'mean'), sigma_col=None, weight_col=None, weights=None, models=('exponential',), p0=(), makeplot=False, maxfev=9999, ax=None, xlabel='Lag', ylabel='Semivariogram', bounds=None, return_model=False, return_metrics=False)#
Least-squares fit of a (nested) variogram model to averaged data.
modelsmay be a sequence of model names, a sequence ofVariogramModel.set_vgm-style dictionaries, or aVariogramModeltemplate. String-only models preserve the legacy additive fitting path. Dictionary/model templates also preserveproduct=Trueflags, so product structures can be fitted and returned as a Python-side model.p0is the initial guess assill0, range0, ..., [nugget].sigma_colgives SciPy-style observation standard deviations. Useweightsorweight_colfor weighted least squares, where larger values carry more influence; internally these are converted tosigma = 1 / sqrt(weight). Returns(params, covariance)by default; whenreturn_model=Truethe fittedVariogramModelis appended to the return tuple. Whenmakeplotis true, the Matplotlib axis is also appended.
- krigekit.variogram_fitting.calc_fit_metrics(avgvgm, model, x_col=('distance', 'mean'), y_col=('variogram', 'mean'))#
Calculate goodness-of-fit metrics for a VariogramModel against empirical data.