Replies: 3 comments
-
Could you provide some more information? If you want to interpolate measured data, kriging is totally fine and you could for example start with this tutorial: If you just want to obtain correlation I think you could use variogram estimation provided by GSTools. |
Beta Was this translation helpful? Give feedback.
-
@MuellerSeb Thank you so much for your response. I am working with Centrifuge soil models with allows to do scale soil models. The model is a soil retained by a sheet-pile (figure attached), under an earthquake excitation. In this experimental test I define the relative density of the soil and the intensity of the earthquake. And I can measure for example the largest displacement of the sheetpile during the earthquake. There is an intuitive correlation between these parameters, the larger the relative density, the smaller the sheetpile displacement. Also, the larger the shaking intensity, the larger the sheetpile displacement. However, we want to see a correlation between them, though an interpolated surface using kriging (figure attached). However, I wanted to check with you first, because I know initially kriging was use for geo-estatistics and the expected input data are locations (e.g. x,y). Also, I am worry about my lack of knowledge about kriging. I have spend some days learning about it, now I am more familiar with the Variogram (experimental and model) and the number of lags and the lag distance. However I do not have time to go ahead and learn the theory behind kriging. Maybe I can work with this? Again, thank you for your guidance. |
Beta Was this translation helpful? Give feedback.
-
@sepugua could you solve your problem? Sorry for not answering, but I've been a bit overwhelmed with this unfamiliar problem. In PyKrige your problem could look like this: import numpy as np
import pykrige as pk
import matplotlib.pyplot as plt
# seed for reproducibility
rng = np.random.RandomState(19970221)
# synthetic data and synthetic correlated data
# replace with YOUR OWN DATA
target_var_input = rng.rand(20)
correlated_1 = rng.rand(20)
correlated_2 = -rng.rand(20)
# random points
x_input = rng.rand(20) * 10
y_input = rng.rand(20) * 10
# regular output grid
x_output_grid = np.linspace(0, 10, 50)
y_output_grid = np.linspace(0, 10, 50)
# correlated parameters need to be given at
# output locations (with correct grid shape)
correlated_1_output = np.reshape(rng.rand(2500), (50, 50))
correlated_2_output = np.reshape(-rng.rand(2500), (50, 50))
# kriging setup
UK = pk.UniversalKriging(
x_input,
y_input,
target_var_input,
drift_terms=["specified"],
specified_drift=[correlated_1, correlated_2],
variogram_parameters={'slope': 0.1, 'nugget': 0},
verbose=True,
)
# interpolation
field, err = UK.execute(
style="grid",
xpoints=x_output_grid,
ypoints=y_output_grid,
specified_drift_arrays=[correlated_1_output, correlated_2_output],
)
# kriging setup without drift
UK = pk.UniversalKriging(
x_input,
y_input,
target_var_input,
variogram_parameters={'slope': 0.1, 'nugget': 0},
verbose=True,
)
# interpolation
field2, err2 = UK.execute(
style="grid",
xpoints=x_output_grid,
ypoints=y_output_grid,
)
# plotting
fig, axs = plt.subplots(2, 2, figsize=[6, 6])
im_kw = dict(origin="lower", extent=[0, 10, 0, 10], vmin=-1, vmax=1)
sc_kw = dict(edgecolors="k", vmin=-1, vmax=1)
axs[0, 0].imshow(correlated_1_output, **im_kw)
axs[0, 0].scatter(x_input, y_input, c=correlated_1, **sc_kw)
axs[0, 0].set_title("correlated_1")
axs[0, 1].imshow(correlated_2_output, **im_kw)
axs[0, 1].scatter(x_input, y_input, c=correlated_2, **sc_kw)
axs[0, 1].set_title("correlated_2")
axs[1, 0].imshow(field, **im_kw)
axs[1, 0].scatter(x_input, y_input, c=target_var_input, **sc_kw)
axs[1, 0].set_title("target var. with drift")
axs[1, 1].imshow(field2, **im_kw)
axs[1, 1].scatter(x_input, y_input, c=target_var_input, **sc_kw)
axs[1, 1].set_title("target var. without drift")
fig.tight_layout()
fig.show() |
Beta Was this translation helpful? Give feedback.
-
Hi, I am Civil Engineering graduate student, I would like to use kriging to obtain the correlation and the surface between 2 laboratory input data and one laboratory result output data. However, I do not have a strong statistics background. I was wondering, if you can give some kind of guidance on what to do.
My problem is about experimental centrifuge soil models, there I can define two input data of the model and then I performed the test and I obtained an output result. The thing is that I do not have a lot of tests (about 20).
Any suggestion on how to start will be really appreciated.
Beta Was this translation helpful? Give feedback.
All reactions