[regression] some more files

This commit is contained in:
2020-12-21 21:33:13 +01:00
parent f5c3bb6139
commit f6b52d32cb
7 changed files with 14 additions and 14 deletions

View File

@@ -34,7 +34,7 @@ function gradmse = meanSquaredGradient(x, y, func, p)
ph = eye(length(p))*h; % ... for each parameter
mse = meanSquaredError(x, y, func, p);
for i = 1:length(p) % for each coordinate ...
msepi = meanSquaredError(x, y, func, p + ph(:,i));
msepi = meanSquaredError(x, y, func, p(:) + ph(:,i));
gradmse(i) = (msepi - mse)/h;
end
end

Binary file not shown.

View File

@@ -29,7 +29,7 @@ end
function gradmse = msegradient(t, x, func, p)
gradmse = zeros(size(p));
h = 1e-3; % stepsize for derivative
h = 1e-7; % stepsize for derivative
ph = eye(length(p))*h; % ... for each parameter
mse = meansquarederror(t, x, func, p);
for i = 1:length(p) % for each coordinate ...