Regression kriging, after pykrige.rk.RegressionKriging (PyKrige).
fit/4 fits a regression of the values on predictors observed at the same points, then krige
the regression's residuals over the points (Geostatex.Kriging). predict/3 adds the kriged
residual to the regression at new points: the regression captures what the predictors explain
and kriging the spatial pattern they leave.
Options of fit/4
:regression-:linear(default: ordinary least squares with an intercept, as scikit-learn'sLinearRegression) or{fit, predict}, two functions:fit.(predictors, values)returns a model andpredict.(model, predictors)its predictions (a list), for any regression (Scholar, Axon, ...).:method-:ordinary(default) or:universalkriging of the residuals.:n_closest_points- the moving window of ordinary kriging at prediction (default10, as PyKrige;niluses every point); universal kriging uses every point, as PyKrige ignores it.- Any option of
Geostatex.Kriging.ordinary/3(oruniversal/3), with PyKrige'sRegressionKrigingdefaults:variogram_model: :linear,nlags: 6.
Predictors are a list of rows (a list or tuple of numbers each, or a number for a single
predictor), one per point; points as for Geostatex.Kriging.
iex> points = for x <- 0..4, y <- 0..4, do: {x * 1.0, y * 1.0}
iex> predictors = for {x, y} <- points, do: [x + 2 * y]
iex> values = for {x, y} <- points, do: 1 + 3 * (x + 2 * y) + :math.sin(x)
iex> rk = Geostatex.RegressionKriging.fit(predictors, points, values)
iex> Float.round(rk.intercept, 6) > 0
true
Summary
Types
Functions
Fits the regression and krige its residuals. See the module documentation.
The regression residual kriged at points.
The regression at predictors plus the residual kriged at points.
The coefficient of determination R² of predict/3 against values (scikit-learn's r2_score).