summaryrefslogtreecommitdiff
path: root/inst/covfcs/stk_discretecov.m
diff options
context:
space:
mode:
Diffstat (limited to 'inst/covfcs/stk_discretecov.m')
-rw-r--r--inst/covfcs/stk_discretecov.m14
1 files changed, 7 insertions, 7 deletions
diff --git a/inst/covfcs/stk_discretecov.m b/inst/covfcs/stk_discretecov.m
index 0789109..32108a5 100644
--- a/inst/covfcs/stk_discretecov.m
+++ b/inst/covfcs/stk_discretecov.m
@@ -32,7 +32,7 @@
% This file is part of
%
% STK: a Small (Matlab/Octave) Toolbox for Kriging
-% (http://sourceforge.net/projects/kriging)
+% (https://github.com/stk-kriging/stk/)
%
% STK is free software: you can redistribute it and/or modify it under
% the terms of the GNU General Public License as published by the Free
@@ -54,17 +54,17 @@ function K = stk_discretecov (param, x, y, diff, pairwise)
x = double (x);
y = double (y);
-if (nargin >= 4) && (diff ~= -1),
+if (nargin >= 4) && (diff ~= -1)
stk_error ('diff should be equal to -1', 'InvalidArgument');
end
-if nargin < 5,
+if nargin < 5
pairwise = false;
end
%--- compute covariance matrix -------------------------------------------------
-if ~pairwise,
+if ~pairwise
K = param.K(x, y);
else
idx = sub2ind (size (param.K), x, y);
@@ -78,13 +78,13 @@ end % function
%! n0 = 20; n1 = 10; dim = 4;
%! x0 = stk_sampling_randunif (n0, dim);
%! x1 = stk_sampling_randunif (n1, dim);
-%! model = stk_model ('stk_materncov52_aniso', dim);
+%! model = stk_model (@stk_materncov52_aniso, dim);
%! model.lm = stk_lm_affine ();
%! model.param = log ([1.0; 2.1; 2.2; 2.3; 2.4]);
%!test % without noise, pairwise = false
%! model.lognoisevariance = - inf;
-%! model2 = stk_model ('stk_discretecov', model, x0);
+%! model2 = stk_model (@stk_discretecov, model, x0);
%! idx = [1 4 9];
%! [K1, P1] = stk_make_matcov (model, x0(idx, :));
%! [K2, P2] = stk_make_matcov (model2, idx');
@@ -98,7 +98,7 @@ end % function
%!test % with noise, pairwise = false
%! model.lognoisevariance = log (0.01);
-%! model2 = stk_model ('stk_discretecov', model, x0);
+%! model2 = stk_model (@stk_discretecov, model, x0);
%! idx = [1 4 9];
%! [K1, P1] = stk_make_matcov (model, x0(idx, :));
%! [K2, P2] = stk_make_matcov (model2, idx');