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 { ...@@ -9,15 +9,13 @@ class CovarianceFunction {
public: public:
double sigma = 1.0; double sigma = 1.0;
int norm_p = 2; int norm_p = 2;
double lambda1 = 0.15; std::vector<double> lambda;
double lambda2 = 0.15; // Has no influence on 1D
double smoothing = 1.0; double smoothing = 1.0;
CovarianceFunction() { CovarianceFunction() {
config.get("sigma", sigma); config.get("sigma", sigma);
config.get("norm_p", norm_p); config.get("norm_p", norm_p);
config.get("lambda1", lambda1); config.get("lambda", lambda);
config.get("lambda2", lambda2);
config.get("smoothing", smoothing); config.get("smoothing", smoothing);
} }
...@@ -29,7 +27,7 @@ public: ...@@ -29,7 +27,7 @@ public:
class CovarianceFunction1D : CovarianceFunction { class CovarianceFunction1D : CovarianceFunction {
public: public:
double covariance_fct(double *tau) override { double covariance_fct(double *tau) override {
tau[0] /= lambda1; tau[0] /= lambda[0];
return pow(sigma, 2) * exp(-pow(norm(tau), smoothing)); return pow(sigma, 2) * exp(-pow(norm(tau), smoothing));
} }
...@@ -41,8 +39,8 @@ public: ...@@ -41,8 +39,8 @@ public:
class CovarianceFunction2D : CovarianceFunction { class CovarianceFunction2D : CovarianceFunction {
public: public:
double covariance_fct(double *tau) override { double covariance_fct(double *tau) override {
tau[0] /= lambda1; tau[0] /= lambda[0];
tau[1] /= lambda2; tau[1] /= lambda[1];
return pow(sigma, 2) * exp(-pow(norm(tau), smoothing)); 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