diff options
Diffstat (limited to 'inst/covfcs/stk_gausscov_aniso.m')
-rw-r--r-- | inst/covfcs/stk_gausscov_aniso.m | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/inst/covfcs/stk_gausscov_aniso.m b/inst/covfcs/stk_gausscov_aniso.m index f68d602..774b2e3 100644 --- a/inst/covfcs/stk_gausscov_aniso.m +++ b/inst/covfcs/stk_gausscov_aniso.m @@ -40,7 +40,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 @@ -67,7 +67,7 @@ if nargin < 5, pairwise = false; end % check consistency for the number of factors dim = size (x, 2); -if size (y, 2) ~= dim, +if size (y, 2) ~= dim stk_error ('xi and yi have incompatible sizes.', 'InvalidArgument'); end @@ -84,7 +84,7 @@ Sigma2 = exp (param(1)); invRho = exp (param(2:end)); % check parameter values -if ~ (Sigma2 > 0) || ~ all (invRho >= 0), +if ~ (Sigma2 > 0) || ~ all (invRho >= 0) error ('Incorrect parameter value.'); end @@ -103,20 +103,20 @@ if isempty (x0) || isempty (y0) || isempty (param0) || ... compute_Kx_cache = true; end -if diff == -1, +if diff == -1 % Compute the value (not a derivative) k = Sigma2 * stk_rbf_gauss (D, -1); -elseif diff == 1, +elseif diff == 1 % Differentiate wrt param(1) = log (Sigma2) k = Sigma2 * stk_rbf_gauss (D, -1); -elseif (diff >= 2) && (diff <= nb_params), +elseif (diff >= 2) && (diff <= nb_params) % Differentiate wrt param(diff) = - log (invRho(diff-1)) ind = diff - 1; if compute_Kx_cache || isempty (Kx_cache) Kx_cache = 1 ./ (D + eps) .* (Sigma2 * stk_rbf_gauss (D, 1)); compute_Kx_cache = false; end - if pairwise, + if pairwise k = ((xs(:, ind) - ys(:, ind)) .^ 2) .* Kx_cache; else k = (bsxfun (@minus, xs(:, ind), ys(:, ind)')) .^ 2 .* Kx_cache; |