diff options
Diffstat (limited to 'inst/model/noise/@stk_gaussiannoise_het0/stk_variance_eval.m')
-rw-r--r-- | inst/model/noise/@stk_gaussiannoise_het0/stk_variance_eval.m | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/inst/model/noise/@stk_gaussiannoise_het0/stk_variance_eval.m b/inst/model/noise/@stk_gaussiannoise_het0/stk_variance_eval.m index 73ff871..ced356f 100644 --- a/inst/model/noise/@stk_gaussiannoise_het0/stk_variance_eval.m +++ b/inst/model/noise/@stk_gaussiannoise_het0/stk_variance_eval.m @@ -27,7 +27,7 @@ % Copyright Notice % -% Copyright (C) 2018 CentraleSupelec +% Copyright (C) 2018, 2020 CentraleSupelec % % Author: Julien Bect <julien.bect@centralesupelec.fr> @@ -36,7 +36,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 @@ -60,7 +60,12 @@ switch diff case {-1, 1} % -1 means "no derivative" % +1 means "derivative wrt log_dispersion" - v = exp (gn.log_dispersion) * feval (gn.variance_function, double (x)); + if isempty (x) + v = zeros (0, 1); + else + v = exp (gn.log_dispersion) ... + * feval (gn.variance_function, double (x)); + end otherwise stk_error ('diff should be either -1 or +1', 'IncorrectArgument'); end |