Commit 59adddae authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

adapted covariance function to lambda as vector

parent 6312d7fa
......@@ -9,15 +9,13 @@ class CovarianceFunction {
public:
double sigma = 1.0;
int norm_p = 2;
double lambda1 = 0.15;
double lambda2 = 0.15; // Has no influence on 1D
std::vector<double> lambda;
double smoothing = 1.0;
CovarianceFunction() {
config.get("sigma", sigma);
config.get("norm_p", norm_p);
config.get("lambda1", lambda1);
config.get("lambda2", lambda2);
config.get("lambda", lambda);
config.get("smoothing", smoothing);
}
......@@ -29,7 +27,7 @@ public:
class CovarianceFunction1D : CovarianceFunction {
public:
double covariance_fct(double *tau) override {
tau[0] /= lambda1;
tau[0] /= lambda[0];
return pow(sigma, 2) * exp(-pow(norm(tau), smoothing));
}
......@@ -41,8 +39,8 @@ public:
class CovarianceFunction2D : CovarianceFunction {
public:
double covariance_fct(double *tau) override {
tau[0] /= lambda1;
tau[1] /= lambda2;
tau[0] /= lambda[0];
tau[1] /= lambda[1];
return pow(sigma, 2) * exp(-pow(norm(tau), smoothing));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment