Closed ViaSacra closed 6 years ago
You have classes that implement these models (GaussianVariogram, ExponentialVariogram, SphericalVariogram). Only these classes expect an already counted alpha. Tell me please, calculate alpha from the points you need the same way as in the class PowerVariogram? Example code for the constructor:
public PowerVariogram(double[][] x, double[] y, double beta, double nugget) {
if (beta < 1 || beta >= 2) {
throw new IllegalArgumentException("Invalid beta = " + beta);
}
if (nugget < 0) {
throw new IllegalArgumentException("Invalid nugget effect = " + nugget);
}
this.beta = beta;
this.nugget = nugget;
int n = x.length;
int dim = x[0].length;
double num = 0.0, denom = 0.0;
for (int i = 0; i < n; i++) {
for (int j = i + 1; j < n; j++) {
double rb = 0.0;
for (int k = 0; k < dim; k++) {
rb += ((x[i][k] - x[j][k])*(x[i][k] - x[j][k]));
}
rb = Math.pow(rb, 0.5 * beta);
num += rb * 0.5 * ((y[i] - y[j] - nugget)*(y[i] - y[j] - nugget));
denom += rb * rb;
}
}
alpha = num / denom;
}
Not really. It is just a heuristics, not a golden rule. For these hyper-parameters, they should be chosen based on your data. No trail-n-error tests are needed.
Check the book "numerical recipes"
That is, ideally, you need to calculate these three parameters individually for your points? But in the constructors of your classes of variograms they are set by default. Only alpha is considered as presented above, but this is not entirely correct, as I understood. Tell me please, can I read data using Kriging, using only the constructors and submitting the data by default and how much they will be reliable?
Dear @haifengl , please reply to my last message :)
- That is, ideally, you need to calculate these three parameters individually for your points?
- But in the constructors of your classes of variograms they are set by default. Only alpha is considered as presented above, but this is not entirely correct, as I understood?
- Tell me please, can I read data using Kriging, using only the constructors and submitting the data by default and how much they will be reliable?
I don't have some theoretical ways to calculate the hyperparameters. As suggested before, it is more a trial-n-error process. Interpolation is for low dimensional data (2 or 3 dimension). Some visual check can help you choose the hyperparameters.
Hello. Tell me please how to choose the type of Variogram in KrigingInterpolation? For example, a spherical or circular model. I will be very grateful for the answer, since I urgently need to understand this.